Browse Source

添加预订单,修改客单。修改冲账和结账收款。

许智捷 2 years ago
parent
commit
d39992df97

+ 0 - 2
src/views/report/stock/storageCollectInfo.vue

@@ -256,9 +256,7 @@ export default {
       })
     },
     stockTypeChange(e) {
-      console.log(e, 'e')
       this.queryParam.goodTypeId = e[e.length - 1]
-      console.log(this.queryParam.goodTypeId)
     },
     // 获取时间范围
     getTimeFrame() {

+ 98 - 30
src/views/room/fangtailive.vue

@@ -4,12 +4,12 @@
       <a-tab-pane key="1" tab="实时房态"> </a-tab-pane>
       <a-tab-pane key="2" tab="日历房态"> </a-tab-pane>
       <a-tab-pane key="3" tab="客单"> </a-tab-pane>
-<!--      <a-tab-pane key="3" tab="预定单"> </a-tab-pane>-->
-      <a-tab-pane key="4" tab="远期房态"> </a-tab-pane>
-      <a-tab-pane key="5" tab="物品租借"> </a-tab-pane>
-      <a-tab-pane key="6" tab="客人留言"> </a-tab-pane>
-      <a-tab-pane key="7" tab="客人物品管理"> </a-tab-pane>
-      <a-tab-pane key="8" tab="房务查房"> </a-tab-pane>
+      <a-tab-pane key="4" tab="预定单"> </a-tab-pane>
+      <a-tab-pane key="5" tab="远期房态"> </a-tab-pane>
+      <a-tab-pane key="6" tab="物品租借"> </a-tab-pane>
+      <a-tab-pane key="7" tab="客人留言"> </a-tab-pane>
+      <a-tab-pane key="8" tab="客人物品管理"> </a-tab-pane>
+      <a-tab-pane key="9" tab="房务查房"> </a-tab-pane>
     </a-tabs>
 
     <div
@@ -205,8 +205,8 @@
                               ? roomLive.livingData.price[0].price
                               : 0
                           }}/晚 余额:{{
-                            roomLive.livingData.livingOrder.shouKuan -
-                              roomLive.livingData.livingOrder.xiaoFei
+                            (roomLive.livingData.livingOrder.shouKuan -
+                              roomLive.livingData.livingOrder.xiaoFei).toFixed(2)
                           }}
                           <!-- {{ roomLive.detail.balance }} -->
                         </p>
@@ -395,6 +395,15 @@
                                 >
                                   vip
                                 </a-tag>
+                                <a-tag
+                                  color="pink"
+                                  v-else-if="
+                                    roomLive.livingData.livingOrder
+                                      .contractTeamId
+                                  "
+                                >
+                                  协
+                                </a-tag>
                               </span>
                             </div>
                             <div>
@@ -443,15 +452,29 @@
                             </div>
                             <a-tag
                               color="blue"
-                              v-if="
-                                roomLive.livingData &&
+                              v-if="roomLive.livingData &&
                                   roomLive.livingData.livingOrder &&
                                   roomLive.livingData.livingOrder.shouKuan -
-                                  roomLive.livingData.livingOrder.xiaoFei <
-                                  0
-                              "
-                            >欠</a-tag
-                            >
+                                  roomLive.livingData.livingOrder.xiaoFei <0">
+                              欠
+                            </a-tag>
+                            <a-tag
+                              color="blue"
+                              v-if="roomLive.tempinfo">
+                              借
+                            </a-tag>
+                            <a-tag
+                                color="blue"
+                                v-if="roomLive.livingData &&
+                                  roomLive.livingData.livingOrder &&
+                                  roomLive.livingData.livingOrder.dueOutTime.substr(0,10) === moment(new Date()).format('YYYY-MM-DD')">
+                              离
+                            </a-tag>
+                            <a-tag
+                                color="blue"
+                                v-if="roomLive.isExamine">
+                              查
+                            </a-tag>
                             <a-tag
                               color="blue"
                               v-if="
@@ -855,19 +878,22 @@
       <guestorders></guestorders>
     </template>
     <template v-else-if="activeKey === '4'">
-      <forwardfangtai></forwardfangtai>
+      <advance-order></advance-order>
     </template>
     <template v-else-if="activeKey === '5'">
-      <leasegoods></leasegoods>
+      <forwardfangtai></forwardfangtai>
     </template>
     <template v-else-if="activeKey === '6'">
-      <membermessage></membermessage>
+      <leasegoods></leasegoods>
     </template>
     <template v-else-if="activeKey === '7'">
+      <membermessage></membermessage>
+    </template>
+    <template v-else-if="activeKey === '8'">
       <membergoodsmanage></membergoodsmanage>
     </template>
 
-    <template v-else-if="activeKey === '8'">
+    <template v-else-if="activeKey === '9'">
       <fangwuLookRoom />
     </template>
 
@@ -967,6 +993,7 @@ import CleanRoomModal from './modules/clean/CleanRoomModal.vue'
 import calendarfangtai from './calendarfangtai'
 import forwardfangtai from './forwardfangtai'
 import guestorders from './guestorders'
+import advanceOrder from './advanceOrder'
 import leasegoods from './leasegoods'
 import membermessage from './membermessage'
 import membergoodsmanage from './membergoodsmanage'
