소스 검색

处理文档中的问题

许智捷 2 년 전
부모
커밋
c143b249af

+ 104 - 0
src/views/room/modules/checkIn/AdjustPriceForm.vue

@@ -0,0 +1,104 @@
+<template>
+  <j-modal
+    :title="title"
+    :width="400"
+    :visible="visible"
+    switchFullscreen
+    @ok="handleOk"
+    :okButtonProps="{ class: { 'jee-hidden': disableSubmit } }"
+    @cancel="handleCancel"
+    cancelText="关闭"
+  >
+    <div>
+      <a-row>
+        <a-col :span="24">
+          <a-input-number min="0" @change="roomBatchPrice" placeholder="批量改价"></a-input-number>
+        </a-col>
+      </a-row>
+      <a-tabs
+        :active-key="activePage"
+        @change="changePage"
+      >
+
+        <a-tab-pane v-for="roomInfo in roomInfoList" :key="roomInfo.id" :tab="roomInfo.roomName">
+          <a-card style="width: 300px; height: 400px; overflow-y: scroll" >
+            <div v-for="dayPrice in roomInfo.dayPrices" :key="dayPrice.id">
+              {{ dayPrice.dayTime }}
+              <a-input-number :min="0" v-model="dayPrice.price"></a-input-number>
+            </div>
+          </a-card>
+        </a-tab-pane>
+      </a-tabs>
+    </div>
+
+  </j-modal>
+</template>
+
+<script>
+import { postAction } from '@api/manage'
+
+export default {
+  components: {
+  },
+  data() {
+    return {
+      title: '',
+      visible: false,
+      disableSubmit: false,
+      showYinshou: true,
+      activePage: '',
+      roomInfoList: []
+    }
+  },
+  methods: {
+    edit(roomInfos) {
+      this.visible = true
+      this.roomInfoList = []
+      roomInfos.forEach(e => {
+        console.log(new Date().format('yyyy-MM-dd'))
+        let dayPrices = e.livingDayPrices.filter(dayPrice => dayPrice.dayTime >= new Date().format('yyyy-MM-dd'))
+        const roomInfo = {
+          id: e.id,
+          livingOrderId: e.livingOrder.id,
+          roomName: e.roomName,
+          dayPrices
+        }
+        this.roomInfoList.push(roomInfo)
+      })
+      this.activePage = this.roomInfoList[0].id
+      console.log(this.roomInfoList)
+    },
+    close() {
+      this.$emit('close')
+      this.visible = false
+    },
+    handleOk() {
+      let params = this.roomInfoList.filter(e => e.dayPrices.length > 0)
+      postAction('/business/busRoomBookingOrders/batch-update-order-price', params)
+          .then(resp => {
+            if (resp.result === true) {
+              this.$message.success('调价成功')
+              this.$emit('ok')
+              this.visible = false
+            } else {
+              this.$message.warning('调价失败')
+            }
+          }
+      )
+    },
+    handleCancel() {
+      this.close()
+    },
+    changePage(key) {
+      this.activePage = key
+    },
+    roomBatchPrice(newPrice) {
+      this.roomInfoList.forEach(e => {
+        e.dayPrices.forEach(ele => {
+          ele.price = newPrice
+        })
+      })
+    }
+  }
+}
+</script>

+ 31 - 19
src/views/room/modules/checkIn/BillRoomInfo.vue

@@ -381,15 +381,15 @@
               </a-button>
             </div>
             <div
-                :class="`${selectedRowKeys1.length == 0 || selectRoomId == '1' || chooseLivingRoom.livingOrder && chooseLivingRoom.livingOrder.settleType !== -1 ? 'disabled' : ''}`"
-                @click="tuidan"
-                style="display: flex; flex-direction: column">
+              :class="`${consumSelectedRowKeys.length == 0 || selectRoomId == '1' || chooseLivingRoom.livingOrder && chooseLivingRoom.livingOrder.settleType !== -1 ? 'disabled' : ''}`"
+              @click="tuidan"
+              style="display: flex; flex-direction: column">
               <a-icon
                 type="import"
                 style="color: rgba(255, 141, 26, 1); font-size: 18px"
               /><a-button
                 type="link"
-                :disabled="selectedRowKeys1.length == 0 || selectRoomId == '1'"
+                :disabled="consumSelectedRowKeys.length == 0 || selectRoomId == '1'"
               >
                 退单
               </a-button>
@@ -400,7 +400,7 @@
                 style="color: rgba(255, 141, 26, 1); font-size: 18px"
               /><a-button
                 type="link"
