瀏覽代碼

修改冲账,修改收款退款操作

许智捷 2 年之前
父節點
當前提交
e659b5895e

+ 218 - 0
src/views/finance/financeModules/StrikeBalance.vue

@@ -0,0 +1,218 @@
+<template>
+  <a-card :bordered="false">
+    <!-- 查询区域 -->
+    <div class="table-page-search-wrapper">
+      <a-form layout="inline" @keyup.enter.native="searchQuery">
+        <a-row :gutter="24">
+          <a-col :span="3">
+            <a-form-item label="结账状态">
+              <a-select v-model="queryParam.preferentialStatus" style="width: 100%" :allowClear="true">
+                <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">
+            <a-form-item label="房间名">
+              <a-input v-model="queryParam.roomName"></a-input>
+            </a-form-item>
+          </a-col>
+          <a-col :span="6">
+            <a-form-item label="">
+              <a-range-picker @change="timeOk">
+                <template slot="renderExtraFooter">
+                  <!-- extra footer -->
+                </template>
+              </a-range-picker>
+            </a-form-item>
+          </a-col>
+          <a-col :md="6" :sm="8">
+                    <span 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="searchReset" icon="reload" style="margin-left: 8px">重置</a-button> -->
+                    </span>
+          </a-col>
+        </a-row>
+      </a-form>
+    </div>
+
+    <div>
+
+      <a-table ref="table" size="middle" :scroll="{ x: true }" bordered rowKey="id" :columns="columns" :dataSource="dataSource" :pagination="ipagination" :loading="loading" class="j-table-force-nowrap" @change="handleTableChange">
+        <template slot="subjectType" slot-scope="text, record, index">
+          {{ getSubjectTypeText(text,record) }}
+        </template>
+
+
+      </a-table>
+    </div>
+  </a-card>
+</template>
+
+<script>
+import {
+  JeecgListMixin
+} from '@/mixins/JeecgListMixin'
+
+const columns = [
+  {
+    title: '订单号',
+    dataIndex: 'livingOrderId',
+    width: 30,
+    align: 'center'
+  },
+  {
+    title: '房间',
+    dataIndex: 'roomName',
+    width: 30,
+    align: 'center'
+  },
+  {
+    title: '业务详情',
+    dataIndex: 'subjectType',
+    width: 60,
+    align: 'center',
+    scopedSlots: { customRender: 'subjectType' }
+  },
+  {
+    title: '冲账金额',
+    dataIndex: 'money',
+    width: 60,
+    align: 'center',
+    customRender: function (text, record) {
+      return -record.money
+    }
+  },
+  {
+    title: '操作时间',
+    dataIndex: 'createTime',
+    width: 100,
+    align: 'center'
+  },
+  {
+    title: '备注',
+    dataIndex: 'remark',
+    width: 60,
+    align: 'center',
+    scopedSlots: { customRender: 'remark'}
+  },
+]
+export default {
+  name: "memberList",
+  mixins: [JeecgListMixin],
+  components: {
+  },
+
+  mounted() {
+
+  },
+  data() {
+    return {
+      activeKey: '4',
+      columns: columns,
+      queryParam: {
+        roomName: '',
+        preferentialStatus: ''
+      },
+      url: {
+        list: '/business/busOrderFee/strike-balance-page'
+      },
+      arr: [],
+      // dataList:[],
+      examineVisible: false,
+      // 分页参数
+      ipagination: {
+        current: 1,
+        pageSize: 10,
+        pageSizeOptions: ["10", "20", "30"],
+        showTotal: (total, range) => {
+          return range[0] + "-" + range[1] + " 共" + total + "条";
+        },
+        showQuickJumper: true,
+        showSizeChanger: true,
+        total: 0,
+      },
+
+    };
+  },
+  created() {
+
+  },
+  methods: {
+    tabStockTypeChange(e) {
+      this.queryParam.type = e;
+      this.loadData();
+    },
+
+    handleOk() {
+
+    },
+
+    timeOk(data, dataTime) {
+      this.queryParam.startTime = dataTime[0];
+      this.queryParam.endTime = dataTime[1];
+      this.loadData();
+    },
+    getSubjectTypeText(text, record) {
+      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 && record.feeGoodVo) {
+        msg = '商品-' + record.feeGoodVo.name
+      } 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>
+
+<style lang="less" scoped>
+@import "~@assets/less/common.less";
+
+/deep/ .ant-table-content .ant-table-body {
+  position: relative;
+  z-index: 2;
+  background: #FFFFFF;
+}
+
+/deep/ .ant-table-footer .ant-table-body {
+  overflow: hidden !important;
+  position: relative !important;
+  z-index: 1 !important;
+}
+
+/deep/ .ant-table-content>.ant-table-footer {
+  padding: 0 !important;
+  top: -47px;
+  position: relative;
+  z-index: 0;
+}
+/deep/.ant-table-footer{
+  padding: 0 !important;
+  top: -8px;
+  position: relative;
+  z-index: 2;
+}
+</style>

+ 11 - 11
src/views/finance/index.vue

@@ -13,28 +13,28 @@
         <span slot="tab"> 客人余额报表 </span>
         <supplier v-if="activeKey == '3'"></supplier>
       </a-tab-pane>
+      <a-tab-pane key="4">
+        <span slot="tab"> 冲账账单 </span>
+        <strike-balance v-if="activeKey == '4'"></strike-balance>
+      </a-tab-pane>
     </a-tabs>
   </a-card>
 </template>
 
 <script>
-import depository from "./financeModules/depository.vue";
-import goods from "./financeModules/detailedReport.vue";
-// import supplier from "./supplier.vue";
-// import stock from "./stock.vue";
-// import depositoryingoods from './depositoryingoods'
+import depository from './financeModules/depository.vue'
+import goods from './financeModules/detailedReport.vue'
+import StrikeBalance from './financeModules/StrikeBalance'
 export default {
   components: {
     depository,
     goods,
-    // supplier,
-    // stock,
-    // depositoryingoods
+    StrikeBalance
   },
   data() {
-    return { activeKey: "1" };
-  },
-};
+    return { activeKey: '1' }
+  }
+}
 </script>
 
 <style scoped>