@@ -999,6 +1026,7 @@ export default {
     EditScheduleRoomModal,
     calendarfangtai,
     guestorders,
+    advanceOrder,
     forwardfangtai,
     fangwuLookRoom,
     leasegoods,
@@ -1202,6 +1230,8 @@ export default {
       checkedCestList: [],
       // 房间信息暂存数据
       rouseinfoRoomList:[],
+      // 需要查房或正在查房的房间
+      needExamineRoomIds:[],
       // 老房态数据
       oldRoomStatusList: [],
       // 老来源数据
@@ -1455,6 +1485,7 @@ export default {
     },
     // 处理筛选条件数据-房间信息
     roomInformationFiltering(val,rouse) {
+      console.log(this.roomInformationScreening)
       this.roomInformationScreening.forEach(ids => {
         // 处理租借
         if (ids.value == '5' && rouse == true) {
@@ -2623,9 +2654,6 @@ export default {
       await getAction("/fw/fwLivingJx/getJxRooms", {}).then((res) => {
         console.log(res);
           if (res.success) {
-              res.result.forEach((row) => {
-                  this.$set(row, "collapse", 1);
-              });
               this.rouseRoomList = res.result;
           }
           var temproomlist = this.oldRoomList
@@ -2685,14 +2713,10 @@ export default {
           // 这里处理对房间信息中的租借
           this.rouseinfoRoomList.forEach(item => {
             templeaseroomlist.forEach((cust,custindex) => {
-              cust.rooms.forEach(index => {
-                if (index.roomInfo.id == item.id) {
-                  let tempindex = cust.rooms.findIndex(room => room == index)
-                  let tempinfo = true
-                  cust.rooms.splice(tempindex,1,{...index,tempinfo:tempinfo})
-                }
-
-              })
+              let find = cust.rooms.find(room => room.roomInfo.id === item.id)
+              if (find != null){
+                this.$set(find, 'tempinfo', true)
+              }
             })
           })
           // 可能有问题
@@ -2723,6 +2747,50 @@ export default {
             }
           })
       });
+      await getAction('/fw/fwRoomExamine/getExamineRoom', {}).then((res) => {
+          console.log(res);
+          if (res.success) {
+              this.needExamineRoomIds = res.result;
+          }
+          let templeaseroomlist = this.oldRoomList
+          // this.roomInformationScreening = Object.assign([], this.oldRoomInformationScreening);
+          // 这里处理对房间信息中的租借
+          this.needExamineRoomIds.forEach(item => {
+            templeaseroomlist.forEach((cust,custindex) => {
+              let find = cust.rooms.find(room => room.roomInfo.id === item)
+              if (find != null){
+                this.$set(find, 'isExamine', true)
+              }
+            })
+          })
+          // // 可能有问题
+          // this.roomList = templeaseroomlist
+          // console.log(this.roomList);
+          // // 处理房间信息数字
+          // this.roomList.forEach(item => {
+          //   item.rooms.forEach(cust => {
+          //     if (cust.livingData.livingOrder !== null) {
+          //       if ('tempinfo' in cust) {
+          //         this.roomInformationFiltering(cust.livingData.livingOrder, cust.tempinfo)
+          //       } else {
+          //         this.roomInformationFiltering(cust.livingData.livingOrder)
+          //       }
+          //     }
+          //   })
+          // })
+          // this.roomInformationScreening.forEach(item => {
+          //   // if(this.isNumber) {
+          //   //   return
+          //   // }
+          //   if ('figure' in item) {
+          //     let tempindex = this.roomInformationScreening.findIndex(index => index == item)
+          //     this.roomInformationScreening.splice(tempindex,1,{label: item.label + item.figure,value: item.value})
+          //   } else {
+          //     let tempindex = this.roomInformationScreening.findIndex(index => index == item)
+          //     this.roomInformationScreening.splice(tempindex,1,{label: item.label + 0,value: item.value})
+          //   }
+          // })
+      });
 
       getAction('/business/busOtherEmptyDirtyRoom/queryByHotelId', {}).then(
         (res) => {

+ 155 - 153
src/views/room/guestorders.vue

@@ -12,43 +12,27 @@
               ></a-input>
             </a-form-item>
           </a-col>
-          <a-col :span="3">
-            <a-form-item label="">
-              <a-select
-                v-model="queryParam.type"
-                style="width: 100%"
-                placeholder="类型"
-              >
-                <a-select-option :value="1">入住</a-select-option>
-                <a-select-option :value="2">预定</a-select-option>
-              </a-select>
-            </a-form-item>
-          </a-col>
-          <a-col :span="3" v-if="queryParam.type == 1">
+          <a-col :span="6">
             <a-form-item label="">
-              <a-select
-                v-model="queryParam.livingStatus"
-                style="width: 100%"
-                placeholder="类型"
-              >
-                <a-select-option :value="-1">正常入住</a-select-option>
-                <a-select-option :value="1">已结账退房</a-select-option>
-                <a-select-option :value="2">先走未结</a-select-option>
-                <a-select-option :value="3">联房退房</a-select-option>
-              </a-select>
+              <a-range-picker
+                  format="YYYY-MM-DD"
+                  :placeholder="['开始日期', '结束日期']"
+                  @change="onChange"
+                  v-model="datetime"
+                  :allowClear="false"
+              />
             </a-form-item>
           </a-col>
-          <a-col :span="3" v-else-if="queryParam.type == 2">
+
+          <a-col :span="6">
             <a-form-item label="">
-              <a-select
-                v-model="queryParam.bookingStatus"
-                style="width: 100%"
-                placeholder="类型"
-              >
-                <a-select-option :value="1">预定中</a-select-option>
-                <a-select-option :value="2">在住</a-select-option>
-                <a-select-option :value="3">已取消</a-select-option>
-              </a-select>
+              <a-radio-group v-model="queryParam.livingStatus" button-style="solid">
+                <a-radio-button value="0">全部</a-radio-button>
+                <a-radio-button value="-1">正常入住</a-radio-button>
+                <a-radio-button value="1">已结</a-radio-button>
+                <a-radio-button value="2">先走未结</a-radio-button>
+                <a-radio-button value="3">联房退房</a-radio-button>
+              </a-radio-group>
             </a-form-item>
           </a-col>
           <a-col :md="6" :sm="8">
@@ -56,8 +40,11 @@
               style="float: left; overflow: hidden"
               class="table-page-search-submitButtons"
             >
-              <a-button type="primary" @click="searchQuery" icon="search"
-                >查询</a-button
+              <a-button
+                type="primary"
+                @click="searchQuery"
+                icon="search"
+              >查询</a-button
               >
               <!-- <a-button
                 type="primary"
@@ -95,8 +82,10 @@
           <div v-html="text"></div>
         </template>
         <template slot="imgSlot" slot-scope="text, record">
-          <span v-if="!text" style="font-size: 12px; font-style: italic"
-            >无图片</span
+          <span
+            v-if="!text"
+            style="font-size: 12px; font-style: italic"
+          >无图片</span
           >
           <img
             v-else
@@ -108,8 +97,10 @@
           />
         </template>
         <template slot="fileSlot" slot-scope="text">
-          <span v-if="!text" style="font-size: 12px; font-style: italic"
-            >无文件</span
+          <span
+            v-if="!text"
+            style="font-size: 12px; font-style: italic"
+          >无文件</span
           >
           <a-button
             v-else
@@ -125,13 +116,8 @@
 
         <span slot="action" slot-scope="text, record">
           <a @click="handleInfo(record)">查看</a>
-          <a-divider v-if="queryParam.type == 2 && queryParam.bookingStatus == 1" type="vertical" />
-          <a v-if="queryParam.type == 2 && queryParam.bookingStatus == 1" @click="setOrderStatus(record)"
-            >取消订单</a
-          >
-
-          <a-divider type="vertical" v-if="queryParam.type == 2 && queryParam.bookingStatus == 1" />
-          <a v-if="queryParam.type == 2 && queryParam.bookingStatus == 1" @click="handleInfo(record)">入住</a>
+          <a-divider v-if="record.settleType !== -1" type="vertical" />
+          <a v-if="record.settleType !== -1" @click="cancelLeaveNotSettle(record)">撤销结账</a>
         </span>
       </a-table>
     </div>
@@ -143,95 +129,98 @@
 </template>
 
 <script>
-import "@/assets/less/TableExpand.less";
-import { mixinDevice } from "@/utils/mixin";
-import { JeecgListMixin } from "@/mixins/JeecgListMixin";
-import BillRoomInfoModal from "./modules/checkIn/BillRoomInfoModal.vue";
-import { httpAction, postAction, getAction } from "@/api/manage";
+import '@/assets/less/TableExpand.less'
+import { mixinDevice } from '@/utils/mixin'
+import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+import BillRoomInfoModal from './modules/checkIn/BillRoomInfoModal.vue'
+import { postAction, getAction } from '@/api/manage'
+import moment from 'moment/moment'
+const date = new Date()
+const endDate = new Date(date.setDate(date.getDate() + 1))
 export default {
-  name: "CesOrderMessageList",
+  name: 'CesOrderMessageList',
   mixins: [JeecgListMixin, mixinDevice],
   components: {
-    BillRoomInfoModal,
+    BillRoomInfoModal
   },
   data() {
     return {
-      description: "客单",
+      description: '客单',
       // 表头
       columns: [
         {
-          title: "单号",
-          align: "center",
-          dataIndex: "orderNo",
+          title: '单号',
+          align: 'center',
+          dataIndex: 'orderNo'
         },
         {
-          title: "客人/电话",
-          align: "center",
-          dataIndex: "customerName",
+          title: '客人/电话',
+          align: 'center',
+          dataIndex: 'customerName',
           customRender: function (text, record) {
-            return record.customerName + "/" + record.customerPhone;
-          },
+            return record.customerName + '/' + record.customerPhone
+          }
         },
         {
-          title: "客人类型",
-          align: "center",
-          dataIndex: "customerType",
+          title: '客人类型',
+          align: 'center',
+          dataIndex: 'customerType',
           customRender: function (text) {
-            if (text == 1) {
-              return "散客";
-            } else if (text == 2) {
-              return "会员";
-            } else if (text == 3) {
-              return "协议单位";
-            } else if (text == 4) {
-              return "中介";
+            if (text === 1) {
+              return '散客'
+            } else if (text === 2) {
+              return '会员'
+            } else if (text === 3) {
+              return '协议单位'
+            } else if (text === 4) {
+              return '中介'
             }
-          },
+          }
         },
         {
-          title: "入住类型",
-          align: "center",
-          dataIndex: "isLiving",
+          title: '入住类型',
+          align: 'center',
+          dataIndex: 'isLiving',
           customRender: function (text, record) {
             if (record.livingDayPrices && record.livingDayPrices.length > 0) {
-              return record.livingDayPrices[0].livingType == 1
-                ? "全天"
-                : "钟点";
+              return record.livingDayPrices[0].livingType === 1
+                ? '全天'
+                : '钟点'
             }
             if (record.bookingDayPrices && record.bookingDayPrices.length > 0) {
-              return record.bookingDayPrices[0].livingType == 1
-                ? "全天"
-                : "钟点";
+              return record.bookingDayPrices[0].livingType === 1
+                ? '全天'
+                : '钟点'
             }
-            return "--";
-          },
+            return '--'
+          }
         },
         {
-          title: "房型",
-          align: "center",
-          dataIndex: "layoutName",
+          title: '房型',
+          align: 'center',
+          dataIndex: 'layoutName'
         },
         {
-          title: "房号",
-          align: "center",
-          dataIndex: "roomName",
+          title: '房号',
+          align: 'center',
+          dataIndex: 'roomName',
           customRender: function (text, record) {
-            return !text ? "排房" : text;
-          },
+            return !text ? '排房' : text
+          }
         },
         {
-          title: "房价",
-          align: "center",
-          dataIndex: "createDate",
+          title: '房价',
+          align: 'center',
+          dataIndex: 'createDate',
           customRender: function (text, record) {
             if (record.livingDayPrices && record.livingDayPrices.length > 0) {
-              return record.livingDayPrices[0].price;
+              return record.livingDayPrices[0].price
             }
             if (record.bookingDayPrices && record.bookingDayPrices.length > 0) {
-              return record.bookingDayPrices[0].price;
+              return record.bookingDayPrices[0].price
             }
-            return "--";
-          },
+            return '--'
+          }
         },
         // {
         //   title: "状态",
@@ -239,93 +228,106 @@ export default {
         //   dataIndex: "createDate",
         // },
         {
-          title: "预抵时间",
-          align: "center",
-          dataIndex: "arrivalTime",
+          title: '预抵时间',
+          align: 'center',
+          dataIndex: 'arrivalTime'
         },
         {
-          title: "预离时间",
-          align: "center",
-          dataIndex: "dueOutTime",
+          title: '预离时间',
+          align: 'center',
+          dataIndex: 'dueOutTime'
         },
         {
-          title: "金额",
-          align: "center",
-          dataIndex: "yuE",
+          title: '金额',
+          align: 'center',
+          dataIndex: 'yuE',
           customRender: function (text, record) {
-            return record.yuE + "(余)/" + record.yushou + "(预)";
-          },
+            return record.yuE + '(余)/' + record.yushou + '(预)'
+          }
         },
         {
-          title: "操作",
-          dataIndex: "action",
-          align: "center",
-          fixed: "right",
+          title: '操作',
+          dataIndex: 'action',
+          align: 'center',
+          fixed: 'right',
           width: 147,
-          scopedSlots: { customRender: "action" },
-        },
+          scopedSlots: { customRender: 'action' }
+        }
       ],
       url: {
-        list: "/business/busRoomBookingOrders/kedan-orders",
-        delete: "/order/cesOrderMessage/delete",
-        deleteBatch: "/order/cesOrderMessage/deleteBatch",
-        exportXlsUrl: "/order/cesOrderMessage/exportXls",
-        importExcelUrl: "order/cesOrderMessage/importExcel",
+        list: '/business/busRoomBookingOrders/kedan-orders',
+        delete: '/order/cesOrderMessage/delete',
+        deleteBatch: '/order/cesOrderMessage/deleteBatch',
+        exportXlsUrl: '/order/cesOrderMessage/exportXls',
+        importExcelUrl: 'order/cesOrderMessage/importExcel'
       },
       dictOptions: {},
       superFieldList: [],
       hotelList: [],
-      queryParam: { type: 1, livingStatus: -1, bookingStatus: 1 },
-    };
+      queryParam: {
+        type: 1,
+        startTime: moment(new Date()).format('YYYY-MM-DD'),
+        endTime: moment(endDate).format('YYYY-MM-DD'),
+        livingStatus: '0'
+      },
+      datetime: [
+        moment(new Date(), 'YYYY-MM-DD'),
+        moment(endDate, 'YYYY-MM-DD')
+      ]
+    }
   },
   created() {
-    getAction("/business/busHotel/list", { pageNo: 1, pageSize: 100 }).then(
+    getAction('/business/busHotel/list', { pageNo: 1, pageSize: 100 }).then(
       (res) => {
         if (res.success) {
-          this.hotelList = res.result.records;
+          this.hotelList = res.result.records
         }
       }
-    );
+    )
   },
   computed: {
     importExcelUrl: function () {
-      return `${window._CONFIG["domianURL"]}/${this.url.importExcelUrl}`;
-    },
+      return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
+    }
   },
   methods: {
     setOrderStatus(record) {
-      postAction("/business/busRoomBookingOrders/set-booking-status", {
+      postAction('/business/busRoomBookingOrders/set-booking-status', {
         id: record.id,
-        bookingStatus: 2,
+        bookingStatus: 2
       }).then((res) => {
         if (res.success) {
-          this.$message.success(res.message);
-          this.loadData();
+          this.$message.success(res.message)
+          this.loadData()
         } else {
-          this.$message.warning(res.message);
+          this.$message.warning(res.message)
         }
-      });
+      })
     },
     handleInfo(record) {
-      // 预约单
-      if (this.queryParam.type == 2) {
-        this.$router.push({
-          name: "room-scheduledetail",
-          params: {
-            id: record.orderNo,
-          },
-        });
-      } else {
-        // 入住单
-        
-        console.log(record)
-        this.$refs.ModalBillRoomInfo.add(record.bookingOrderId, 1, null, record.id);
-        this.$refs.ModalBillRoomInfo.title = "账单";
-        this.$refs.ModalBillRoomInfo.disableSubmit = true;
-      }
+      // 入住单
+      console.log(record)
+      this.$refs.ModalBillRoomInfo.add(record.bookingOrderId, 1, null, record.id)
+      this.$refs.ModalBillRoomInfo.title = '账单'
+      this.$refs.ModalBillRoomInfo.disableSubmit = true
     },
-  },
-};
+    cancelLeaveNotSettle(record) {
+      let url = '/business/busRoomBookingOrders/cancel-leave-not-settle?bookingOrderId='
+      postAction(url + record.bookingOrderId + '&livingOrderId=' + record.id, {}).then((res) => {
+        if (res.success) {
+          this.$message.success(res.message)
+          this.$emit('ok')
+        } else {
+          this.$message.warning(res.message)
+        }
+      })
+    },
+    onChange(e, dateString) {
+      this.queryParam.startTime = dateString[0]
+      this.queryParam.endTime = dateString[1]
+    }
+  }
+}
 </script>
 <style scoped>
 @import "~@assets/less/common.less";