-                :disabled="selectedRowKeys1.length == 0 || selectRoomId == '1'"
+                :disabled="consumSelectedRowKeys.length == 0 || selectRoomId == '1'"
                 @click="partialSettle"
               >
                 部分结账
@@ -478,7 +478,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">
+            <div style="display: flex; flex-direction: column" @click="strikeBalance">
               <a-icon
                 type="pound"
                 style="color: rgba(255, 141, 26, 1); font-size: 18px"
@@ -567,8 +567,9 @@
     <customer-modal ref="modalCustomerForm" @ok="modalFormOk"></customer-modal>
     <refund-modal ref="modalRefundForm" @ok="modalFormOk"></refund-modal>
     <payment-modal ref="modalPaymentForm" @ok="modalFormOk"></payment-modal>
-    <pay-or-refund-modal ref="modalPayOrRefundForm" @ok="modalFormOk"></pay-or-refund-modal>
+<!--    <pay-or-refund-modal ref="modalPayOrRefundForm" @ok="modalFormOk"></pay-or-refund-modal>-->
     <fee-modal ref="modalFeeForm" @ok="modalFormOk"></fee-modal>
+    <strike-balance-model  ref="modalStrikeBalanceForm" @ok="modalFormOk"></strike-balance-model>
     <member-message-modal ref="modalMemberMessage"></member-message-modal>
     <lease-goods-modal ref="modalLeaseGoods"></lease-goods-modal>
     <select-check-in-room-order-modal
@@ -662,8 +663,10 @@ import EditRemarkModal from './EditRemarkModal.vue'
 import EditBreakfastNumModal from './EditBreakfastNumModal.vue'
 import EditBookingTypeModal from './EditBookingTypeModal.vue'
 import { match } from 'assert'
-import PayOrRefundModal from '@views/room/modules/checkIn/PayOrRefundModel'
+// import PayOrRefundModal from '@views/room/modules/checkIn/PayOrRefundModel'
 import AdjustPriceForm from '@views/room/modules/checkIn/AdjustPriceForm'