+ 7 - 16
src/views/room/modules/checkIn/BillRoomInfo.vue

@@ -676,18 +676,7 @@ const columns = [
       if (record.subjectType === 6 && record.feeGoodVo.originalPrice) {
         return record.feeGoodVo.originalPrice
       }
-      return record.money
-    }
-  },
-  {
-    title: '优惠价',
-    dataIndex: 'money',
-    // width: 60,
-    customRender: function (text, record) {
-      if (record.subjectType === 6 && record.feeGoodVo.price) {
-        return record.feeGoodVo.price
-      }
-      return text
+      return record.originalMoney
     }
   },
   {
@@ -703,11 +692,13 @@ const columns = [
   },
   {
     title: '小计',
-    dataIndex: 'livingOrderId',
+    dataIndex: 'originalMoney',
+    // width: 60,
+  },
+  {
+    title: '优惠价',
+    dataIndex: 'money',
     // width: 60,
-    customRender: function (text, record) {
-      return record.money
-    }
   }
 ]
 

+ 16 - 1
src/views/room/modules/checkIn/EditCustomerTypeForm.vue

@@ -15,7 +15,7 @@
               :wrapperCol="wrapperCol"
               prop="customerType"
             >
-              <a-select placeholder="宾客类型" v-model="model.customerType">
+              <a-select placeholder="宾客类型" v-model="model.customerType" @change="chnageCustomerType">
                 <a-select-option :value="1"> 散客 </a-select-option>
                 <a-select-option :value="2"> 会员 </a-select-option>
                 <a-select-option :value="3"> 协议单位 </a-select-option>
@@ -148,6 +148,8 @@
 import { httpAction, getAction } from "@/api/manage";
 import { validateDuplicateValue } from "@/utils/util";
 import AgreementUnitModalTable from "./AgreementUnitModalTable";