+ 136 - 46
src/views/room/modules/checkIn/BillRoomInfo.vue

@@ -1,7 +1,7 @@
 <template>
   <div>
     <div class="tab_height" style="display: flex; gap: 15px">
-      <div style="width: 37%">
+      <div style="width: 33%">
         <div style="display: flex; justify-content: space-between">
           <h4
             style="
@@ -22,7 +22,7 @@
                 style="color: rgba(255, 141, 26, 1); font-size: 18px"/>
               <a-button type="link"> 改为主房 </a-button>
             </div>
-            <div style="display: flex; flex-direction: column" @click="puls()">
+            <div style="display: flex; flex-direction: column" @click="puls()" v-if="isLiving">
               <a-icon
                 type="clock-circle"
                 style="color: rgba(255, 141, 26, 1); font-size: 18px"
@@ -73,7 +73,7 @@
                     : "--"
                 }}
                 <a-icon
-                  v-if="livingIndex > 0"
+                  v-if="livingIndex > 0 && isLiving"
                   @click="editCustomer(item)"
                   type="edit"
                   style="color: rgba(255, 141, 26, 1); font-size: 18px"
@@ -97,7 +97,7 @@
                     : "--"
                 }}
                 <a-icon
-                  v-if="livingIndex > 0"
+                  v-if="livingIndex > 0 && isLiving"
                   @click="editCustomer(item)"
                   type="edit"
                   style="color: rgba(255, 141, 26, 1); font-size: 18px"
