Explorar o código

修改文档问题

许智捷 %!s(int64=2) %!d(string=hai) anos
pai
achega
1163db5a5e

+ 40 - 31
src/components/jeecg/JModal/JModal.vue

@@ -6,42 +6,45 @@
     :visible="visible"
     v-bind="_attrs"
     v-on="$listeners"
+    :confirm-loading="confirmLoading"
     @ok="handleOk"
     @cancel="handleCancel"
     :destroyOnClose="destroyOnClose"
   >
-
     <slot></slot>
-    <!--有设置标题-->
-    <template v-if="!isNoTitle" slot="title">
-      <a-row class="j-modal-title-row" type="flex">
-        <a-col class="left">
-          <slot name="title">{{ title }}</slot>
-        </a-col>
-        <a-col v-if="switchFullscreen" class="right" @click="toggleFullscreen">
-          <a-button class="ant-modal-close ant-modal-close-x" ghost type="link" :icon="fullscreenButtonIcon"/>
-        </a-col>
-      </a-row>
-    </template>
-    <!--没有设置标题-->
-    <template v-else slot="title">
-      <a-row class="j-modal-title-row" type="flex">
-        <a-col v-if="switchFullscreen" class="right" @click="toggleFullscreen">
-          <a-button class="ant-modal-close ant-modal-close-x" ghost type="link" :icon="fullscreenButtonIcon"/>
-        </a-col>
-      </a-row>
-    </template>
-
-    <!-- 处理 scopedSlots -->
-    <template v-for="slotName of scopedSlotsKeys" :slot="slotName">
-      <slot :name="slotName"></slot>
-    </template>
+        <!--有设置标题-->
+        <template v-if="!isNoTitle" slot="title">
+          <a-row class="j-modal-title-row" type="flex">
+            <a-col class="left">
+              <slot name="title">{{ title }}</slot>
+            </a-col>
+            <a-col v-if="switchFullscreen" class="right" @click="toggleFullscreen">
+              <a-button class="ant-modal-close ant-modal-close-x" ghost type="link" :icon="fullscreenButtonIcon"/>
+            </a-col>
+          </a-row>
+        </template>
+        <!--没有设置标题-->
+        <template v-else slot="title">
+          <a-row class="j-modal-title-row" type="flex">
+            <a-col v-if="switchFullscreen" class="right" @click="toggleFullscreen">
+              <a-button class="ant-modal-close ant-modal-close-x" ghost type="link" :icon="fullscreenButtonIcon"/>
+            </a-col>
+          </a-row>
+        </template>
 
-    <!-- 处理 slots -->
-    <template v-for="slotName of slotsKeys" v-slot:[slotName]>
-      <slot :name="slotName"></slot>
-    </template>
+        <!-- 处理 scopedSlots -->
+        <template v-for="slotName of scopedSlotsKeys" :slot="slotName">
+          <a-spin :spinning="confirmLoadingTwo">
+            <slot :name="slotName"></slot>
+          </a-spin>
+        </template>
 
+        <!-- 处理 slots -->
+        <template v-for="slotName of slotsKeys" v-slot:[slotName]>
+          <a-spin :spinning="confirmLoadingTwo">
+            <slot :name="slotName"></slot>
+          </a-spin>
+        </template>
   </a-modal>
 </template>
 
