浏览代码

修改客单和预约单打印

许智捷 1 年之前
父节点
当前提交
6d3626b7f4

+ 1 - 1
src/views/markets/memberrecharge.vue

@@ -233,7 +233,7 @@ export default {
           align: "center",
           dataIndex: "money",
           customRender: function (text, record) {
-            return record.type === 1 ? "+" + text : "-" + text;
+            return record.type === 1 ? text : -record.money
           },
         },
         {

+ 76 - 2
src/views/room/advanceOrder.vue

@@ -70,7 +70,7 @@
                     type="primary"
                     icon="printer"
                     style="margin-left: 8px"
-                    v-print="'#table'"
+                    v-print="'#tableCopy'"
                 >打印</a-button>
             </span>
             <a-popover trigger="click" style="float: right;">
@@ -152,7 +152,72 @@
         </span>
       </a-table>
     </div>
-<!--    <bill-room-info-modal-->
+    <div>
+      <a-table
+          ref="tableCopy"
+          id="tableCopy"
+          size="middle"
+          v-show="false"
+          :scroll="{ x: true }"
+          bordered
+          rowKey="id"
+          :columns="columns.slice(0,-1).filter(item => item.show)"
+          :dataSource="dataSource"
+          :pagination="false"
+          class="advanceOrder"
+      >
+        <template slot="htmlSlot" slot-scope="text">
+          <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
+          >
+          <img
+              v-else
+              :src="getImgView(text)"
+              :preview="record.id"
+              height="25px"
+              alt=""
+              style="max-width: 80px; font-size: 12px; font-style: italic"
+          />
+        </template>
+        <template slot="fileSlot" slot-scope="text">
+          <span
+              v-if="!text"
+              style="font-size: 12px; font-style: italic"
+          >无文件</span
+          >
+          <a-button
+              v-else
+              :ghost="true"
+              type="primary"
+              icon="download"
+              size="small"
+              @click="downloadFile(text)"
+          >
+            下载
+          </a-button>
+        </template>
+
+        <span slot="action" slot-scope="text, record">
+          <a @click="handleInfo(record)">查看</a>
+          <a-divider v-if="queryParam.bookingStatus == 1" type="vertical" />
+          <a
+              v-if="queryParam.bookingStatus == 1"
+              @click="setOrderStatus(record)"
+          >取消订单</a
+          >
+
+          <a-divider type="vertical" v-if="queryParam.bookingStatus == 1" />
+          <a v-if="queryParam.bookingStatus == 1" @click="handleInfo(record)">入住</a>
+        </span>
+      </a-table>
+    </div>
+
+    <!--    <bill-room-info-modal-->
 <!--      ref="ModalBillRoomInfo"-->
 <!--      @ok="modalLockRoomFormOk"-->
 <!--    ></bill-room-info-modal>-->
@@ -396,4 +461,13 @@ export default {
 </script>
 <style scoped>
 @import "~@assets/less/common.less";
+
+</style>
+<style>
+@media print {
+  .advanceOrder {
+    display: block !important;
+    /* Add your custom styles for printing */
+  }
+}
 </style>

+ 156 - 22
src/views/room/guestorders.vue

@@ -1,3 +1,4 @@
+<script src="../../main.js"></script>
 <template>
   <a-card :bordered="false">
     <!-- 查询区域 -->
@@ -117,7 +118,7 @@
               <a-button
                   type="primary"
                   icon="printer"
-                  v-print="'#table'"
+                  v-print="'#tableCopy'"
               >打印</a-button>
             </span>
           </a-col>
@@ -158,7 +159,7 @@
       >
         <template #footer >
           <a-table
-              ref="table"
+              ref="innerTableCopy"
               size="middle"
               :pagination="false"
               :columns="columns.filter(item => item.show)"
@@ -278,9 +279,144 @@
         </span>
       </a-table>
     </div>
+    <div>
+      <a-table
+          id="tableCopy"
+          ref="tableCopy"
+          size="middle"
+          v-show="false"
+          :scroll="{ x: true }"
+          bordered
+          rowKey="id"
+          :columns="columns.slice(0,-1).filter(item => item.show)"
+          :dataSource="dataSource"
+          :pagination="false"
+          class="guestorders"
+          @change="handleTableChange"
+      >
+        <template #footer >
+          <a-table
+              ref="innerTableCopy"
+              size="middle"
+              :pagination="false"
+              :columns="columns.slice(0,-1).filter(item => item.show)"
+              :dataSource="totalData"
+              :showHeader="false"
+              class="nei_tabel_bottom"
+              style="padding: 0px; height: 50px"
+          ></a-table>
+        </template>
+
+        <template slot="roomName" slot-scope="text, record">
+          <span :class="record.yuE < 0 ? 'textColor' : ''">
+            {{ text ? text : '排房' }}
+          </span>
+        </template>
+        <template slot="layoutName" slot-scope="text, record">
+          <span :class="record.yuE < 0 ? 'textColor' : ''">
+            {{ text }}
+          </span>
+        </template>
+        <template slot="customerName" slot-scope="text, record">
+          <span :class="record.yuE < 0 ? 'textColor' : ''">
+            {{ record.customerName + '/' + record.customerPhone }}
+          </span>
+        </template>
+        <template slot="settleType" slot-scope="text, record">
+          <span :class="record.yuE < 0 ? 'textColor' : ''">
+            {{ getSettleTypeText(record) }}
+          </span>
+        </template>
+        <template slot="customerType" slot-scope="text, record">
+          <span :class="record.yuE < 0 ? 'textColor' : ''">
+            {{ getCustomerTypeText(record) }}
+          </span>
+        </template>
+        <template slot="customerSource" slot-scope="text, record">
+          <span :class="record.yuE < 0 ? 'textColor' : ''">
+            {{ getCustomerSourceText(record) }}
+          </span>
+        </template>
+        <template slot="otype" slot-scope="text, record">
+          <span :class="record.yuE < 0 ? 'textColor' : ''">
+            {{ getOtypeText(record) }}
+          </span>
+        </template>
+        <template slot="arrivalTime" slot-scope="text, record">
+          <span :class="record.yuE < 0 ? 'textColor' : ''">
+            {{ text }}
+          </span>
+        </template>
+        <template slot="dueOutTime" slot-scope="text, record">
+          <span :class="record.yuE < 0 ? 'textColor' : ''">
+            {{ text }}
+          </span>
+        </template>
+        <template slot="price" slot-scope="text, record">
+          <span :class="record.yuE < 0 ? 'textColor' : ''">
+            {{ record.livingDayPrices && record.livingDayPrices.length > 0 ? record.livingDayPrices[0].price : '--' }}
+          </span>
+        </template>
+        <template slot="consumption" slot-scope="text, record">
+          <span :class="record.yuE < 0 ? 'textColor' : ''">
+            {{ record.yushou - record.yuE }}
+          </span>
+        </template>
+        <template slot="yushou" slot-scope="text, record">
+          <span :class="record.yuE < 0 ? 'textColor' : ''">
+            {{ text }}
+          </span>
+        </template>
+        <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>
+        <template slot="imgSlot" slot-scope="text, record">
+          <span
+              v-if="!text"
+              style="font-size: 12px; font-style: italic"
+          >无图片</span
+          >
+          <img
+              v-else
+              :src="getImgView(text)"
+              :preview="record.id"
+              height="25px"
+              alt=""
+              style="max-width: 80px; font-size: 12px; font-style: italic"
+          />
+        </template>
+        <template slot="fileSlot" slot-scope="text">
+          <span
+              v-if="!text"
+              style="font-size: 12px; font-style: italic"
+          >无文件</span
+          >
+          <a-button
+              v-else
+              :ghost="true"
+              type="primary"
+              icon="download"
+              size="small"
+              @click="downloadFile(text)"
+          >
+            下载
+          </a-button>
+        </template>
+
+        <span slot="action" slot-scope="text, record">
+          <a @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>
     <bill-room-info-modal
       ref="ModalBillRoomInfo"
-      @ok="modalLockRoomFormOk"
     ></bill-room-info-modal>
 
   </a-card>
@@ -293,7 +429,6 @@ import { JeecgListMixin } from '@/mixins/JeecgListMixin'
 import BillRoomInfoModal from './modules/checkIn/BillRoomInfoModal.vue'
 import { postAction, getAction } from '@/api/manage'
 
-const date = new Date()
 export default {
   name: 'CesOrderMessageList',
   mixins: [JeecgListMixin, mixinDevice],
@@ -420,7 +555,9 @@ export default {
       totalData: [
         {
           orderNo: '合计',
-          consumption: 0
+          consumption: 0,
+          yushou: 0,
+          yuE: 0
         }
       ],
       url: {
@@ -477,25 +614,15 @@ export default {
   watch: {
     dataSource(val, old) {
       let allSum = 0
+      let allYushou = 0
+      let allYuE = 0
       val.forEach(e => {
-        allSum += e.yushou - e.yuE
+        allYushou += e.yushou
+        allYuE += e.yuE
       })
-      this.totalData[0].consumption = allSum;
-      // handler(newValue, oldValue) {
-      //   newValue.forEach((e, index) => {
-      //     this.$watch(
-      //         () => e.money,
-      //         (newName, oldName) => {
-      //           let num = e.num == null ? 1 : e.num
-      //           let payable = e.money * num * this.model.roomIds.length
-      //           e.payable = payable
-      //           // this.$set(e,'relMoney', payable)
-      //           e.relMoney = payable
-      //         }
-      //     )
-      //   })
-      // },
-      // deep: true // 监听数组的变化需要设置 deep 为 true
+      this.totalData[0].consumption = allYushou - allYuE
+      this.totalData[0].yushou = allYushou
+      this.totalData[0].yuE = allYuE
     }
   },
   computed: {
@@ -593,4 +720,11 @@ export default {
 .nei_tabel_bottom .ant-table-tbody > tr > td{
   border: none !important;
 }
+
+@media print {
+  .guestorders {
+    display: block !important;
+    /* Add your custom styles for printing */
+  }
+}
 </style>

+ 38 - 12
src/views/room/modules/checkIn/BillRoomInfo.vue

@@ -472,8 +472,8 @@
                 <span v-else>{{ getRoomName(text) }}</span>
               </template>
               <template slot="dayTime" slot-scope="text, record, index" class="strike_style">
-                <span class="strike_style" v-if="record.returnItem">{{ record.dayTime }}</span>
-                <span v-else>{{ record.dayTime }}</span>
+                <span class="strike_style" v-if="record.returnItem">{{ record.dayTime || record.createTime }}</span>
+                <span v-else>{{ record.dayTime || record.createTime }}</span>
               </template>
               <!-- 单价-->
               <template slot="originalPrice" slot-scope="text, record, index" class="strike_style">
@@ -1698,7 +1698,6 @@ export default {
     },
     tabChange(e) {
       //
-      console.log(e)
       this.selectRoomId = e
       if (e == '1') {
         this.entiretyList = JSON.parse(JSON.stringify(this.entiretyAmount))
@@ -1890,12 +1889,10 @@ export default {
           })
           livingRoomId.livingCustomers = list
           res.result.livingRoomIds.unshift(livingRoomId)
-          if (this.tabSelectRoomId == null || this.tabSelectRoomId === '') {
-            this.tabSelectRoomId = this.roomId
+            this.tabSelectRoomId = this.roomId && res.result.livingRoomIds.find(t => t.roomId === this.roomId)
                 ? this.roomId
                 : res.result.livingRoomIds[1].roomId
             this.selectRoomId = this.tabSelectRoomId
-          }
           this.model = res.result
           console.log(this.model);
           this.getWakeServiceData()
@@ -1913,15 +1910,11 @@ export default {
                 this.feesList = res.result.filter((t) => t.feeType === 1 && t.preferentialStatus === 1)
                 this.oldfeesList = JSON.parse(JSON.stringify(this.feesList))
                 // 已支付的消费
-                this.paidList = res.result.filter((t) => t.feeType === 1 && t.preferentialStatus === 2 && !t.isPreferential)
+                this.paidList = res.result.filter((t) => t.feeType === 1 && t.preferentialStatus === 2)
                 this.oldpaidList = JSON.parse(JSON.stringify(this.paidList))
                 // 全部账单
-                this.entiretyList = this.feesList.concat(this.paidList)
-                console.log(this.selectRoomId);
-                this.entiretyList = this.entiretyList.filter((t) => t.roomId === this.selectRoomId)
                 this.entiretyAmount = this.feesList.concat(this.paidList)
-                console.log(this.entiretyList,'全部账单');
-                console.log(this.entiretyAmount,'全部账单');
+                this.entiretyList = JSON.parse(JSON.stringify(this.entiretyAmount))
                 // 收费账单
                 this.paymentList = res.result.filter((t) => t.feeType === 2)
                 this.oldpaymentList = JSON.parse(JSON.stringify(this.paymentList))
@@ -2078,6 +2071,7 @@ export default {
           cancelText: '单房结账',
           onOk: function () {
             that.tabSelectRoomId = '1'
+            livingRoom = that.model.livingRoomIds.find((t) => t.roomId === '1')
             that.tabChange('1')
             that.settle(livingRoom)
           },
@@ -2201,6 +2195,38 @@ export default {
         this.$emit('changeLoading', false)
       })
     },
+    handleLeaveSettle() {
+      if (this.selectRoomId === '1') {
+        this.$message.warning('请先选择房间')
+        return
+      }
+      var index = this.model.livingRoomIds.findLastIndex(
+          (t) => t.roomId == this.selectRoomId
+      )
+      var find = this.model.livingRoomIds[index]
+
+      console.log(find)
+      let url = '/business/busRoomBookingOrders/cancel-leave-settle?bookingOrderId='
+      this.$emit('changeLoading', true)
+      httpAction(
+          url + find.bookingOrdersId + '&livingOrderId=' + find.livingOrder.id,
+          {},
+          'post'
+      ).then((res) => {
+        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)
+      })
+    },
+
     stayOver() {
       var index = this.model.livingRoomIds.findLastIndex(
           (t) => t.roomId === this.selectRoomId

+ 5 - 5
src/views/room/modules/checkIn/EnterAccountModel.vue

@@ -138,11 +138,10 @@ export default {
         }
         modelList.push(model)
       })
-      this.visible = true
       this.roomInfos = modelList
       this.roomId = this.roomInfos[0].roomId
-      console.log(this.errIndex)
-
+      this.errIndex = 0
+      this.visible = true
       this.getPayTypeList()
     },
     close () {
@@ -196,6 +195,7 @@ export default {
         pageNo: 1
       }).then((res) => {
         if (res.success) {
+          console.log(this.roomInfos, 'this.roomInfos')
           this.payTypeList = res.result.records
           if (this.payTypeList && this.payTypeList.length > 0) {
             this.roomInfos.forEach(e => e.addAccountList[0].payType = this.payTypeList[0].id)
@@ -216,7 +216,7 @@ export default {
     changePayTypeList(roomInfo) {
       if (!roomInfo.vipCardId || roomInfo.vipCardId.length === 0) {
         var index = this.payTypeList.findIndex((t) =>
-            t.name.includes('会员')
+            t.name === '会员卡'
         )
         if (index >= 0) {
           this.payTypeList[index].delFlag = 99
@@ -226,7 +226,7 @@ export default {
       if (!roomInfo.contractTeamId || roomInfo.contractTeamId.length === 0 ||
           !roomInfo.contractTeamProtocolId || roomInfo.contractTeamProtocolId.length === 0) {
         let index = this.payTypeList.findIndex((t) =>
-            t.name.includes('单位')
+            t.name === '单位挂账'
         )
         if (index >= 0) {
           this.payTypeList[index].delFlag = 99

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

@@ -914,7 +914,7 @@ export default {
           this.originalFeeList = res.result.filter(e => !e.returnItem)
           this.originalFeeList.forEach(e => {
             let returnMoney = res.result.filter(ele => e.id === ele.returnFeeId && ele.returnItem).reduce((accumulator, ele) => accumulator + ele.money, 0)
-            e.money = e.money - returnMoney
+            e.money = e.money + returnMoney
           })
           console.log(res.result.filter(e => e.returnItem))
           console.log(this.originalFeeList, 'originalFeeList')