@@ -106,7 +106,7 @@
               <a-descriptions-item label="宾客类型">
                 {{ customerTypeName( item.livingOrder && item.livingOrder.customerType) }}
                 <a-icon
-                  v-if="livingIndex > 0"
+                  v-if="livingIndex > 0 && isLiving"
                   @click="editCustomerType(item)"
                   type="edit"
                   style="color: rgba(255, 141, 26, 1); font-size: 18px"
@@ -121,7 +121,7 @@
               <a-descriptions-item label="订单来源">
                 {{ customerSourceName( item.livingOrder && item.livingOrder.customerSource) }}
                 <a-icon
-                  v-if="livingIndex > 0"
+                  v-if="livingIndex > 0 && isLiving"
                   @click="editCustomerSource(item)"
                   type="edit"
                   style="color: rgba(255, 141, 26, 1); font-size: 18px"
@@ -129,7 +129,7 @@
               <a-descriptions-item label="入住类型">
                 {{ getlivingTypeText( item.livingOrder && item.livingOrder.livingType) }}
                 <a-icon
-                  v-if="livingIndex > 0"
+                  v-if="livingIndex > 0 && isLiving"
                   @click="editBookingType(item)"
                   type="edit"
                   style="color: rgba(255, 141, 26, 1); font-size: 18px"
@@ -141,7 +141,7 @@
               <a-descriptions-item label="早餐券">
                 {{ item.livingOrder && item.livingOrder.breakfastNum }}
                 <a-icon
-                  v-if="livingIndex > 0"
+                  v-if="livingIndex > 0 && isLiving"
                   @click="editBreakfastNum(item)"
                   type="edit"
                   style="color: rgba(255, 141, 26, 1); font-size: 18px"
@@ -153,7 +153,7 @@
               <a-descriptions-item label="销售员工">
                 {{ warranterName( item.livingOrder && item.livingOrder.warranter) }}
                 <a-icon
-                  v-if="livingIndex > 0"
+                  v-if="livingIndex > 0 && isLiving"
                   @click="editWarranter(item)"
                   type="edit"
                   style="color: rgba(255, 141, 26, 1); font-size: 18px"
@@ -161,7 +161,7 @@
               <a-descriptions-item label="订单备注" :span="2">
                 {{ item.livingOrder && item.livingOrder.remark
                 }}<a-icon
-                  v-if="livingIndex > 0"
+                  v-if="livingIndex > 0 && isLiving"
                   @click="editRemark(item)"
                   type="edit"
                   style="color: rgba(255, 141, 26, 1); font-size: 18px"
@@ -178,7 +178,8 @@
               >
                 <a-descriptions-item label="叫醒服务" :span="2">
                   <a-icon
-                    type="plus-circle"
+                      v-if="isLiving"
+                      type="plus-circle"
                     class="dynamic-delete-button"
                     @click="puls()"
                   />
@@ -371,7 +372,7 @@
           </a-descriptions></template
         >
       </div>
-      <div style="width: 46%">
+      <div style="width: 50%">
         <div style="display: flex; justify-content: space-between">
           <h4
             style="
@@ -385,6 +386,7 @@
           <div style="display: flex">
             <div
               @click="strikeBalance"
+              :class="`${isLiving ? '' : 'disabled'}`"
               style="display: flex; flex-direction: column">
               <a-icon
                 type="pound"
@@ -408,7 +410,7 @@
                 增加消费
               </a-button>
             </div>
-            <div style="display: flex; flex-direction: column">
+            <div :class="`${isLiving ? '' : 'disabled'}`" style="display: flex; flex-direction: column">
               <a-icon
                 type="property-safety"
                 style="color: rgba(255, 141, 26, 1); font-size: 18px"
@@ -425,7 +427,7 @@
         <a-tabs :v-model="active" @change="tabFeeChange" style="padding-top: 0px">
           <a-tab-pane tab="全部账单" key="0" :forceRender="true">
             <a-table
-              :columns="columns"
+              :columns="columns0"
               :data-source="entiretyList"
               :pagination="false"
               :scroll="{ y: 160 }"
@@ -447,20 +449,24 @@
                 <span class="strike_style" v-if="record.returnItem">{{ record.dayTime }}</span>
                 <span v-else>{{ record.dayTime }}</span>
               </template>
-              <!-- <template slot="originalPrice" slot-scope="text, record, index" class="strike_style">
-                {{ record.originalPrice }}
-              </template> -->
-              <template slot="feeType" slot-scope="text, record, index" class="strike_style">
-                <span class="strike_style" v-if="record.returnItem">{{ (record.subjectType === 6 || record.subjectType === 7) && record.feeGoodVo.num ? record.feeGoodVo.num : 1 }}</span>
+              <!-- 单价-->
+              <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>
+              </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>
+              <!-- 小计 -->
               <template slot="originalMoney" slot-scope="text, record, index" class="strike_style">