+import StrikeBalance from '@views/room/modules/checkIn/StrikeBalanceModel'
+import StrikeBalanceModel from '@views/room/modules/checkIn/StrikeBalanceModel'
 const columns = [
   // {
   //     title: "",
@@ -801,6 +804,8 @@ const endDate = new Date(date.setDate(date.getDate() + 1))
 export default {
   name: 'BusMeetingRoomForm',
   components: {
+    StrikeBalanceModel,
+    StrikeBalance,
     AdjustPriceForm,
     PayOrRefundModal,
     CustomerModal,
@@ -835,6 +840,8 @@ export default {
         time: ''
       },
       selectedRowKeys: [],
+      consumSelectedRowKeys: [],
+      consumSelectedRows: [],
       data,
       columns,
       innerColumns,
@@ -882,7 +889,6 @@ export default {
       payTypeList: [],
       vipCustomer: {},
       selectRoomId: '1',
-      selectedRowKeys1: [],
       /**
        * 选中房间信息
        */
@@ -939,12 +945,8 @@ export default {
     rowSelection() {
       return {
         onChange: (selectedRowKeys, selectedRows) => {
-          // console.log(
-          //   `selectedRowKeys: ${selectedRowKeys}`,
-          //   "selectedRows: ",
-          //   selectedRows
-          // );
-          this.selectedRowKeys1 = selectedRowKeys
+          this.consumSelectedRowKeys = selectedRowKeys
+          this.consumSelectedRows = selectedRows
         },
         getCheckboxProps: (record) => ({
           props: {
@@ -1330,7 +1332,7 @@ export default {
     tuidan() {
       postAction(
         '/business/busRoomBookingOrders/退你麻痹单狗东西',
-        this.selectedRowKeys1
+        this.consumSelectedRowKeys
       ).then((res) => {
         if (res.success) {
           this.$message.success('退单成功')
@@ -1342,7 +1344,7 @@ export default {
     },
     partialSettle() {
       var list2 = this.feesList.filter((t) =>
-        this.selectedRowKeys1.includes(t.id)
+        this.consumSelectedRowKeys.includes(t.id)
       )
       console.log(list2)
       var amount = list2.reduce(function (total, item) {
@@ -1365,7 +1367,7 @@ export default {
         couponFirstAmount: 0,
         discount: 9,
         vipCustomerId: this.model.orderInfo.vipCustomerId,
-        selectedFeeIds: this.selectedRowKeys1
+        selectedFeeIds: this.consumSelectedRowKeys
       })
       this.$refs.modalPaymentForm.title = '部分结账收款'
       this.$refs.modalPaymentForm.disableSubmit = false
@@ -1563,7 +1565,7 @@ export default {
       let ids = []
       let mess = ''
       if (value === 1) {
-        ids = this.selectedRowKeys1
+        ids = this.consumSelectedRowKeys
         mess = '消费详情中要收款'
       } else {
         ids = this.selectedRowKeys
@@ -1583,6 +1585,16 @@ export default {
         }
       })
     },
+    strikeBalance() {
+      debugger
+      console.log(this.consumSelectedRows)
+      if (this.consumSelectedRows.length === 0) {
+        this.$message.warning('请先选择消费详情中需要冲账的账单')
+        return
+      }
+      this.$refs.modalStrikeBalanceForm.title = '冲账单'
+      this.$refs.modalStrikeBalanceForm.edit(this.consumSelectedRows)
+    },
     async handleAdd() {
       var that = this
       var index = this.model.livingRoomIds.findLastIndex(

+ 135 - 0
src/views/room/modules/checkIn/StrikeBalanceModel.vue

@@ -0,0 +1,135 @@
+<template>
+  <j-modal
+    :title="title"
+    :width="width"
+    :visible="visible"
+    switchFullscreen
+    @ok="handleOk"
+    :okButtonProps="{ class: { 'jee-hidden': disableSubmit } }"
+    @cancel="handleCancel"
+    cancelText="关闭"
+  >
+    <a-table
+      :columns="columns"
+      :data-source="feesList"
+      :pagination="false"
+      :scroll="{ y: 160 }"
+      rowKey="id">
+      <template slot="subjectType" slot-scope="text, record, index">
+        {{ getSubjectTypeText(text) }}
+      </template>
+      <template #newPice="{ text, record }">
+        <a-input v-model="record.newPrice" />
+      </template>
+    </a-table>
+  </j-modal>
+</template>
+
+<script>
+const columns = [
+  // {
+  //     title: "",
+  //     dataIndex: "key",
+  //     width: 20,
+  //   },
+  {
+    title: '费项',
+    dataIndex: 'subjectType',
+    width: 100,
+    scopedSlots: { customRender: 'subjectType' }
+  },
+  {
+    title: '日期',
+    dataIndex: 'dayTime',
+    width: 1100
+  },
+  {
+    title: '金额',
+    dataIndex: 'price',
+    width: 60
+  },
+  {
+    title: '冲账金额',
+    dataIndex: 'newPrice',
+    // scopedSlots: { customRender: 'newPrice' },
+    width: 110,
+    customRender: (text, record) => {
+      return {
+        children: <a-input v-model={record.newPrice} />
+      }
+    }
+  }]
+export default {
+  name: 'StrikeBalanceModel',
+  components: {
+  },
+  data() {
+    return {
+      title: '',
+      width: 800,
+      visible: false,
+      disableSubmit: false,
+      showYinshou: true,
+      columns: columns,
+      feesList: []
+    }
+  },
+  methods: {
+
+    edit(record) {
+      this.visible = true
+      console.log(record)
+      this.feesList = record
+      this.feesList.forEach(e => {
+        e.newPrice = e.price
+      })
+    },
+    close() {
+      this.$emit('close')
+      this.visible = false
+    },
+    handleOk() {
+      this.$refs.realForm.submitForm()
+    },
+    submitCallback() {
+      this.$emit('ok')
+      this.visible = false
+    },
+    handleCancel() {
+      this.close()
+    },
+    getSubjectTypeText(text) {
+      var msg = ''
+      if (text === 1) {
+        msg = '押金'
+      } else if (text === 2) {
+        msg = '预收房费'
+      } else if (text === 3) {
+        msg = '每日房费'
+      } else if (text === 4) {
+        msg = '优惠金额'
+      } else if (text === 5) {
+        msg = '结账收款'
+      } else if (text === 6) {
+        msg = '商品'
+      } else if (text === 7) {
+        msg = '点餐'
+      } else if (text === 8) {
+        msg = '夜审房费'
+      } else if (text === 9) {
+        msg = '会议室'
+      } else if (text === 10) {
+        msg = '手工房费'
+      } else if (text === 11) {
+        msg = '水电煤抄表'
+      } else if (text === 12) {
+        msg = '赔偿费'
+      } else if (text === 13) {
+        msg = '退单结账'
+      }
+      return msg
+    }
+
+  }
+}
+</script>