@@ -58,6 +61,7 @@ export default {
       title: String,
       // 可使用 .sync 修饰符
       visible: Boolean,
+      confirmLoadingTwo: Boolean,
       // 是否开启拖拽
       draggable: Boolean,
       // 是否全屏弹窗,当全屏时无论如何都会禁止 body 滚动。可使用 .sync 修饰符
@@ -84,6 +88,7 @@ export default {
     data() {
       return {
         // 内部使用的 slots ,不再处理
+        confirmLoading: false,
         usedSlots: ['title'],
         // 实际控制是否全屏的参数
         innerFullscreen: this.fullscreen,
@@ -159,6 +164,10 @@ export default {
       },
 
       handleOk() {
+        this.confirmLoading = true
+        setTimeout(() => {
+          this.confirmLoading = false
+        }, 1500)
         if (this.okClose) {
           this.close()
         }
@@ -191,7 +200,7 @@ export default {
 </script>
 
 <style lang="less">
-  
+
   .j-modal-box {
     &.fullscreen {
       top: 0;
@@ -261,4 +270,4 @@ export default {
       max-width: 100vw;
     }
   }
-</style>
+</style>

+ 5 - 5
src/views/room/advanceOrder.vue

@@ -127,10 +127,10 @@
         </span>
       </a-table>
     </div>
-    <bill-room-info-modal
-      ref="ModalBillRoomInfo"
-      @ok="modalLockRoomFormOk"
-    ></bill-room-info-modal>
+<!--    <bill-room-info-modal-->
+<!--      ref="ModalBillRoomInfo"-->
+<!--      @ok="modalLockRoomFormOk"-->
+<!--    ></bill-room-info-modal>-->
   </a-card>
 </template>
 
@@ -147,7 +147,7 @@ export default {
   name: 'AdvanceOrder',
   mixins: [JeecgListMixin, mixinDevice],
   components: {
-    BillRoomInfoModal
+    // BillRoomInfoModal
   },
   data() {
     return {

+ 70 - 11
src/views/room/fangtailive.vue

@@ -177,14 +177,12 @@
                       placement="rightTop"
                       :mouseLeaveDelay="0"
                       overlayClassName="popoverWidth"
+                      popper-class="popover"
                     >
                       <!--有客人入住时,鼠标移入tip提示-->
                       <template
                         slot="content"
-                        v-if="
-                          roomLive.livingData && roomLive.livingData.livingOrder
-                        "
-                      >
+                        v-if="roomLive.livingData && roomLive.livingData.livingOrder && roomLive.livingData.livingOrder.livingType != 5">
                         <p>
                           入住:{{ roomLive.livingData.livingOrder.arrivalTime }}
                         </p>
@@ -222,6 +220,38 @@
                         <p v-if="roomLive.bookingData.releBookingRooms != null && roomLive.bookingData.releBookingRooms.length > 1">关联房:{{ releBookingRoom(roomLive.bookingData.releBookingRooms) }}</p>
                         <p>对客服务:{{ roomLive.livingData.livingOrder.ddisturb ? "  免打扰" : '' }} {{ roomLive.livingData.livingOrder.dquery ? "  免查询" : '' }}</p>
                       </template>
+                      <!--长租房入住时,鼠标移入tip提示-->
+                      <template
+                        slot="content"
+                        v-if="roomLive.livingData && roomLive.livingData.livingOrder && roomLive.livingData.livingOrder.livingType == 5">
+                        <p style="margin-bottom: 8px">
+                          租期:{{ moment(roomLive.livingData.livingOrder.arrivalTime).format('yyyy-MM-DD') }} ~ {{ moment(roomLive.livingData.livingOrder.dueOutTime).format('yyyy-MM-DD') }}
+                        </p>
+                        <p v-for="charge in roomLive.livingData.longRentChargeList" style="margin-bottom: 8px">
+                          {{ charge.name + ':' + charge.money + '元'}} {{ getChargeText(charge, roomLive.roomInfo) }}</p>
+                        <p style="margin-bottom: 8px">已收:{{ roomLive.livingData.livingOrder.shouKuan }}元 </p>
+                        <!-- <p>来源:{{ roomLive.detail.mobile }} 消费:300元</p> -->
+                        <p style="margin-bottom: 8px">余额:{{
+                          (roomLive.livingData.livingOrder.shouKuan -
+                            roomLive.livingData.livingOrder.xiaoFei).toFixed(2)
+                        }}
+                          <!-- {{ roomLive.detail.balance }} -->
+                        </p>
+                        <p style="margin-bottom: 8px">
+                          来源:{{
+                            getCustomerSourceList(
+                              roomLive.livingData.livingOrder.customerSource
+                            )
+                          }}
+                        </p>
+                        <p style="margin-bottom: 8px">注:{{ roomLive.livingData.livingOrder.remark }}</p>
+                        <p v-if="roomLive.bookingData.releBookingRooms != null && roomLive.bookingData.releBookingRooms.length > 1"  style="margin-bottom: 8px">
+                          关联房:{{ releBookingRoom(roomLive.bookingData.releBookingRooms) }}
+                        </p>
+                        <p style="margin-bottom: 8px">
+                          对客服务:{{ roomLive.livingData.livingOrder.ddisturb ? "  免打扰" : '' }} {{ roomLive.livingData.livingOrder.dquery ? "  免查询" : '' }}
+                        </p>
+                      </template>
                       <template
                         slot="title"
                         v-if="
@@ -237,9 +267,7 @@
                           性别:{{
                             roomLive.livingData.livingCustomers
                               ? roomLive.livingData.livingCustomers.gender == 1
-                                ? '男'
-                                : '女'
-                              : ''
+                                ? '男' : '女' : ''
                           }}
                         </p>
                         <p>
@@ -251,6 +279,7 @@
                         </p>
                         <!-- <p>同住人:{{ roomLive.detail.mobile }} 性别:女</p> -->
                       </template>
+                      <!--无人入住时,鼠标移入tip提示-->
                       <template
                         slot="content"
                         v-if="
@@ -314,7 +343,6 @@
                           <p>锁房原因:{{ roomLive.lockInfo.remark }}</p>
                         </template>
                       </template>
-                      <!--有客人入住时,鼠标移入tip提示-->
                       <!-- 房源方块内提示信息-->
                       <template
                         slot="title"
@@ -1389,6 +1417,18 @@ export default {
     // this.$refs.ModalEditScheduleRoom.disableSubmit = false;
   },
   methods: {
+    getChargeText(charge,roomInfo) {
+      if (charge.chargeType === 2) {
+        return '/' + charge.num+ '月'
+      } else if (charge.chargeType === 3) {
+        return '/吨 ' + ' 抄表:' + roomInfo.waterMeter + '吨'
+      } else if (charge.chargeType === 4) {
+        return '/度 ' + ' 抄表:' + roomInfo.energyMeter + '度'
+      } else if (charge.chargeType === 5) {
+        return '/立方 ' + ' 抄表:' + roomInfo.gasMeter + '立方'
+      }
+
+    },
     // 处理房型数字
     treatmentRoomType() {
       // 处理房型
@@ -1802,6 +1842,7 @@ export default {
       }, 200)
     },
     handleBillInfo(roomLive) {
+      debugger
       // console.log('handleBillInfo', roomLive)
       roomLive.popoverShow = false
       if (this.timeId) {
@@ -1817,7 +1858,7 @@ export default {
           })
         }
       } else {
-        // console.log(roomLive)
+        console.log(roomLive, 'roomLive')
         this.$refs.ModalBillRoomInfo.add(
           roomLive.livingData.livingOrder.bookingOrderId,
           1,
@@ -3074,8 +3115,26 @@ export default {
   padding: 8px 16px;
 }
 </style>
-<style>
+<style lang="less">
 .popoverWidth {
-  width: 220px !important;
+  width: auto !important;
+}
+.popover.a-popover {
+  background: #000022;
+  color: #fff;
 }
+//.popoverWidthLong{
+//  .ant-popover{
+//    color: #fff !important;
+//  }
+//  .ant-popover-title{
+//    color: #fff !important;
+//  }
+//  .ant-popover-inner{
+//    background-color: #5c6065 !important;
+//  }
+//  .ant-popover-inner-content{
+//    color: #fff !important;
+//  }
+//}
 </style>

+ 37 - 16
src/views/room/guestorders.vue

@@ -78,6 +78,11 @@
         class="j-table-force-nowrap"
         @change="handleTableChange"
       >
+        <template slot="yuE" slot-scope="text, record">
+          <span :class="record.yuE < 0 ? 'textColor' : ''">
+            {{ record.yuE }}
+          </span>
+        </template>
         <template slot="htmlSlot" slot-scope="text">
           <div v-html="text"></div>
         </template>
@@ -154,6 +159,19 @@ export default {
           dataIndex: 'orderNo'
         },
         {
+          title: '房号',
+          align: 'center',
+          dataIndex: 'roomName',
+          customRender: function (text, record) {
+            return !text ? '排房' : text
+          }
+        },
+        {
+          title: '房型',
+          align: 'center',
+          dataIndex: 'layoutName'
+        },
+        {
           title: '客人/电话',
           align: 'center',
           dataIndex: 'customerName',
@@ -196,19 +214,6 @@ export default {
           }
         },
         {
-          title: '房型',
-          align: 'center',
-          dataIndex: 'layoutName'
-        },
-        {
-          title: '房号',
-          align: 'center',
-          dataIndex: 'roomName',
-          customRender: function (text, record) {
-            return !text ? '排房' : text
-          }
-        },
-        {
           title: '房价',
           align: 'center',
           dataIndex: 'createDate',
@@ -238,14 +243,26 @@ export default {
           dataIndex: 'dueOutTime'
         },
         {
-          title: '金额',
+          title: '消费合计',
           align: 'center',
-          dataIndex: 'yuE',
+          // dataIndex: 'yuE',
           customRender: function (text, record) {
-            return record.yuE + '(余)/' + record.yushou + '(预)'
+            return record.yushou - record.yuE
           }
         },
         {
+          title: '收款合计',
+          align: 'center',
+          dataIndex: 'yushou',
+        },
+        {
+          title: '余额',
+          align: 'center',
+          dataIndex: 'yuE',
+          scopedSlots: { customRender: 'yuE' }
+
+        },
+        {
           title: '操作',
           dataIndex: 'action',
           align: 'center',
@@ -331,4 +348,8 @@ export default {
 </script>
 <style scoped>
 @import "~@assets/less/common.less";
+
+.textColor{
+  color: red;
+}
 </style>

+ 286 - 157
src/views/room/modules/checkIn/BillRoomForm.vue

@@ -22,7 +22,7 @@
                   <a-tab-pane
                     v-for="(room, aindex) in model.roomIds"
                     :key="room.id"
-                    :tab='(aindex === 0 ? "主" : "") + room.name'
+                    :tab="(aindex === 0 ? &quot;主&quot; : &quot;&quot;) + room.name"
                     :closable="true"
                     force-render
                   >
@@ -446,16 +446,16 @@
                     </a-col>
                     <a-col :span="24" v-else-if="model.orderInfo.bookingType == 5">
                       <a-form-model-item
-                          label="月数"
-                          :labelCol="labelCol"
-                          :wrapperCol="wrapperCol"
-                          prop="orderInfo.dayCount"
+                        label="月数"
+                        :labelCol="labelCol"
+                        :wrapperCol="wrapperCol"
+                        prop="orderInfo.dayCount"
                       >
                         <a-input-number
-                            v-model="monthCount"
-                            placeholder="月数"
-                            :min="1"
-                            @change="monthCountChange"
+                          v-model="monthCount"
+                          placeholder="月数"
+                          :min="1"
+                          @change="monthCountChange"
                         ></a-input-number
                         >月
                       </a-form-model-item>
@@ -484,12 +484,13 @@
                         prop="orderInfo.arrivalTime2"
                       >
                         <j-date
-                            placeholder="入住时间"
-                            v-model="model.orderInfo.arrivalTime2"
-                            style="width: 120px"
-                            :allowClear="false"
-                            :disabled-date="disabledDate"
-                            @change="arrivalTimeChange"
+                          placeholder="入住时间"
+                          v-model="model.orderInfo.arrivalTime2"
+                          style="width: 120px"
+                          :disabled="model.orderInfo.bookingType == 5"
+                          :allowClear="false"
+                          :disabled-date="disabledDate"
+                          @change="arrivalTimeChange"
                         />
                         <a-time-picker
                           style="width: 80px; margin-left: 2px"
@@ -509,13 +510,13 @@
                         prop="orderInfo.dueOutTime2"
                       >
                         <j-date
-                            placeholder="预离时间"
-                            v-model="model.orderInfo.dueOutTime2"
-                            style="width: 120px"
-                            :allowClear="false"
-                            :disabled-date="disabledDate"
-                            :disabled="model.orderInfo.bookingType === 2 || model.orderInfo.bookingType == 5"
-                            @change="arrivalTimeChange2"
+                          placeholder="预离时间"
+                          v-model="model.orderInfo.dueOutTime2"
+                          style="width: 120px"
+                          :allowClear="false"
+                          :disabled-date="disabledDate"
+                          :disabled="model.orderInfo.bookingType === 2 || model.orderInfo.bookingType == 5"
+                          @change="arrivalTimeChange2"
                         />
                         <a-time-picker
                           style="width: 80px; margin-left: 2px"
@@ -574,11 +575,11 @@
                       <a-col :span="7">
                         <a-input-number v-model="rentCharges.money" :min="0" placeholder="输入金额" style="width: 100%"></a-input-number>
                       </a-col>
-                      <a-col :span="2"><span>元/</span></a-col>
-                      <a-col :span="7">
-                        <a-input-number v-model="rentCharges.cycleNum" :min="0" placeholder="输入周期" style="width: 80%"></a-input-number>
-                      </a-col>
-                      <a-col :span="2"><span>月</span></a-col>
+                      <a-col :span="3">元/月</a-col>
+<!--                      <a-col :span="7">-->
+<!--                        <a-input-number v-model="rentCharges.cycleNum" :min="0" placeholder="输入周期" style="width: 80%"></a-input-number>-->
+<!--                      </a-col>-->
+<!--                      <a-col :span="2"><span>月</span></a-col>-->
 
                       <!--                      <a-col :span="6">-->
                       <!--                        <a-select v-model="rentCharges.cycleUnit">-->
@@ -611,19 +612,21 @@
                           <a-select-option :value="3"> 押3 </a-select-option>
                         </a-select>
                       </a-col>
-                      <a-col :span="8">
-                        <a-select v-model="rentCharges.num" @change="rentNumChange">
-                          <a-select-option :value="1"> 付1 </a-select-option>
-                          <a-select-option :value="2"> 付2 </a-select-option>
-                          <a-select-option :value="3"> 付3 </a-select-option>
-                        </a-select>
+                      <a-col :span="2"><span>付</span></a-col>
+                      <a-col :span="7">
+<!--                        <a-select v-model="rentCharges.num" @change="rentNumChange">-->
+<!--                          <a-select-option :value="1"> 付1 </a-select-option>-->
+<!--                          <a-select-option :value="2"> 付2 </a-select-option>-->
+<!--                          <a-select-option :value="3"> 付3 </a-select-option>-->
+<!--                        </a-select>-->
+                        <a-input v-model="rentCharges.num" @change="rentNumChange"></a-input>
                       </a-col>
                     </a-form-model-item>
                     <a-form-model-item
                       label="新增费项"
                       :labelCol="labelCol"
                       :wrapperCol="wrapperCol">
-                      <a-col :span="8">
+                      <a-col :span="12">
                         <a-select v-model="chargeType">
                           <a-select-option :value="1"> 一次性费项 </a-select-option>
                           <a-select-option :value="2"> 周期性费项 </a-select-option>
@@ -635,38 +638,49 @@
                       <a-col :span="3">
                         <a-button @click="addCharges">添加</a-button>
                       </a-col>
+                    </a-form-model-item>
+                    <a-form-model-item
+                      :wrapperCol="{ span: 18, offset: 4 }"
+                    >
                       <a-col :span="24">
                         <a-row v-for="(item, index) in chooseLongRentScheme.houseLongRentChargeList" v-if="!item.isMust">
-                          <a-icon
-                            type="minus-circle"
-                            style="color: #f56c6c"
-                            class="dynamic-delete-button"
-                            @click="removeCharge(index)"
-                          />
-                          <a-col :span="5">
-                            <a-input v-model="item.name" placeholder="输入费项名称" style="width: 90%"></a-input>
+                          <a-col :span="2">
+                            <a-icon
+                              type="minus-circle"
+                              style="color: #f56c6c"
+                              class="dynamic-delete-button"
+                              @click="removeCharge(index)"
+                            />
+                          </a-col>
+                          <a-col :span="7">
+                            <a-input v-model="item.name" placeholder="费项名" style="width: 100%"></a-input>
                           </a-col>
-                          <a-col :span="5">
-                            <a-input-number v-model="item.money":min="0" placeholder="输入金额" style="width: 90%" @change="$forceUpdate()"></a-input-number>
+                          <a-col :span="6">
+                            <a-input-number v-model="item.money":min="0" placeholder="金额" style="width: 100%" @change="$forceUpdate()"></a-input-number>
                           </a-col>
                           <a-col :span="4">
-                            <span v-if="item.chargeType == 1 || item.chargeType == 2">{{ '元' }}</span>
+                            <span v-if="item.chargeType == 1">{{ '元' }}</span>
+                            <span v-if="item.chargeType == 2">{{ '元/月' }}</span>
                             <span v-else-if="item.chargeType == 3">{{ '元/吨' }}</span>
                             <span v-else-if="item.chargeType == 4">{{ '元/度' }}</span>
-                            <span v-else-if="item.chargeType == 5">{{'元/立方' }}</span>
+                            <span v-else-if="item.chargeType == 5">{{ '元/立方' }}</span>
                           </a-col>
                           <a-col :span="5" v-if="item.chargeType == 3">
-                            <a-input-number v-model="model.roomIds[roomIdsIndex].waterMeter" :min="0" placeholder="输入读数" style="width: 90%"></a-input-number>
+                            <a-input-number v-model="model.roomIds[roomIdsIndex].waterMeter" :min="0" placeholder="读数" style="width: 100%"></a-input-number>
                           </a-col>
-                          <a-col :span="5" v-if="item.chargeType == 4">
-                            <a-input-number v-model="model.roomIds[roomIdsIndex].energyMeter" :min="0" placeholder="输入读数" style="width: 90%"></a-input-number>
+                          <a-col :span="5" v-else-if="item.chargeType == 4">
+                            <a-input-number v-model="model.roomIds[roomIdsIndex].energyMeter" :min="0" placeholder="读数" style="width: 100%"></a-input-number>
                           </a-col>
-                          <a-col :span="5" v-if="item.chargeType == 5">
-                            <a-input-number v-model="model.roomIds[roomIdsIndex].gasMeter" :min="0" placeholder="输入读数" style="width: 90%"></a-input-number>
-                          </a-col>
-                          <a-col :span="5" v-if="item.chargeType == 2">
-                            <a-input-number v-model="item.cycleNum" :min="0" placeholder="输入周期" style="width: 90%"></a-input-number>
+                          <a-col :span="5" v-else-if="item.chargeType == 5">
+                            <a-input-number v-model="model.roomIds[roomIdsIndex].gasMeter" :min="0" placeholder="读数" style="width: 100%"></a-input-number>
                           </a-col>
+<!--                          <a-col :span="5" v-else-if="item.chargeType == 2">-->
+<!--                            /月-->
+<!--                          </a-col>-->
+
+                          <!--                          <a-col :span="5" v-else-if="item.chargeType == 2">-->
+<!--                            <a-input-number v-model="item.cycleNum" :min="0" placeholder="周期" style="width: 100%"></a-input-number>-->
+<!--                          </a-col>-->
                           <!--                          <a-col :span="5" v-if="item.chargeType == 2">-->
                           <!--                            <a-select v-model="item.cycleUnit">-->
                           <!--                              <a-select-option :value="1"> 月 </a-select-option>-->
@@ -868,8 +882,8 @@
                   >
                     财务信息
                   </h4>
-                  <div>
-                    <a-switch v-model="depositSplit" />押金、房费分别记账到每个房间
+                  <div v-if="model.orderInfo.bookingType !== 5">
+                    <a-switch v-model="depositSplit"/> 押金、房费分别记账到每个房间
                   </div>
                 </div>
                 <a-divider />
@@ -905,12 +919,52 @@
                 <a-table
                   v-else
                   :columns="longRentColumns"
-                  :data-source="chooseLongRentScheme.houseLongRentChargeList"
+                  :data-source="model.roomIds"
                   :pagination="false"
                   rowKey="id"
+                  bordered
                   :scroll="{ y: 200, x: 500 }"
-                  style=" height: auto"
+                  style=" height: auto;"
+                  class="zhandan_class "
                 >
+                  <template slot="fangName" slot-scope="text, record, index" >
+<!--                    <div style="margin: 0px -16px;">-->
+<!--                      <div v-for="(item, indexs) in chooseLongRentScheme.houseLongRentChargeList" :key="indexs"  class="table_list_item">-->
+<!--                        {{ record.name }}-->
+<!--                      </div>-->
+<!--                    </div>-->
+                    {{ record.name }}
+                  </template>
+                  <template slot="name" slot-scope="text, record, index" >
+                    <div style="margin: 0 -16px;overflow: hidden; white-space: nowrap; text-overflow: ellipsis;">
+                      <div v-for="(item, indexs) in chooseLongRentScheme.houseLongRentChargeList" :key="indexs" :title="item.name"  class="table_list_item">
+                        {{ item.name }}
+                      </div>
+                    </div>
+                  </template>
+                  <template slot="chargeType" slot-scope="text, record, index" >
+                    <div style="margin: 0 -16px;overflow: hidden; white-space: nowrap; text-overflow: ellipsis;">
+                      <div v-for="(item, indexs) in chooseLongRentScheme.houseLongRentChargeList" :key="indexs"  class="table_list_item">
+                        {{ getChargeTypeText(item.chargeType) }}
+                      </div>
+                    </div>
+                  </template>
+                  <template slot="marketPrice" slot-scope="text, record, index" >
+                    <div style="margin: 0 -16px;overflow: hidden; white-space: nowrap; text-overflow: ellipsis;">
+                      <div v-for="(item, indexs) in chooseLongRentScheme.houseLongRentChargeList" :key="indexs"  class="table_list_item">
+                        {{ getMarketPriceText(item) }}
+                      </div>
+                    </div>
+                  </template>
+                  <template slot="remark" slot-scope="text, record, index" >
+                    <div style="margin: 0 -16px;overflow: hidden; white-space: nowrap; text-overflow: ellipsis;">
+                      <div v-for="(item, indexs) in chooseLongRentScheme.houseLongRentChargeList" :key="indexs" :title="getMeterText(item, record)" class="table_list_item">
+
+                        <span>{{ getMeterText(item, record) }}</span>
+                      </div>
+                    </div>
+                  </template>
+
                 </a-table>
                 <div
                   style="
@@ -1114,7 +1168,7 @@
                         </a-col>
                       </a-row>
                     </a-tab-pane>
-                    <div slot="tabBarExtraContent">
+                    <div slot="tabBarExtraContent" v-if="model.orderInfo.bookingType !== 5">
                       <a-switch v-model="paymentSplit" />押金、房费分开收款
                       <a-button type="link" @click="pulsFee">
                         添加费项
@@ -1247,73 +1301,52 @@ const columns = [
 ]
 
 const longRentColumns = [
-  // {
-  //     title: "",
-  //     dataIndex: "key",
-  //     width: 20,
-  //   },
+  {
+      title: '房号',
+      dataIndex: 'fangName',
+      width: 50,
+      align: 'center',
+      ellipsis: true,
+      scopedSlots: { customRender: 'fangName' }
+    },
   {
     title: '费项',
     dataIndex: 'name',
-    width: 70
+    width: 70,
+    align: 'center',
+    ellipsis: true,
+    scopedSlots: { customRender: 'name' }
+
   },
   {
     title: '费用类型',
     dataIndex: 'chargeType',
     width: 80,
-    customRender(text, record) {
-      if (text === 1) {
-        return '一次性'
-      } else if (text === 2) {
-        return '周期性'
-      } else if (text === 3) {
-        return '水费'
-      } else if (text === 4) {
-        return '电费'
-      } else if (text === 5) {
-        return '燃气费'
-      }
-    }
+    align: 'center',
+    ellipsis: true,
+    scopedSlots: { customRender: 'chargeType' }
+
+    // customRender(text, record) {
+
+    // }
   },
   {
     title: '费用标准',
     dataIndex: 'marketPrice',
     width: 60,
-    customRender(text, record) {
-      let standard = ''
-      standard = record.money + '元'
-      if (record.cycleUnit === 1) {
-        standard += '/月'
-      } else if (record.cycleUnit === 1) {
-        standard += '/季'
-      } else if (record.cycleUnit === 1) {
-        standard += '/年'
-      }
-      return standard
-    }
+    align: 'center',
+    ellipsis: true,
+    scopedSlots: { customRender: 'marketPrice' }
+  },
+  {
+    title: '备注',
+    dataIndex: 'remark',
+    width: 80,
+    align: 'center',
+    ellipsis: true,
+    scopedSlots: { customRender: 'remark' }
   }
-  // {
-  //   title: '优惠价',
-  //   dataIndex: 'prefPrice',
-  //   width: 80,
-  //   scopedSlots: { customRender: 'prefPrice' }
-  // },
-  // {
-  //   title: '天数',
-  //   dataIndex: 'day',
-  //   width: 50
-  // },
-  // {
-  //   title: '房费',
-  //   dataIndex: 'roomFee',
-  //   width: 60
-  // },
-  // {
-  //   title: '押金',
-  //   dataIndex: 'deposit',
-  //   scopedSlots: { customRender: 'deposit' },
-  //   width: 100
-  // }
+
 ]
 
 const columns2 = [
@@ -1332,7 +1365,7 @@ const columns2 = [
   {
     title: '应缴',
     dataIndex: 'receivable',
-    width: '25%',
+    width: '25%'
   },
   {
     title: '实收',
@@ -1388,6 +1421,8 @@ export default {
   },
   data() {
     return {
+      i: 1,
+      allChargeList: [],
       utcTxt: null,
       editDepositModal: false,
       // 会员选中数据
@@ -1635,6 +1670,18 @@ export default {
         // model.roomIds[roomIdsIndex].customerSource = model.orderInfo.customerSource
       }
     },
+    'model.roomIds.length'(val) {
+      if (this.chooseLongRentScheme.id != null) {
+        this.chooseLongRentScheme.houseLongRentChargeList.forEach(ele => {
+          let num = ele.num == null ? 1 : ele.num
+          let payable = ele.money * num * this.model.roomIds.length
+          this.$set(ele, 'payable', payable) // 应付价
+          this.$set(ele, 'relMoney', payable) // 实际支付价
+          this.$set(ele, 'payType', this.payTypeList[0].id)
+        })
+        this.$forceUpdate()
+      }
+    },
     'model.orderInfo.bookingType'(val, old) {
       if (val) {
         this.model.orderInfo.dayCount = this.daysBetween(this.model.orderInfo.arrivalTime2, this.model.orderInfo.dueOutTime2)
@@ -1689,7 +1736,6 @@ export default {
       }
     },
     otherRoomSync(value) {
-      debugger
       if (!value) {
         if (this.modelDefault.roomIds && this.modelDefault.roomIds.length > 0) {
           if (this.modelDefault.roomIds[0].key1) {
@@ -1702,11 +1748,7 @@ export default {
                 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
-                )
+                this.$set(room, 'customerId', this.modelDefault.roomIds[0].customerId)
               }
             }
           }
@@ -1783,12 +1825,12 @@ export default {
     },
     'chooseLongRentScheme.houseLongRentChargeList': {
         handler(newValue, oldValue) {
-          newValue.forEach((e,index) => {
+          newValue.forEach((e, index) => {
             this.$watch(
                 () => e.money,
                 (newName, oldName) => {
                   let num = e.num == null ? 1 : e.num
-                  let payable = e.money * num
+                  let payable = e.money * num * this.model.roomIds.length
                   e.payable = payable
                   // this.$set(e,'relMoney', payable)
                   e.relMoney = payable
@@ -2002,9 +2044,25 @@ export default {
   },
   methods: {
     getUserPayType(item) {
-      if (this.model.orderInfo.customerType === 2 && item.name === '单位挂账'
-      || this.model.orderInfo.customerType === 3 && item.name === '会员卡') {
-        return true
+      // if (this.model.orderInfo.customerType === 2 && item.name === '单位挂账' ||
+      // this.model.orderInfo.customerType === 3 && item.name === '会员卡' ||
+      // this.model.orderInfo.customerType === 1 && (item.name === '会员卡' || item.name === '单位挂账')) {
+      //   return true
+      // }
+      // return false
+
+      // if (this.model.orderInfo.customerType !== 2 && item.name !== '会员卡' ||
+      //     this.model.orderInfo.customerType !== 3 && item.name !== '单位挂账'
+      // ){
+      //   return false
+      // }
+      // return true
+
+
+      if (item.name === '会员卡') {
+        return this.model.orderInfo.customerType !== 2
+      } else if (item.name === '单位挂账') {
+        return this.model.orderInfo.customerType !== 3
       }
       return false
     },
@@ -2027,12 +2085,18 @@ export default {
       this.editPriceOk()
     },
     // 房价方案改变事件
-    longRentChange(record) {
-      console.log(record, 'record')
-      this.chooseLongRentScheme = this.longRentSchemeList.find(e => e.id === record)
+    longRentChange(longRentSchemeId) {
+      this.chooseLongRentScheme = this.longRentSchemeList.find(e => e.id === longRentSchemeId)
       if (this.chooseLongRentScheme == null) {
         return
       }
+      this.chooseLongRentScheme.houseLongRentChargeList.forEach(ele => {
+        let num = ele.num == null ? 1 : ele.num
+        let payable = ele.money * num * this.model.roomIds.length
+        this.$set(ele, 'payable', payable) // 应付价
+        this.$set(ele, 'relMoney', payable) // 实际支付价
+        this.$set(ele, 'payType', this.payTypeList[0].id)
+      })
       // 押金费项
       this.depositCharges = this.chooseLongRentScheme.houseLongRentChargeList.find(e => e.chargeType === 1 && e.isMust)
       // 租金费项
@@ -2041,29 +2105,84 @@ export default {
       this.collectionChargeList = this.chooseLongRentScheme.houseLongRentChargeList.filter(e => e.chargeType !== 3 && e.chargeType !== 4 && e.chargeType !== 5)
       this.monthCount = this.rentCharges.num
       this.monthCountChange(this.rentCharges.num)
-      let find = this.chooseLongRentScheme.houseLongRentChargeList.find(e => e.chargeType === 3)
-      if (find != null) {
-        // find.meterRead = thi
-      }
+
+      this.rentNumChange()
+
     },
+    // 押数量改变
     depositNumChange(value) {
       let payable = this.depositCharges.money * this.depositCharges.num
       this.depositCharges.relMoney = payable
       this.depositCharges.payable = payable
     },
-    rentNumChange(value) {
-      let payable = this.rentCharges.money * this.rentCharges.num
-      this.rentCharges.relMoney = payable
-      this.rentCharges.payable = payable
+    // 付数量改变
+    rentNumChange() {
+      // let payable = this.rentCharges.money * this.rentCharges.num
+      // this.rentCharges.relMoney = payable
+      // this.rentCharges.payable = payable
+      this.chooseLongRentScheme.houseLongRentChargeList.forEach(e => {
+        if (e.chargeType === 2) {
+          console.log(e.name)
+          e.num = this.rentCharges.num
+          let payable = e.money * this.rentCharges.num
+          e.relMoney = payable
+          e.payable = payable
+        }
+      })
+    },
+    getChargeTypeText(text) {
+      if (text === 1) {
+        return '一次性费用'
+      } else if (text === 2) {
+        return '周期性费用'
+      } else if (text === 3) {
+        return '抄表类水费'
+      } else if (text === 4) {
+        return '抄表类电费'
+      } else if (text === 5) {
+        return '抄表类燃气费'
+      }
+    },
+    getMarketPriceText(record){
+      let standard = ''
+      standard = record.money + '元'
+      if (record.chargeType === 2){
+        standard += '/月'
+      }
+      // if (record.cycleUnit === 1) {
+      //   standard += '/月'
+      // } else if (record.cycleUnit === 1) {
+      //   standard += '/季'
+      // } else if (record.cycleUnit === 1) {
+      //   standard += '/年'
+      // }
+      return standard
+    },
+    getMeterText(charge, room){
+      if (charge.chargeType === 1 && charge.isMust){
+        return '押' + charge.num
+      }
+      if (charge.chargeType === 2 && charge.isMust){
+        return '付' + charge.num
+      }
+      if (charge.chargeType === 3) {
+        return '起始读数: ' + room.waterMeter
+      }
+      if (charge.chargeType === 4) {
+        return '起始读数: ' + room.energyMeter
+      }
+      if (charge.chargeType === 5) {
+        return '起始读数: ' + room.gasMeter
+      }
+
     },
     addCharges() {
-      console.log(this.model, 'model,,,,')
       if (this.chargeType == null) {
         this.$message.warning('请先选择要添加的费项')
         return
       }
-      if ((this.chargeType === 3 || this.chargeType === 4 || this.chargeType === 5)
-          && this.chooseLongRentScheme.houseLongRentChargeList.some(e => e.chargeType === this.chargeType)) {
+      if ((this.chargeType === 3 || this.chargeType === 4 || this.chargeType === 5) &&
+          this.chooseLongRentScheme.houseLongRentChargeList.some(e => e.chargeType === this.chargeType)) {
         this.$message.warning('该抄表类费项已存在')
         return
       }
@@ -2074,7 +2193,8 @@ export default {
         relMoney: 0,
         payable: 0,
         cycleUnit: null,
-        payType: this.payTypeList[0].id
+        payType: this.payTypeList[0].id,
+        num: this.chargeType == 2 ? this.rentCharges.num : 1
       }
       this.chooseLongRentScheme.houseLongRentChargeList.push(charge)
       if (charge.chargeType === 1 || charge.chargeType === 2) {
@@ -2123,8 +2243,8 @@ export default {
       this.discount = 100
       console.log(value)
       this.housePriceSchemeList = this.specialSchemeList.filter(e => e.guestType == null || e.guestType === value)
-      console.log(this.housePriceSchemeList,'this.housePriceSchemeList')
-      console.log(this.model.orderInfo.roomPriceSlnId,'this.housePriceSchemeList')
+      console.log(this.housePriceSchemeList, 'this.housePriceSchemeList')
+      console.log(this.model.orderInfo.roomPriceSlnId, 'this.housePriceSchemeList')
       if (this.housePriceSchemeList.find(e => e.id === this.model.orderInfo.roomPriceSlnId) == null) {
         this.model.orderInfo.roomPriceSlnId = null
       }
@@ -2236,7 +2356,7 @@ export default {
       this.model.orderInfo.contractTeamProtocolName = info.name
       this.model.orderInfo.contractTeamProtocolId = info.id
       this.busMarketAgreementCustomer = info
-      if (info.fixedDiscount === 1 && info.discount > 0  && this.model.orderInfo.roomPriceSlnId == null) {
+      if (info.fixedDiscount === 1 && info.discount > 0 && this.model.orderInfo.roomPriceSlnId == null) {
         this.discount = info.discount
       }
     },
@@ -2458,7 +2578,7 @@ export default {
       this.editPriceModal = true
     },
     closeEditPrice() {
-      this.editPriceModal = false;
+      this.editPriceModal = false
       this.model.roomPrices = this.roomPriceCopy
     },
 
@@ -2688,6 +2808,7 @@ export default {
 
       console.log(this.model.roomPrices)
     },
+    // 居住月份数量改变
     monthCountChange(e) {
       if (e < this.rentCharges.num) {
         this.monthCount = this.rentCharges.num
@@ -2700,7 +2821,7 @@ export default {
       }
     },
     disabledDate(current) {
-      if (this.model.orderInfo.bookingType == 5){
+      if (this.model.orderInfo.bookingType == 5) {
         return false
       }
       return current && current < moment().add(-1, 'days').endOf('day')
@@ -2732,8 +2853,7 @@ export default {
     arrivalTimeChange2(e) {
       var v = parseInt(
         (new Date(this.model.orderInfo.dueOutTime2).getTime() -
-          new Date(this.model.orderInfo.arrivalTime2).getTime()) /
-          (1000 * 60 * 60 * 24)
+          new Date(this.model.orderInfo.arrivalTime2).getTime()) / (1000 * 60 * 60 * 24)
       )
       if (v <= 0) {
         this.model.orderInfo.arrivalTime2 = moment(
@@ -2748,7 +2868,7 @@ export default {
           (1000 * 60 * 60 * 24)
       )
       this.model.orderInfo.dayCount = Math.abs(v)
-      this.loadRooms();
+      this.loadRooms()
       this.dayCountChange()
     },
     arrivalTimeSpanChange(m, time) {
@@ -3385,7 +3505,7 @@ export default {
         }
       }
       // 节假日
-      if (this.holidayScheme != null && this.holidayScheme.allHolidayArr.some(e => {return e.list[0] <= date && e.list[1] >= date })) {
+      if (this.holidayScheme != null && this.holidayScheme.allHolidayArr.some(e => { return e.list[0] <= date && e.list[1] >= date })) {
         let findSchemeLayout = this.holidayScheme.schemeLayouts.find(e => e.layoutId === layoutId)
         if (findSchemeLayout) {
           // let find = findSchemeLayout.schemeLayoutDailyPriceList.find(e => moment(e.date) === date)
@@ -3425,15 +3545,6 @@ export default {
       ).then((res) => {
         if (res.success && res.result.records.length > 0) {
           this.longRentSchemeList = res.result.records
-          this.longRentSchemeList.forEach(e => {
-            e.houseLongRentChargeList.forEach(ele => {
-              let num = ele.num == null ? 1 : ele.num
-              let payable = ele.money * num
-              this.$set(ele, 'payable', payable) // 应付价
-              this.$set(ele, 'relMoney', payable) // 实际支付价
-              this.$set(ele, 'payType', this.payTypeList[0].id)
-            })
-          })
         }
       })
     },
@@ -3645,6 +3756,15 @@ export default {
 }
 </script>
 
+<style lang="less">
+.zhandan_class{
+  .ant-table-row td{
+    padding-top: 0 !important;
+    padding-bottom: 0 !important;
+  }
+}
+</style>
+
 <style scoped>
 /deep/ .ant-btn-link {
   flex: 1;
@@ -3704,4 +3824,13 @@ export default {
 /deep/.ant-tabs.ant-tabs-card .ant-tabs-card-bar .ant-tabs-tab-active {
   color: rgba(255, 141, 26, 1);
 }
+.table_list_item{
+  height: 42px;
+  line-height: 42px;
+  padding: 0 16px;
+  border-bottom: 1px solid #e8e8e8;
+  overflow: hidden;
+  white-space: nowrap;
+  text-overflow: ellipsis;
+}
 </style>

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

@@ -24,7 +24,7 @@ export default {
   data() {
     return {
       title: "",
-      width: 1400,
+      width: 1500,
       visible: false,
       disableSubmit: false,
     };

+ 70 - 13
src/views/room/modules/checkIn/BillRoomInfo.vue

@@ -135,9 +135,12 @@
                   style="color: rgba(255, 141, 26, 1); font-size: 18px"
                 />
               </a-descriptions-item>
-              <a-descriptions-item label="入住天数">
+              <a-descriptions-item label="入住天数" v-if="item.livingOrder.livingType !== 5">
                 {{ item.livingOrder && item.livingOrder.dayCount }}
               </a-descriptions-item>
+              <a-descriptions-item label="剩余天数" v-else>
+                {{ moment(item.livingOrder.dueOutTime).diff(moment(new Date()), 'day')  }}
+              </a-descriptions-item>
               <a-descriptions-item label="早餐券">
                 {{ item.livingOrder && item.livingOrder.breakfastNum }}
                 <a-icon
@@ -386,6 +389,18 @@
           </h4>
           <div style="display: flex">
             <div
+                @click="meterReading"
+                :class="`${isLiving && selectRoomId != '1' && chooseLivingRoom.livingOrder && chooseLivingRoom.livingOrder.livingType === 5  ? '' : 'disabled'}`"
+                style="display: flex; flex-direction: column">
+              <a-icon
+                  type="pound"
+                  style="color: rgba(255, 141, 26, 1); font-size: 18px"
+              /><a-button
+                type="link">
+              抄表
+              </a-button>
+            </div>
+            <div
               @click="strikeBalance"
               :class="`${isLiving ? '' : 'disabled'}`"
               style="display: flex; flex-direction: column">
@@ -463,22 +478,26 @@
               <!-- 单价-->
               <template slot="originalPrice" slot-scope="text, record, index" class="strike_style">
                 <span class="strike_style" v-if="record.returnItem">--</span>
-                <span v-else>{{ (record.subjectType === 6 || record.subjectType === 7) && record.feeGoodVo.originalPrice ? record.feeGoodVo.originalPrice : record.originalMoney }}</span>
+                <span v-else-if="record.subjectType === 6 || record.subjectType === 7">{{ record.feeGoodVo.originalPrice ? record.feeGoodVo.originalPrice : record.originalMoney }}</span>
+                <span v-else>{{ record.subjectType === 11 && record.num ? (record.originalMoney/record.num).toFixed(2) : record.originalMoney }}</span>
+              </template>
+              <!--优惠价-->
+              <template slot="money" slot-scope="text, record, index" class="strike_style">
+                <span class="strike_style" v-if="record.returnItem">--</span>
+                <span v-else-if="record.subjectType === 6 || record.subjectType === 7" >{{ record.feeGoodVo.price ? record.feeGoodVo.price : record.originalMoney }}</span>
+                <span v-else-if="record.subjectType === 11 && record.num">{{ (record.originalMoney/record.num).toFixed(2) }}</span>
+                <span v-else>{{ record.originalMoney }}</span>
               </template>
               <template slot="num" slot-scope="text, record, index" class="strike_style">
                 <span class="strike_style" v-if="record.returnItem">{{ record.returnNum }}</span>
-                <span v-else>{{ (record.subjectType === 6 || record.subjectType === 7) && record.feeGoodVo.num ? record.feeGoodVo.num : 1 }}</span>
-                </template>
+                <span v-else-if="record.subjectType === 6 || record.subjectType === 7">{{ record.feeGoodVo.num ? record.feeGoodVo.num : 1 }}</span>
+                <span v-else>{{ record.subjectType === 11 && record.num ? record.num : '1' }}</span>
+              </template>
               <!-- 小计 -->
               <template slot="originalMoney" slot-scope="text, record, index" class="strike_style">
                 <span class="strike_style" v-if="record.returnItem">{{ record.money }}</span>
                 <span v-else>{{ record.originalMoney }}</span>
               </template>
-              <!--优惠价-->
-              <template slot="money" slot-scope="text, record, index" class="strike_style">
-                <span class="strike_style" v-if="record.returnItem">--</span>
-                <span v-else>{{ (record.subjectType === 6 || record.subjectType === 7) && record.feeGoodVo.price ? record.feeGoodVo.price : 1 }}</span>
-              </template>
               <!-- <template slot="roomId" slot-scope="text, record, index" class="strike_style">
                 {{ getRoomName(text) }}
               </template> -->
@@ -679,6 +698,7 @@
     <refund-modal ref="modalRefundForm" @ok="modalFormOk"></refund-modal>
     <pay-or-refund-modal ref="modalPayOrRefundForm" @ok="modalFormOk"></pay-or-refund-modal>
     <fee-modal ref="modalFeeForm" @ok="modalFormOk"></fee-modal>
+    <meter-reading-modal ref="modalMeterReading" @ok="modalFormOk"></meter-reading-modal>
     <strike-balance-model ref="modalStrikeBalanceForm" @ok="modalFormOk"></strike-balance-model>
     <member-message-modal ref="modalMemberMessage" @ok="modalFormOk"></member-message-modal>
     <lease-goods-modal ref="modalLeaseGoods" @ok="modalFormOk"></lease-goods-modal>
@@ -716,7 +736,7 @@
     ></edit-booking-type-modal>
 
     <!-- 叫醒服务弹窗 -->
-    <a-modal
+    <j-modal
       :title="'叫醒服务'"
       :visible="wakeService"
       @cancel="wakeService = false"
@@ -752,7 +772,7 @@
         format="HH:mm"
         @change="onChangeWakeServiceTime"
       />
-    </a-modal>
+    </j-modal>
   </div>
 </template>
 
@@ -780,6 +800,7 @@ import AdjustPriceForm from '@views/room/modules/checkIn/AdjustPriceForm'
 import StrikeBalance from '@views/room/modules/checkIn/StrikeBalanceModel'
 import StrikeBalanceModel from '@views/room/modules/checkIn/StrikeBalanceModel'
 import EnterAccountModel from '@views/room/modules/checkIn/EnterAccountModel'
+import MeterReadingModal from '@views/room/modules/checkIn/MeterReadingModel'
 const columns0 = [
   {
     title: '房间号',
@@ -886,6 +907,8 @@ const columns1 = [
     customRender: function (text, record) {
       if ((record.subjectType === 6 || record.subjectType === 7) && record.feeGoodVo.originalPrice) {
         return record.feeGoodVo.originalPrice
+      } else if (record.subjectType === 11 && record.num){
+        return (record.originalMoney / record.num).toFixed(2)
       }
       return record.originalMoney
     }
@@ -899,6 +922,8 @@ const columns1 = [
     customRender: function (text, record) {
       if ((record.subjectType === 6 || record.subjectType === 7) && record.feeGoodVo.price) {
         return record.feeGoodVo.price
+      } else if (record.subjectType === 11 && record.num){
+        return (record.originalMoney / record.num).toFixed(2)
       }
       return record.originalMoney
     }
@@ -912,6 +937,8 @@ const columns1 = [
     customRender: function (text, record) {
       if ((record.subjectType === 6 || record.subjectType === 7) && record.feeGoodVo.num) {
         return record.feeGoodVo.num
+      } else if (record.subjectType === 11 && record.num){
+        return record.num
       }
       return 1
     }
@@ -1021,6 +1048,7 @@ const endDate = new Date(date.setDate(date.getDate() + 1))
 export default {
   name: 'BusMeetingRoomForm',
   components: {
+    MeterReadingModal,
     EnterAccountModel,
     StrikeBalanceModel,
     StrikeBalance,
@@ -1085,6 +1113,7 @@ export default {
         sm: { span: 16 }
       },
       confirmLoading: false,
+
       validatorRules: {
         dateRange: [{ required: true, message: '请选择维修时间!' }],
         remark: [{ required: true, message: '请输入维修原因!' }]
@@ -1710,7 +1739,6 @@ export default {
       var msg = ''
       if (text == 1) {
         msg = '押金'
-        //
         if (record.remark != null && record.remark != '') {
           msg = record.remark
         }
@@ -1740,7 +1768,7 @@ export default {
       } else if (text == 10) {
         msg = '手工房费'
       } else if (text == 11) {
-        msg = '水电煤抄表'
+        msg = record.remark
       } else if (text == 12) {
         msg = '赔偿费'
       } else if (text == 13) {
@@ -1952,6 +1980,20 @@ export default {
             }
           })
     },
+    getCharge() {
+      let ids = []
+      this.model.livingRoomIds.forEach((item) => {
+        if (item.roomName != '全部') {
+          ids.push(item.livingOrder && item.livingOrder.id)
+        }
+      })
+      console.log(ids, "ffffffffffffffffffffffffff")
+      getAction('/rooms/houseLongRentCharges/getMeterCharge', { livingOrderId: ids.toString() }).then((res) => {
+        if (res.success) {
+          console.log(res.result.records, 'res.result.records')
+        }
+      })
+    },
     tabFeeChange() {
       // this.
     },
@@ -1967,6 +2009,16 @@ export default {
       this.$refs.modalRefundForm.edit(chooseRooms)
       this.$refs.modalRefundForm.payTypeList = this.payTypeList
     },
+    meterReading() {
+      console.log(this.model, 'this.model')
+      var index = this.model.livingRoomIds.findLastIndex(
+          (t) => t.roomId == this.selectRoomId
+      )
+      var livingRoom = this.model.livingRoomIds[index]
+      this.$refs.modalMeterReading.visible = true
+      this.$refs.modalMeterReading.edit(livingRoom.roomId, livingRoom.livingOrder.id)
+      this.$refs.modalMeterReading.title = '读表'
+    },
     strikeBalance() {
       console.log(this.model)
       let map = new Map()
@@ -2124,6 +2176,7 @@ export default {
       if (isLeaveNotSettle) {
         url = '/business/busRoomBookingOrders/leave-not-settle?bookingOrderId='
       }
+      this.$emit('changeLoading', true)
       httpAction(
         url + find.bookingOrdersId + '&livingOrderId=' + find.livingOrder.id,
         {},
@@ -2132,10 +2185,14 @@ export default {
         if (res.success) {
           this.$message.success(res.message)
           this.getBookingOrderInfo()
+          this.$emit('changeLoading', false)
           this.$emit('ok')
         } else {
           this.$message.warning(res.message)
+          this.$emit('changeLoading', false)
         }
+      }).finally(e => {
+        this.$emit('changeLoading', false)
       })
     },
     adjustPrice() {

+ 44 - 31
src/views/room/modules/checkIn/BillRoomInfoModal.vue

@@ -4,6 +4,7 @@
     :visible="visible"
     switchFullscreen
     @ok="handleOk"
+    :confirmLoadingTwo="confirmLoading"
     :okButtonProps="{ class: { 'jee-hidden': disableSubmit } }"
     @cancel="handleCancel"
     cancelText="关闭"
@@ -11,14 +12,14 @@
   >
     <template slot="title">
       <div
-          style="
-          display: flex;
-          height: 80px;">
+        style="
+        display: flex;
+        height: 80px;">
         <div class="menu" v-if="livingStatu === -1">
           <a-icon @click="adjustPrice" type="account-book" style="color: #fff; font-size: 30px; width:120px; align-self: center;" />
           <a-button @click="adjustPrice" type="link" style="width: 120px; text-align: center; align-self: center"> 调价 </a-button>
         </div>
-        <div class="menu"  v-if="livingStatu === -1">
+        <div class="menu" v-if="livingStatu === -1">
           <a-icon @click="handleLeaseGoods" type="block" style="color: #fff; font-size: 30px; width:120px; align-self: center;" />
           <a-button type="link" @click="handleLeaseGoods" style="width: 120px; text-align: center; align-self: center">
             物品借用
@@ -63,36 +64,37 @@
           <a-button type="link" style="width: 120px; text-align: center; align-self: center"> 自定义账单 </a-button>
         </div>
       </div></template>
-    <bill-room-info ref="realForm" @ok="submitCallback" @changeLivingStatu="(e) =>{livingStatu = e}"></bill-room-info>
+    <bill-room-info ref="realForm" @ok="submitCallback" @changeLoading="changeLoading" @changeLivingStatu="(e) =>{livingStatu = e}"></bill-room-info>
   </j-modal>
 </template>
 
 <script>
-import BillRoomInfo from "./BillRoomInfo";
+import BillRoomInfo from './BillRoomInfo'
 import { getAction, httpAction } from '@api/manage'
 
 export default {
-  name: "BillRoomInfoModal",
+  name: 'BillRoomInfoModal',
   components: {
-    BillRoomInfo,
+    BillRoomInfo
   },
   data() {
     return {
-      title: "",
+      title: '',
       width: 1500,
+      confirmLoading: false,
       visible: false,
       disableSubmit: false,
       /* -1正常入住 1结账退房 2未结退房 */
       livingStatu: null
-    };
+    }
   },
   methods: {
     add(bookingOrderId, key, roomId, liveOrderId) {
       // let hotelId = roomLive.livingData.livingOrder.hotelId;
-      let obj = {
-        bookingOrderId: bookingOrderId,
-        roomId: roomId
-      }
+      // let obj = {
+      //   bookingOrderId: bookingOrderId,
+      //   roomId: roomId
+      // }
       // getAction('/business/busRoomBookingOrders/canOnlyPaySelf', obj).then(res =>{
           // if (res.result && !confirm('是否团体支付??')) {
           //   httpAction(
@@ -122,52 +124,63 @@ export default {
       // });
       this.visible = true
       this.$nextTick(() => {
-        this.$refs.realForm.add(bookingOrderId, key, roomId);
+        this.$refs.realForm.add(bookingOrderId, key, roomId)
       })
     },
-    getOrder(){
+    getOrder() {
 
     },
     edit(record) {
-      this.visible = true;
+      this.visible = true
       this.$nextTick(() => {
-        this.$refs.realForm.edit(record);
-      });
+        this.$refs.realForm.edit(record)
+      })
     },
     close() {
-      this.$emit("close");
-      this.visible = false;
+      this.$emit('close')
+      this.visible = false
     },
     handleOk() {
-      this.$refs.realForm.submitForm();
+      this.$refs.realForm.submitForm()
     },
     handleUnion() {
-      this.$refs.realForm.addUnion();
+      this.$refs.realForm.addUnion()
     },
     handleMessage() {
-      this.$refs.realForm.addMessage();
+      this.$refs.realForm.addMessage()
     },
     handleLeaseGoods() {
-      this.$refs.realForm.addLeaseGoods();
+      this.$refs.realForm.addLeaseGoods()
     },
     handleLeaveNotSettle() {
-      this.$refs.realForm.handleLeaveNotSettle(true)
+      let that = this
+      this.$confirm({
+        title: '先走不结',
+        content: '确认先走不结吗?',
+        onOk: function () {
+          that.$refs.realForm.handleLeaveNotSettle(true)
+        }
+      })
     },
     cancelHandleLeaveNotSettle() {
       this.$refs.realForm.handleLeaveNotSettle(false)
     },
     submitCallback() {
-      this.$emit("ok");
+      this.$emit('ok')
       // this.visible = false;
     },
     handleCancel() {
-      this.close();
+      this.close()
     },
-    adjustPrice(){
+    adjustPrice() {
       this.$refs.realForm.adjustPrice()
+    },
+    changeLoading(e) {
+      console.log('进来了加载', e)
+      this.confirmLoading = e
     }
-  },
-};
+  }
+}
 </script>
 <style lang="less">
 .ant-modal-header_living{

+ 280 - 0
src/views/room/modules/checkIn/MeterReadingModel.vue

@@ -0,0 +1,280 @@
+<template>
+  <j-modal
+      :title="title"
+      :width="width"
+      :visible="visible"
+      switchFullscreen
+      @ok="handleOk"
+      :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
+      @cancel="handleCancel"
+      cancelText="关闭">
+
+    <!-- 水表:上期读数:(自动带入上期读数,初始须提前设置,可修改):(可填)本期用量:(=本期-上期) 单价:(提前设置好的) 本期应缴:(根据用量和单价自动计算)-->
+    <a-row v-if="waterCharge.id != null">
+      <a-col :span="2">
+        <a-form-model-item>
+          <span style="font-size: large; font-weight: bold;"> 水表:</span>
+        </a-form-model-item>
+      </a-col>
+      <a-col :span="3">
+        <a-form-model-item
+            label="上期读数"
+           :labelCol="labelCol"
+           :wrapperCol="wrapperCol">
+          {{ room.waterMeter }}
+        </a-form-model-item>
+      </a-col>
+      <a-col :span="5">
+        <a-form-model-item
+            label="本期读数"
+            :labelCol="labelCol"
+            :wrapperCol="wrapperCol">
+          <a-input-number :precision="2" v-model="waterCharge.meterRead" @change="dushuChange($event, room.waterMeter, waterCharge)" style="width: 100%"></a-input-number>
+        </a-form-model-item>
+      </a-col>
+      <a-col :span="5">
+        <a-form-model-item
+            label="本期用量"
+            :labelCol="labelCol"
+            :wrapperCol="wrapperCol">
+          {{ waterCharge.useNum }}
+        </a-form-model-item>
+      </a-col>
+      <a-col :span="4">
+        <a-form-model-item
+            label="单价"
+            :labelCol="labelCol"
+            :wrapperCol="wrapperCol">
+          {{ waterCharge.money + '元/吨' }}
+        </a-form-model-item>
+      </a-col>
+      <a-col :span="4">
+        <a-form-model-item
+            label="本期应缴"
+            :labelCol="labelCol"
+            :wrapperCol="wrapperCol">
+          {{ waterCharge.feeMoney }}
+        </a-form-model-item>
+      </a-col>
+    </a-row>
+    <a-row v-if="energyCharge.id != null">
+      <a-col :span="2">
+        <a-form-model-item>
+          <span style="font-size: large; font-weight: bold;"> 电表:</span>
+        </a-form-model-item>
+      </a-col>
+      <a-col :span="3">
+        <a-form-model-item
+            label="上期读数"
+           :labelCol="labelCol"
+           :wrapperCol="wrapperCol">
+          {{ room.energyMeter }}
+        </a-form-model-item>
+      </a-col>
+      <a-col :span="5">
+        <a-form-model-item
+            label="本期读数"
+            :labelCol="labelCol"
+            :wrapperCol="wrapperCol">
+          <a-input-number v-model="energyCharge.meterRead" @change="dushuChange($event, room.energyMeter, energyCharge)" style="width: 100%"></a-input-number>
+        </a-form-model-item>
+      </a-col>
+      <a-col :span="5">
+        <a-form-model-item
+            label="本期用量"
+            :labelCol="labelCol"
+            :wrapperCol="wrapperCol">
+          {{ energyCharge.useNum }}
+        </a-form-model-item>
+      </a-col>
+      <a-col :span="4">
+        <a-form-model-item
+            label="单价"
+            :labelCol="labelCol"
+            :wrapperCol="wrapperCol">
+          {{ energyCharge.money + '元/度' }}
+        </a-form-model-item>
+      </a-col>
+      <a-col :span="4">
+        <a-form-model-item
+            label="本期应缴"
+            :labelCol="labelCol"
+            :wrapperCol="wrapperCol">
+          {{ energyCharge.feeMoney }}
+        </a-form-model-item>
+      </a-col>
+    </a-row>
+    <a-row v-if="gasCharge.id != null">
+      <a-col :span="2">
+        <a-form-model-item>
+          <span style="font-size: large; font-weight: bold;">燃气表:</span>
+        </a-form-model-item>
+      </a-col>
+      <a-col :span="3">
+        <a-form-model-item
+            label="上期读数:"
+           :labelCol="labelCol"
+           :wrapperCol="wrapperCol">
+          {{ room.gasMeter }}
+        </a-form-model-item>
+      </a-col>
+      <a-col :span="5">
+        <a-form-model-item
+            label="本期读数:"
+            :labelCol="labelCol"
+            :wrapperCol="wrapperCol">
+          <a-input-number v-model="gasCharge.meterRead"  @change="dushuChange($event, room.gasMeter, gasCharge)" style="width: 100%"></a-input-number>
+        </a-form-model-item>
+      </a-col>
+      <a-col :span="5">
+        <a-form-model-item
+            label="本期用量"
+            :labelCol="labelCol"
+            :wrapperCol="wrapperCol">
+          {{ gasCharge.useNum }}
+        </a-form-model-item>
+      </a-col>
+      <a-col :span="4">
+        <a-form-model-item
+            label="单价"
+            :labelCol="labelCol"
+            :wrapperCol="wrapperCol">
+          {{ gasCharge.money + '元/立方' }}
+        </a-form-model-item>
+      </a-col>
+      <a-col :span="4">
+        <a-form-model-item
+            label="本期应缴"
+            :labelCol="labelCol"
+            :wrapperCol="wrapperCol">
+          {{ gasCharge.feeMoney }}
+        </a-form-model-item>
+      </a-col>
+    </a-row>
+  </j-modal>
+</template>
+
+<script>
+
+import { getAction, postAction } from '@api/manage'
+
+export default {
+  name: 'MeterReadingModal',
+  components: {
+  },
+  data () {
+    return {
+      title:'',
+      width:1100,
+      visible: false,
+      disableSubmit: false,
+      labelCol: {
+        xs: { span: 24 },
+        sm: { span: 12 }
+      },
+      wrapperCol: {
+        xs: { span: 24 },
+        sm: { span: 12 }
+      },
+      livingOrderId: '',
+      model: {},
+      room: {},
+      chargeList: [],
+      waterCharge: {},
+      energyCharge: {},
+      gasCharge: {},
+
+    }
+  },
+  methods: {
+    add (obj) {
+      this.visible = true
+      this.$nextTick(() => {
+      })
+    },
+    edit (roomId, livingOrderId) {
+      this.visible = true
+      this.$nextTick(async () => {
+        await this.getRoom(roomId)
+        await this.getMeterCharge(livingOrderId)
+      })
+    },
+    getRoom(roomId) {
+      getAction('/rooms/cesRooms/getRoomById', { roomId: roomId }).then(resp => {
+        if (resp.success) {
+          this.room = resp.result
+        } else {
+          this.$message.warning(resp.message)
+        }
+      })
+    },
+    getMeterCharge(livingOrderId) {
+      getAction('/rooms/houseLongRentCharges/getMeterCharge', { livingOrderId: livingOrderId }).then(resp => {
+        if (resp.success) {
+          let chargeList = []
+          resp.result.forEach(e => {
+            if (e.chargeType === 3) {
+              this.waterCharge = e
+              this.waterCharge.meterRead = this.room.waterMeter
+              this.waterCharge.useNum = 0
+              this.waterCharge.feeMoney = 0
+              chargeList.push(this.waterCharge)
+            } else if (e.chargeType === 4) {
+              this.energyCharge = e
+              this.energyCharge.meterRead = this.room.energyMeter
+              this.energyCharge.useNum = 0
+              this.energyCharge.feeMoney = 0
+              chargeList.push(this.energyCharge)
+            } else if (e.chargeType === 5) {
+              this.gasCharge = e
+              this.gasCharge.meterRead = this.room.gasMeter
+              this.gasCharge.useNum = 0
+              this.gasCharge.feeMoney = 0
+              chargeList.push(this.gasCharge)
+            }
+          })
+          this.chargeList = chargeList
+        } else {
+          this.$message.warning(resp.message)
+        }
+      })
+    },
+    dushuChange(e, lastNum, charge) {
+      console.log(e, lastNum, charge)
+      if (charge.chargeType === 5) {
+        charge.useNum = parseFloat(lastNum - e).toFixed(2)
+      } else {
+        charge.useNum = parseFloat(e - lastNum).toFixed(2)
+      }
+      charge.feeMoney = parseFloat(charge.useNum * charge.money).toFixed(2)
+      this.$forceUpdate()
+    },
+    close () {
+      this.$emit('close');
+      this.visible = false;
+    },
+    handleOk () {
+      if (this.chargeList.some(e => e.useNum < 0)) {
+        this.$message.warning('本期读数不能小于上期读数')
+      }
+      postAction('/business/busOrderFee/addMeterFee', this.chargeList).then(resp => {
+        if (resp.success) {
+          this.$message.success(resp.message)
+          this.$emit('ok')
+          this.visible = false
+        } else {
+          this.$message.warning(resp.message)
+        }
+      })
+      console.log(this.chargeList, 'chargeList')
+    },
+    submitCallback() {
+      this.$emit('ok');
+      this.visible = false;
+    },
+    handleCancel () {
+      this.close()
+    }
+  }
+}
+</script>

+ 10 - 3
src/views/room/modules/checkIn/StrikeBalanceModel.vue

@@ -5,6 +5,7 @@
     :visible="visible"
     switchFullscreen
     @ok="handleOk"
+    :confirm-loading="confirmLoading"
     :okButtonProps="{ class: { 'jee-hidden': disableSubmit } }"
     @cancel="handleCancel"
     cancelText="关闭"
@@ -206,7 +207,7 @@ export default {
       this.feesList.forEach(e => {
         e.roomName = map.get(e.roomId)
         e.oldPrice = e.money
-        e.remark = '冲账' + this.getSubjectTypeText(e.subjectType)
+        // e.remark = '冲账' + this.getSubjectTypeText(e.subjectType)
         e.money = 0
       })
       this.productList.forEach(e => {
@@ -241,6 +242,7 @@ export default {
         if (e.money > 0 || e.returnNum > 0) {
           let param = Object.assign({}, e)
           param.money = -param.money
+          param.remark = '冲账' + this.getSubjectTypeText(e.subjectType,e)
           fees.push(param)
         }
       })
@@ -249,6 +251,7 @@ export default {
         if (e.money > 0) {
           let param = Object.assign({}, e)
           param.money = -param.money
+          param.remark = '冲账' + this.getSubjectTypeText(e.subjectType,e)
           fees.push(param)
         }
       })
@@ -270,6 +273,7 @@ export default {
       this.close()
     },
     getSubjectTypeText(text, record) {
+      console.log(record, 'record')
       var msg = ''
       if (text === 1) {
         msg = '押金'
@@ -291,12 +295,15 @@ export default {
         msg = '会议室'
       } else if (text === 10) {
         msg = '手工房费'
-      } else if (text === 11) {
-        msg = '水电煤抄表'
+      } else if (text === 11 && record) {
+        msg = record.remark
       } else if (text === 12) {
         msg = '赔偿费'
       } else if (text === 13) {
         msg = '退单结账'
+      } else if (text === 14 && record) {
+        console.log(record)
+        msg = record.remark
       }
       return msg
     },

+ 3 - 2
src/views/settings/components/roomModules/longRentSchemeModel.vue

@@ -64,7 +64,7 @@
           label="新增费项"
           :labelCol="labelCol"
           :wrapperCol="wrapperCol">
-        <a-col :span="8">
+        <a-col :span="6">
           <a-select v-model="chargeType">
             <a-select-option :value="1"> 一次性费项 </a-select-option>
             <a-select-option :value="2"> 周期性费项 </a-select-option>
@@ -72,8 +72,9 @@
             <a-select-option :value="4"> 抄费类电费 </a-select-option>
             <a-select-option :value="5"> 抄费类燃气费 </a-select-option>
           </a-select>
+        </a-col>
+        <a-col :span="2">
           <a-button @click="addCharges">添加</a-button>
-
         </a-col>
         <a-col :span="24">
           <a-row v-for="(item, index) in customChargeList">

+ 3 - 3
src/views/settings/components/roomModules/roomLayoutList.vue

@@ -99,7 +99,7 @@
         <room-layout-detail-modal @saveOk="onSaveOk" ref="detailModal"></room-layout-detail-modal>
     </a-card>
 </template>
-  
+
 <script>
 
 import { JeecgListMixin } from "@/mixins/JeecgListMixin";
@@ -199,7 +199,7 @@ export default {
                 importExcelUrl:
                     "rooms/cesRoomLayout/importExcel",
             },
-           
+
             dictOptions: {},
             superFieldList: [],
             selectedRowKeys: [],
@@ -321,4 +321,4 @@ export default {
 </script>
 <style scoped>
 @import "~@assets/less/common.less";
-</style>
+</style>