-                <span class="strike_style" v-if="record.returnItem">{{ record.originalMoney }}</span>
+                <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">{{ record.originalMoney / ((record.subjectType === 6 || record.subjectType === 7) && record.feeGoodVo.num ? record.feeGoodVo.num : 1) }}</span>
-                <span v-else>{{ record.originalMoney / ((record.subjectType === 6 || record.subjectType === 7) && record.feeGoodVo.num ? record.feeGoodVo.num : 1) }}</span>
+                <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) }}
@@ -478,16 +484,14 @@
           </a-tab-pane>
           <a-tab-pane tab="未结算" key="1" :forceRender="true">
             <a-table
-              :columns="columns"
+              :columns="columns1"
               :data-source="feesList"
               :pagination="false"
               :scroll="{ y: 160 }"
               rowKey="id"
               :rowSelection="{
                 consumSelectedRowKeys: consumSelectedRowKeys,
-                onChange: onSelectChange,
-              }"
-            >
+                onChange: onSelectChange}">
               <template slot="subjectType" slot-scope="text, record, index">
                 {{ getSubjectTypeText(text,record) }}
               </template>
@@ -507,7 +511,7 @@
           </a-tab-pane>
           <a-tab-pane tab="已结算" key="2">
             <a-table
-              :columns="columns"
+              :columns="columns1"
               :data-source="paidList"
               :pagination="false"
               :scroll="{ y: 160 }"
@@ -576,6 +580,7 @@
           <div style="display: flex" >
             <div
               @click="enterAccount"
+              :class="`${isLiving ? '' : 'disabled'}`"
               style="display: flex; flex-direction: column">
               <a-icon
                 type="transaction"