+import JVxeCellMixins, { dispatchEvent } from '@/components/jeecg/JVxeTable/mixins/JVxeCellMixins'
+import { JVXETypes } from '@comp/jeecg/JVxeTable/index'
 export default {
   name: "BusMemberCardForm",
   components: { AgreementUnitModalTable },
@@ -205,6 +207,7 @@ export default {
       oldBusMarketAgreementUnitList: [],
       busMarketAgreementUnitList: [],
       busMarketAgreementCustomer: {},
+      loading: false,
     };
   },
   computed: {
@@ -213,6 +216,7 @@ export default {
     },
   },
   created() {
+    this.confirmLoading = true;
     var _info = JSON.parse(localStorage.getItem("storeInfo"));
     if (_info) {
       this.model.hotelId = _info.id;
@@ -233,6 +237,7 @@ export default {
           this.handleSelectVip(this.model.vipCustomerId);
         }
       }
+      this.confirmLoading = false;
     });
     getAction("/business/busMarketAgreementUnit/list", {
       pageSize: 99999,
@@ -247,7 +252,10 @@ export default {
           this.handleSelectAgreementUnit(this.model.contractTeamId);
         }
       }
+      // this.loading = false
+
     });
+    // this.loading = false
   },
   methods: {
     modalAgreementUnitTableOk(e) {
@@ -293,6 +301,13 @@ export default {
         }
       });
     },
+    chnageCustomerType(value) {
+      if (value === 1) {
+        console.log(value)
+        debugger
+        this.model.vipCustomerId = null
+      }
+    },
     handleSearchVip(value) {
       let result;
       if (!value) {

+ 12 - 12
src/views/room/modules/checkIn/FeeForm.vue

@@ -240,25 +240,25 @@ export default {
                     }
                     that.confirmLoading = true;
                     var orders = [];
-                    let feeGoods = []
-                    
-                    if (this.model.subjectType == 6) {
-                        that.dataSource.forEach(ele=>{
-                        if (ele.number>0) {
-                            feeGoods.push({
+                    let feeGood = {}
+
+                    if (this.model.subjectType === 6) {
+                        that.dataSource.forEach(ele => {
+                        if (ele.number > 0) {
+                            feeGood = {
                                 goodsId: ele.id,
                                 num: ele.number,
                                 price: ele.sellingPrice
-                            })
+                            }
+                            orders.push({
+                              money: ele.sellingPrice * (ele.number || 0),
+                              subjectType: this.model.subjectType,
+                              feeGoodVo: feeGood
+                          });
                             }
                         })
                         that.model.money = that.goodsPrice
                     }
-                    orders.push({
-                        money: this.model.money,
-                        subjectType: this.model.subjectType,
-                        feeGoods: feeGoods
-                    });
                     this.model.orders = orders;
                     this.model.livingOrderId = this.livingOrderId;
                     httpAction("/business/busRoomBookingOrders/set-living-order-fee?livingOrderId=" + this.livingOrderId, orders, "post")

+ 16 - 9
src/views/room/modules/checkIn/StrikeBalanceModel.vue

@@ -103,18 +103,25 @@ export default {
       this.visible = false
     },
     handleOk() {
-      let num = 0
-      this.feesList.forEach(e => {
-        if (e.money > e.oldPrice) {
-          e.money = e.oldPrice
-          num++
-        }
-      })
-      if (num > 0) {
+      let fees = []
+      if (this.feesList.some(e => e.money > e.oldPrice)) {
         this.$message.warning('冲账金额不能超过原金额')
         return
+      } else {
+        this.feesList.forEach(e => {
+          // 一条消费可能有多次冲账,所以传入后端的money是冲账的负数差值
+          if (e.oldPrice - e.money > 0) {
+            let param = Object.assign({}, e)
+            param.money = param.money - param.oldPrice
+            fees.push(param)
+          }
+        })
       }
-      postAction('/business/busOrderFee/strike-balance', this.feesList).then(resp => {
+      if (fees.length === 0) {
+        return
+      }
+
+      postAction('/business/busOrderFee/strike-balance', fees).then(resp => {
         if (resp.result === true) {
           this.$message.success('冲账成功')
           this.$emit('ok')