@@ -764,7 +769,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'
-const columns = [
+const columns0 = [
   {
     title: '房间号',
     dataIndex: 'roomId',
@@ -797,12 +802,12 @@ const columns = [
     width: 67,
     align: 'center',
     scopedSlots: { customRender: 'originalPrice' },
-    customRender: function (text, record) {
-      if ((record.subjectType === 6 || record.subjectType === 7) && record.feeGoodVo.originalPrice) {
-        return record.feeGoodVo.originalPrice
-      }
-      return record.originalMoney
-    }
+    // customRender: function (text, record) {
+    //   if ((record.subjectType === 6 || record.subjectType === 7) && record.feeGoodVo.originalPrice) {
+    //     return record.feeGoodVo.originalPrice
+    //   }
+    //   return record.originalMoney
+    // }
   },
   {
     title: '优惠价',
@@ -811,15 +816,18 @@ const columns = [
     scopedSlots: { customRender: 'money' },
     width: 67,
     // customRender: function (text, record) {
-    //   return (record.originalMoney / record.feeType)
+    //   if ((record.subjectType === 6 || record.subjectType === 7) && record.feeGoodVo.price) {
+    //     return record.feeGoodVo.price
+    //   }
+    //   return record.originalMoney
     // }
   },
   {
     title: '数量',
-    dataIndex: 'feeType',
+    dataIndex: 'num',
     width: 60,
     align: 'center',
-    scopedSlots: { customRender: 'feeType' },
+    scopedSlots: { customRender: 'num' },
     // customRender: function (text, record) {
     //   if ((record.subjectType === 6 || record.subjectType === 7) && record.feeGoodVo.num) {
     //     return record.feeGoodVo.num
@@ -836,6 +844,76 @@ const columns = [
   },
 
 ]
+const columns1 = [
+  {
+    title: '房间号',
+    dataIndex: 'roomId',
+    width: 80,
+    align: 'center',
+    scopedSlots: { customRender: 'roomId' }
+  },
+  {
+    title: '费项',
+    dataIndex: 'subjectType',
+    width: 150,
+    align: 'center',
+    scopedSlots: { customRender: 'subjectType' }
+  },
+  {
+    title: '入账日期',
+    dataIndex: 'dayTime',
+    width: 180,
+    align: 'center',
+    scopedSlots: { customRender: 'dayTime' }
+  },
+  {
+    title: '单价',
+    // dataIndex: 'money',
+    width: 67,
+    align: 'center',
+    // scopedSlots: { customRender: 'originalPrice' },
+    customRender: function (text, record) {
+      if ((record.subjectType === 6 || record.subjectType === 7) && record.feeGoodVo.originalPrice) {
+        return record.feeGoodVo.originalPrice
+      }
+      return record.originalMoney
+    }
+  },
+  {
+    title: '优惠价',
+    align: 'center',
+    dataIndex: 'money',
+    // scopedSlots: { customRender: 'money' },
+    width: 67,
+    customRender: function (text, record) {
+      if ((record.subjectType === 6 || record.subjectType === 7) && record.feeGoodVo.price) {
+        return record.feeGoodVo.price
+      }
+      return record.originalMoney
+    }
+  },
+  {
+    title: '数量',
+    dataIndex: 'num',
+    width: 60,
+    align: 'center',
+    // scopedSlots: { customRender: 'num' },
+    customRender: function (text, record) {
+      if ((record.subjectType === 6 || record.subjectType === 7) && record.feeGoodVo.num) {
+        return record.feeGoodVo.num
+      }
+      return 1
+    }
+  },
+  {
+    title: '小计',
+    align: 'center',
+    dataIndex: 'originalMoney',
+    scopedSlots: { customRender: 'originalMoney' },
+    width: 67
+  },
+
+]
 
 const columns2 = [
   {
@@ -871,14 +949,14 @@ const strikeColumns = [
   {
     title: '房间号',
     dataIndex: 'roomId',
-    width: 80,
+    width: 60,
     align: 'center',
     scopedSlots: { customRender: 'roomId' }
   },
   {
     title: '费项',
     dataIndex: 'subjectType',
-    width: 150,
+    width: 120,
     align: 'center',
     scopedSlots: { customRender: 'subjectType' }
   },
@@ -887,11 +965,12 @@ const strikeColumns = [
     dataIndex: 'dayTime',
     width: 110,
     align: 'center',
-    customRender: function (text, record) {
-      if (text !== null && text !== '') {
-        return record.dayTime.substring(0, 10)
-      }
-    }
+  },
+  {
+    title: '冲账数量',
+    align: 'center',
+    dataIndex: 'returnNum',
+    width: 67,
   },
   {
     title: '冲账金额',
@@ -957,6 +1036,7 @@ export default {
   },
   data() {
     return {
+      isLiving: true,
       wakeService: false,
       wakeTime: {
         id: '',
@@ -967,7 +1047,8 @@ export default {
       consumSelectedRowKeys: [],
       consumSelectedRows: [],
       data,
-      columns,
+      columns0,
+      columns1,
       data2,
       columns2,
       strikeColumns,
@@ -1581,7 +1662,8 @@ export default {
           console.log(this.tempindex);
           this.entiretyList.splice(tempindex+1,0,item)
         })
-        this.$emit('changeLivingStatu', find.livingOrder.settleType !== 2)
+        this.isLiving = find.livingOrder.settleType === -1
+        this.$emit('changeLivingStatu', find.livingOrder.settleType)
       }
     },
     getPayTypeText(text) {
@@ -1856,6 +1938,14 @@ export default {
         }
       })
       let fees = JSON.parse(JSON.stringify(this.feesList))
+      fees.forEach(e => {
+        if (e.subjectType === 6 || e.subjectType === 7) {
+          let returnNum = this.strikeList.filter(ele => ele.returnFeeId === e.id).reduce((sum, val) => {
+            return sum + val.returnNum
+          }, 0)
+          e.feeGoodVo.num = e.feeGoodVo.num - returnNum;
+        }
+      })
       let vipId = {
         vipCustomerId: this.model.vipCustomerId
       }

+ 59 - 43
src/views/room/modules/checkIn/BillRoomInfoModal.vue

@@ -7,64 +7,60 @@
     :okButtonProps="{ class: { 'jee-hidden': disableSubmit } }"
     @cancel="handleCancel"
     cancelText="关闭"
+    :class="livingStatu === -1 ? 'ant-modal-header_living' : 'ant-modal-header_leave'"
   >
     <template slot="title">
       <div
-        style="
+          style="
           display: flex;
-          background-color: rgba(255, 141, 26, 1);
           height: 80px;">
-        <div class="menu" @click="adjustPrice">
-          <a-icon
-            type="account-book"
-            style="color: #fff; font-size: 30px"
-          /><a-button type="link"> 调价 </a-button>
+        <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" @click="handleLeaseGoods">
-          <a-icon type="block" style="color: #fff; font-size: 30px" /><a-button
-            type="link"
-          >
+        <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">
             物品借用
           </a-button>
         </div>
-        <div class="menu" @click="handleMessage">
-          <a-icon
-            type="message"
-            style="color: #fff; font-size: 30px"
-          /><a-button type="link"> 客户留言 </a-button>
+        <div class="menu" v-if="livingStatu === -1">
+          <a-icon @click="handleMessage" type="message" style="color: #fff; font-size: 30px; width:120px; align-self: center;" />
+          <a-button @click="handleMessage" type="link" style="width: 120px; text-align: center; align-self: center"> 客户留言 </a-button>
         </div>
-        <div class="menu" @click="handleUnion">
-          <a-icon
-            type="retweet"
-            style="color: #fff; font-size: 30px"
-          /><a-button type="link"> 联房 </a-button>
+        <div class="menu" v-if="livingStatu === -1">
+          <a-icon @click="handleUnion" type="retweet" style="color: #fff; font-size: 30px; width:120px; align-self: center;" />
+          <a-button @click="handleUnion" type="link" style="width: 120px; text-align: center; align-self: center">联房</a-button>
         </div>
-        <div class="menu" @click="handleLeaveNotSettle" v-if="livingStatu">
-          <a-icon type="euro" style="color: #fff; font-size: 30px" />
-          <a-button
-            type="link"
-          >
+        <div class="menu" v-if="livingStatu === -1">
+          <a-icon @click="handleLeaveNotSettle" type="euro" style="color: #fff; font-size: 30px; width:120px; align-self: center;" />
+          <a-button @click="handleLeaveNotSettle" type="link" style="width: 120px; text-align: center; align-self: center">
             先走不结
           </a-button>
         </div>
-        <div class="menu" @click="cancelHandleLeaveNotSettle" v-else>
-          <a-icon type="euro" style="color: #fff; font-size: 30px" />
-          <a-button
-              type="link"
-          >撤销先走不结
+        <div class="menu" v-else-if="livingStatu === 1">
+          <a-icon @click="cancelHandleLeaveNotSettle" type="euro" style="color: #fff; font-size: 30px; width:120px; align-self: center;"/>
+          <a-button @click="cancelHandleLeaveNotSettle" type="link" style="width: 120px; text-align: center; align-self: center">
+            撤销结账
+          </a-button>
+        </div>
+        <div class="menu" v-else>
+          <a-icon @click="cancelHandleLeaveNotSettle" type="euro" style="color: #fff; font-size: 30px; width:120px; align-self: center;" />
+          <a-button @click="cancelHandleLeaveNotSettle" type="link" style="width: 120px; text-align: center; align-self: center">
+            撤销先走不结
           </a-button>
         </div>
         <div class="menu">
           <a-icon
             type="printer"
-            style="color: #fff; font-size: 30px"
-          /><a-button type="link"> 打印账单 </a-button>
+            style="color: #fff; font-size: 30px; width:120px; align-self: center;"
+          /><a-button type="link" style="width: 120px; text-align: center; align-self: center"> 打印账单 </a-button>
         </div>
         <div class="menu">
           <a-icon
             type="container"
-            style="color: #fff; font-size: 30px"/>
-          <a-button type="link"> 自定义账单 </a-button>
+            style="color: #fff; font-size: 30px; width:120px; align-self: center;"/>
+          <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>
@@ -86,7 +82,8 @@ export default {
       width: 1500,
       visible: false,
       disableSubmit: false,
-      livingStatu: true
+      /* -1正常入住 1结账退房 2未结退房 */
+      livingStatu: null
     };
   },
   methods: {
@@ -96,7 +93,7 @@ export default {
         bookingOrderId: bookingOrderId,
         roomId: roomId
       }
-      getAction('/business/busRoomBookingOrders/canOnlyPaySelf', obj).then(res =>{
+      // getAction('/business/busRoomBookingOrders/canOnlyPaySelf', obj).then(res =>{
           // if (res.result && !confirm('是否团体支付??')) {
           //   httpAction(
           //       'business/busRoomBookingOrders/split-living?livingOrderId=' +
@@ -117,12 +114,16 @@ export default {
           //     this.$refs.realForm.add(bookingOrderId, key, roomId);
           //   })
           // }
-        this.visible = true
-        this.$nextTick(() => {
-          this.$refs.realForm.add(bookingOrderId, key, roomId);
-        })
-
-      });
+      //   this.visible = true
+      //   this.$nextTick(() => {
+      //     this.$refs.realForm.add(bookingOrderId, key, roomId);
+      //   })
+      //
+      // });
+      this.visible = true
+      this.$nextTick(() => {
+        this.$refs.realForm.add(bookingOrderId, key, roomId);
+      })
     },
     getOrder(){
 
@@ -168,6 +169,20 @@ export default {
   },
 };
 </script>
+<style lang="less">
+.ant-modal-header_living{
+  .ant-modal-header{
+    background: rgba(255, 141, 26, 1) !important;
+  }
+}
+
+.ant-modal-header_leave{
+  .ant-modal-header{
+    background: rgb(119, 116, 113) !important;
+  }
+}
+</style>
+
 <style scoped>
 /deep/ .ant-btn-link {
   flex: 1;
@@ -208,4 +223,5 @@ export default {
     border-radius: 5px;
   }
 }
+
 </style>

+ 136 - 11
src/views/room/modules/checkIn/FeeForm.vue

@@ -21,12 +21,23 @@
               </a-form-model-item>
             </a-col>
           </a-col>
-          <a-col v-if="model.subjectType==6" :span="12">
-            <a-space>
-              <a-input v-model="queryParams.name" placeholder="名称" />
-              <a-button @click="loadData" type="primary">搜索</a-button>
-            </a-space>
-          </a-col>
+          <div v-if="model.subjectType==6">
+            <a-col :span="10">
+              <a-form-model-item label="" v-model="queryParams.goodTypeId">
+                <a-cascader :options="stockTypeList " @change="stockTypeChange" :field-names="{ label: 'name', value: 'id', children: 'children' }" style="width: 80%" placeholder="商品类别" />
+              </a-form-model-item>
+            </a-col>
+            <a-col :span="9">
+              <a-form-model-item>
+                <a-input v-model="queryParams.name" style="width: 80%" placeholder="名称" />
+              </a-form-model-item>
+            </a-col>
+            <a-col :span="3">
+              <a-form-model-item>
+                <a-button @click="loadData" type="primary">搜索</a-button>
+              </a-form-model-item>
+            </a-col>
+          </div>
         </a-row>
         <!-- <a-row>
                 <a-col :span="24">
@@ -35,8 +46,8 @@
                     </a-form-model-item>
                 </a-col>
             </a-row> -->
-        <a-row >
-          <a-table v-if="model.subjectType==6" :columns="columns" @change="pageChange" :dataSource="dataSource" :pagination="ipagination" :scroll="{ y: 500 }" style="margin-top:10px;">
+        <a-row v-if="model.subjectType === 6">
+          <a-table :columns="columns" @change="pageChange" :dataSource="dataSource" :pagination="ipagination" :scroll="{ y: 500 }" style="margin-top:10px;">
             <template slot="sellingPrice" slot-scope="text, record">
               <a-input-number v-model="record.sellingPrice" :min="0"></a-input-number>
             </template>
@@ -48,6 +59,100 @@
             </template>
           </a-table>
         </a-row>
+        <a-row v-if="model.subjectType===11">
+<!--          水表:上期读数:(自动带入上期读数,初始须提前设置,可修改):(可填)本期用量:(=本期-上期) 单价:(提前设置好的) 本期应缴:(根据用量和单价自动计算)-->
+          <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="4">
+            <a-form-model-item label="上期读数">
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="5">
+            <a-form-model-item
+                label="本期读数"
+                :labelCol="{ xs: { span: 24 }, sm: { span: 10 }}"
+                :wrapperCol="{xs: { span: 24 },sm: { span: 12 }}">
+              <a-input-number style="width: 100%"></a-input-number>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="5">
+            <a-form-model-item label="本期用量">
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="4">
+            <a-form-model-item label="单价">
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="4">
+            <a-form-model-item label="本期应缴">
+            </a-form-model-item>
+          </a-col>
+        </a-row>
+        <a-row v-if="model.subjectType===11">
+          <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="4">
+            <a-form-model-item label="上期读数">
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="5">
+            <a-form-model-item
+                label="本期读数"
+                :labelCol="{ xs: { span: 24 }, sm: { span: 10 }}"
+                :wrapperCol="{xs: { span: 24 },sm: { span: 12 }}">
+              <a-input-number style="width: 100%"></a-input-number>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="5">
+            <a-form-model-item label="本期用量">
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="4">
+            <a-form-model-item label="单价">
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="4">
+            <a-form-model-item label="本期应缴">
+            </a-form-model-item>
+          </a-col>
+        </a-row>
+        <a-row v-if="model.subjectType===11">
+          <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="4">
+            <a-form-model-item label="上期读数">
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="5">
+            <a-form-model-item
+                label="本期读数"
+                :labelCol="{ xs: { span: 24 }, sm: { span: 10 }}"
+                :wrapperCol="{xs: { span: 24 },sm: { span: 12 }}">
+              <a-input-number style="width: 100%"></a-input-number>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="5">
+            <a-form-model-item label="本期用量">
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="4">
+            <a-form-model-item label="单价">
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="4">
+            <a-form-model-item label="本期应缴">
+            </a-form-model-item>
+          </a-col>
+        </a-row>
       </a-form-model>
 
     </j-form-container>
@@ -124,7 +229,7 @@ export default {
           showSizeChanger: true,
           total: 0
           },
-
+          stockTypeList: [],
           model: {
                 payType: 1,
                 livingOrderId: '',
@@ -191,6 +296,7 @@ export default {
         // 备份model原始值
         this.modelDefault = JSON.parse(JSON.stringify(this.model))
         this.getbusCustomer()
+        this.loadStockType()
 
     },
     methods: {
@@ -241,7 +347,25 @@ export default {
               })
             }
           })
-          },
+        },
+        /**查询商品类别  */
+        loadStockType() {
+          let params = {
+            pageSize: 9999,
+            pageNo: 1
+          }
+          getAction('/rooms/cesStockType/tree', params).then((res) => {
+            if (!res.success) {
+              this.$message.warning('查询失败')
+              return
+            }
+            this.stockTypeList = res.result
+            console.log(this.stockTypeList)
+          })
+        },
+        stockTypeChange(e) {
+          this.queryParams.goodTypeId = e[e.length - 1]
+        },
         add(obj) {
             this.modelDefault.livingOrderId = obj.livingOrderId
             this.modelDefault.roomId = obj.roomId
@@ -324,7 +448,8 @@ export default {
             let params = {
               pageSize: this.ipagination.pageSize,
               pageNo: this.ipagination.current,
-              name: this.queryParams.name
+              name: this.queryParams.name,
+              goodType: this.queryParams.goodTypeId
             }
             this.loading = true
             getAction(this.url.list, params).then((res) => {

+ 9 - 10
src/views/room/modules/checkIn/PayOrRefund.vue

@@ -20,7 +20,7 @@
                 prop="money"
               > -->
               <!--  {{ Math.abs(model.money.toFixed(2)) }}元 -->
-              <span>{{ &quot;应&quot; + (model.money < 0 ? &quot;退&quot; : &quot;收&quot;) }}: {{ realityAmount.toFixed(2) }}元</span>
+              <span>{{ &quot;应&quot; + (model.money < 0 ? &quot;退&quot; : &quot;收&quot;) }}: {{ realityAmount }}元</span>
               <!-- </a-form-model-item> -->
             </a-col>
             <a-col :span="16">
@@ -103,7 +103,7 @@
                   :labelCol="labelCol"
                   :wrapperCol="wrapperCol"
                 >
-                  {{ couponAmount.toFixed(2) }}元
+                  {{ couponAmount }}元
                 </a-form-model-item>
               <!-- </a-col> -->
 
@@ -262,7 +262,7 @@
                 </a-select>
               </template>
               <template slot="prerefund" slot-scope="text, record, index">
-                <a-input-number :min="1" :max="record.money - record.returnMoney" v-model="record.prerefund"></a-input-number>
+                <a-input-number :min="0" :max="record.money - record.returnMoney" v-model="record.prerefund" :default-value="0"></a-input-number>
               </template>
               <template slot="operation" slot-scope="text, record, index">
                 <!-- <a-popconfirm
@@ -495,7 +495,7 @@ export default {
           } else {
             return total + 0
           }
-          
+
         }, 0)
         console.log(sum);
         return sum
@@ -541,12 +541,12 @@ export default {
       } else {
         sum = this.model.consumption
       }
-      return sum
+      return sum.toFixed(2)
     },
     realityAmount() {
       console.log(this.model);
       // 实际要收的钱,为负表示要退的钱
-      let relMoney = this.couponAmount.toFixed(2) - this.model.collection
+      let relMoney = this.couponAmount - this.model.collection
       this.isRefund = relMoney < 0
       let result = 0
       if (this.model.couponCard) {
@@ -564,7 +564,7 @@ export default {
         this.payList[0].money = result
       }
       this.copyRealityAmount = result
-      return result
+      return result.toFixed(2)
     }
   },
   created() {
@@ -843,8 +843,7 @@ export default {
             })
           })
           }
-
-
+          fees = fees.filter(e => !isNaN(e.money) && e.money != null && e.money !== 0)
           that.confirmLoading = true
           var url =
               '/business/busRoomBookingOrders/settle-checkout?bookingOrderId=' +
@@ -990,7 +989,7 @@ export default {
       this.feeList.push({
         createTime: '自定义退款',
         payType: null,
-        prerefund: null,
+        prerefund: 0,
         // pullDown: false
       })
       console.log(this.feeList);

+ 36 - 56
src/views/room/modules/checkIn/StrikeBalanceModel.vue

@@ -196,9 +196,9 @@ export default {
       record.forEach(index => {
         if (index.feeGoodVo == null) {
           this.feesList.push(index)
-        } else if (index.feeGoodVo !== null) [
+        } else if (index.feeGoodVo !== null) {
           this.productList.push(index)
-        ]
+        }
       })
       // this.feesList = record
       this.feesList.forEach(e => {
@@ -225,64 +225,44 @@ export default {
       this.visible = false
     },
     handleOk() {
-      if (this.tebdata == 'default') {
-        let productfees = []
-        if (this.productList.some(e => e.money > e.oldPrice || e.money < 0)) {
-          this.$message.warning('冲账金额不能超过原金额,且不能小于0')
-          return
-        } else {
-          console.log(this.productList, "this.product")
-          this.productList.forEach(e => {
-            // 一条消费可能有多次冲账,所以传入后端的money是冲账的负数差值
-            if (e.oldPrice - e.money > 0) {
-              let param = Object.assign({}, e)
-              param.money = -param.money
-              // param.money = param.money - param.oldPrice
-              productfees.push(param)
-            }
-          })
+      let fees = []
+      if (this.productList.some(e => e.money > e.oldPrice || e.money < 0 || e.returnNum > e.feeGoodVo.num || e.returnNum < 0)) {
+        this.$message.warning('冲账金额不能超过原金额,冲账数量不能超过原数量,且都不能小于0')
+        return
+      }
+      if (this.feesList.some(e => e.money > e.oldPrice || e.money < 0)) {
+        this.$message.warning('冲账金额不能超过原金额,且不能小于0')
+        return
+      }
+      this.productList.forEach(e => {
+        // 一条消费可能有多次冲账,所以传入后端的money是冲账的负数差值
+        if (e.money > 0 || e.returnNum > 0) {
+          let param = Object.assign({}, e)
+          param.money = -param.money
+          fees.push(param)
         }
-        if (productfees.length === 0) {
-          return
+      })
+      this.feesList.forEach(e => {
+        // 一条消费可能有多次冲账,所以传入后端的money是冲账的负数差值
+        if (e.money > 0) {
+          let param = Object.assign({}, e)
+          param.money = -param.money
+          fees.push(param)
         }
-        postAction('/business/busOrderFee/strike-balance', productfees).then(resp => {
-          if (resp.result === true) {
-            this.$message.success('冲账成功')
-            this.$emit('ok')
-            this.visible = false
-          } else {
-            this.$message.warning('冲账失败')
-          }
-        });
-      } else {
-        let fees = []
-        if (this.feesList.some(e => e.money > e.oldPrice || e.money < 0)) {
-          this.$message.warning('冲账金额不能超过原金额,且不能小于0')
-          return
+      })
+      if (fees.length === 0) {
+        this.$message.warning('请填写需要冲账的金额或数量')
+        return
+      }
+      postAction('/business/busOrderFee/strike-balance', fees).then(resp => {
+        if (resp.result) {
+          this.$message.success('冲账成功')
+          this.$emit('ok')
+          this.visible = false
         } else {
-          this.feesList.forEach(e => {
-            // 一条消费可能有多次冲账,所以传入后端的money是冲账的负数差值
-            if (e.oldPrice - e.money > 0) {
-              let param = Object.assign({}, e)
-              param.money = -param.money
-              // param.money = param.money - param.oldPrice
-              fees.push(param)
-            }
-          })
+          this.$message.warning('冲账失败')
         }
-        if (fees.length === 0) {
-          return
-        }
-        postAction('/business/busOrderFee/strike-balance', fees).then(resp => {
-          if (resp.result === true) {
-            this.$message.success('冲账成功')
-            this.$emit('ok')
-            this.visible = false
-          } else {
-            this.$message.warning('冲账失败')
-          }
-        });
-      }
+      });
     },
     handleCancel() {
       this.close()

+ 18 - 15
src/views/stock/modules/DepositoryForm copy.vue

@@ -4,21 +4,21 @@
       <a-form-model ref="form" :model="model" layout="horizontal" :rules="validatorRules" slot="detail">
         <a-row :gutter="2" align="top" type="flex">
           <a-col :span="5" flex>
-            <a-form-item label="" prop="depositoryList">
+            <a-form-item label="" prop="depositoryList" :rules="validatorRules.depositoryId">
               <a-select v-model="model.depositoryId" style="width: 100%" placeholder="入仓仓库" :allowClear="true">
                 <a-select-option v-for="(item, index) in depositoryList" :key="index" :value="item.id">{{ item.name }}</a-select-option>
               </a-select>
             </a-form-item>
           </a-col>
           <a-col :span="5">
-            <a-form-item label="" prop="supplierList">
+            <a-form-item label="" prop="supplierList" :rules="validatorRules.supplierId">
               <a-select v-model="model.supplierId" style="width: 100%" placeholder="供应商" :allowClear="true">
                 <a-select-option v-for="(item, index) in supplierList" :key="index" :value="item.id">{{ item.name }}</a-select-option>
               </a-select>
             </a-form-item>
           </a-col>
           <a-col :span="5">
-            <a-form-item label="" prop="storageTypeList">
+            <a-form-item label="" prop="storageTypeList" :rules="validatorRules.stockType">
               <a-select v-model="model.stockType" style="width: 100%" placeholder="入库类型" :allowClear="true">
                 <a-select-option v-for="(item, index) in storageTypeList" :key="index" :value="item.value">{{ item.title }}</a-select-option>
               </a-select>
@@ -152,18 +152,21 @@ export default {
             },
             confirmLoading: false,
             validatorRules: {
-                depositoryList: [{
+              depositoryId: [{
                     required: true,
-                    message: '请选择入库仓库!'
-                } ],
-                supplierList: [{
+                    message: '请选择入库仓库!',
+                    trigger: 'blur',
+                }],
+              supplierId: [{
                     required: true,
-                    message: '请选择供应商!'
-                } ],
-                storageTypeList: [{
+                    message: '请选择供应商!',
+                    trigger: 'blur',
+              }],
+              stockType: [{
                     required: true,
-                    message: '请选择入库类型!'
-                } ]
+                    message: '请选择入库类型!',
+                    trigger: 'blur',
+              }]
             },
             // 表头
             columns: [{
@@ -294,15 +297,15 @@ export default {
         },
         submitForm() {
             if (this.model.depositoryId == null) {
-                this.$message.success('请选择仓库')
+                this.$message.warning('请选择仓库')
                 return
             }
             if (this.model.supplierId == null) {
-              this.$message.success('请选择供应商')
+              this.$message.warning('请选择供应商')
               return
             }
             if (this.model.stockType == null) {
-              this.$message.success('请选择入库类型')
+              this.$message.warning('请选择入库类型')
               return
             }
             const that = this