Forráskód Böngészése

修改pos二次下单功能,修改单位挂账扣款功能

许智捷 2 éve
szülő
commit
5afdd51298

+ 29 - 8
src/views/pos/diandan.vue

@@ -11,6 +11,7 @@
       <a-card style="width: 30%;">
         <a href="#" @click="remarkModal"> <a-icon type="edit" />整单备注</a>
         &nbsp;&nbsp;<a-icon type="user" />
+        <spn v-if="posTableId !=''">桌台: {{ posTableName }}</spn>
         <span v-if="selectRoomOrder && selectRoomOrder.roomName">
           房间:{{ selectRoomOrder.roomName }},姓名:{{
             selectRoomOrder.customerName
@@ -47,13 +48,16 @@
         <p>数量:{{ sum }}</p>
         <div v-if="this.posTableState === 1">
           <a-button @click="placeOrder" :disabled="btnDisabled">下单</a-button>
+<!--          <a-button @click="addClear" :disabled="btnDisabled">清空新加</a-button>-->
         </div>
         <div v-else style="display: flex; gap: 5px; flex-flow: wrap">
           <a-button @click="handleClear" :disabled="btnDisabled">清空</a-button>
           <!-- <a-button @click="handleAdd" :disabled="btnDisabled">备注</a-button> -->
           <!-- <a-button :disabled="btnDisabled">退货</a-button> -->
-          <a-button v-if="!btnDisabled" @click="handleAdd">挂单</a-button>
-          <a-button v-else @click="handlePickingGoodsOrder">取单</a-button>
+          <div v-if="posTableId === ''">
+            <a-button v-if="!btnDisabled" @click="handleAdd">挂单</a-button>
+            <a-button v-else @click="handlePickingGoodsOrder">取单</a-button>
+          </div>
           <a-button
             v-if="selectRoomOrder && selectRoomOrder.roomName && !btnDisabled"
             @click="handleToRoomFeePayment"
@@ -231,12 +235,17 @@ export default {
     tableState: {
       type: Number,
       default: -1
+    },
+    tableName: {
+      type: String,
+      default: ''
     }
   },
   watch: {
     tableId: function (newValue, oldValue) {
       this.posTableId = this.tableId
       this.posTableState = this.tableState
+      this.posTableName = this.tableName
       if (this.tableId !== '' && this.tableState === 2) {
         this.getOrderByTableId(this.tableId)
       }
@@ -246,6 +255,7 @@ export default {
     return {
       posTableId: '',
       posTableState: -1,
+      posTableName: '',
       tableState2: -1,
       isRemarkModal: false,
       isSaoma: false,
@@ -327,6 +337,7 @@ export default {
       }, 0)
     },
     amount() {
+      console.log(this.selectGoodsList)
       return this.selectGoodsList.reduce(function (total, item) {
         return total + item.sellingPrice * item.num
       }, 0)
@@ -445,6 +456,11 @@ export default {
         this.selectGoodsList.splice(index, 1)
       }
     },
+    addClear() {
+      let findList = this.selectGoodsList.filter(e => e.id != null)
+      this.selectGoodsList = findList
+      // this.selectOrderInfo = {};
+    },
     handleClear() {
       this.selectGoodsList = []
       // this.selectOrderInfo = {};
@@ -554,7 +570,6 @@ export default {
     },
     settleAccounts(orderCode) {
       console.log(orderCode)
-      debugger
       var amount = this.oldSelectGoodsList.reduce(function (total, item) {
         return total + item.sellingPrice * item.num
       }, 0)
@@ -576,7 +591,6 @@ export default {
       this.handleAdd()
     },
     handleAdd(callback) {
-      debugger
       if (!this.selectGoodsList || this.selectGoodsList.length <= 0) {
         this.$message.warning('请先选择商品')
         return
@@ -624,7 +638,8 @@ export default {
       var posOrderGoodsDetailList = []
       this.selectGoodsList.forEach((t) => {
         posOrderGoodsDetailList.push({
-          goodsId: t.id,
+          id: t.id,
+          goodsId: t.goodsId,
           num: t.num,
           money: t.sellingPrice
         })
@@ -643,9 +658,14 @@ export default {
         this.$message.warning('选择的商品已沽清')
         return
       }
+      if (this.posTableId !== '' && this.posTableState !== 1) {
+        this.posTableState = 1
+      }
       var good = JSON.parse(JSON.stringify(row))
       this.$set(good, 'num', 1)
-      var find = this.selectGoodsList.find((t) => t.id === row.id)
+      this.$set(good, 'goodsId', good.id)
+      delete good.id
+      var find = this.selectGoodsList.find((t) => t.inventory != null && t.goodsId === row.id)
       if (find) {
         if (find.inventory > find.num) {
           find.num++
@@ -658,8 +678,9 @@ export default {
       console.log(row)
       var good = JSON.parse(JSON.stringify(row))
       this.$set(good, 'num', 1)
-      this.$set(good, 'sellingPrice', good.price)
-      var find = this.selectGoodsList.find((t) => t.id === row.id)
+      this.$set(good, 'goodsId', good.id)
+      delete good.id
+      var find = this.selectGoodsList.find((t) => t.goodsId === row.id)
       if (find) {
         find.num++
       } else {

+ 5 - 3
src/views/pos/posInfo.vue

@@ -3,7 +3,7 @@
     <a-tabs v-model="activeKey" @change="tabChange">
       <a-tab-pane key="1">
         <span slot="tab"> 点单 </span>
-        <diandan ref="diandan" :tableId="diandanId" :tableState="diandanState" @reTable="reTable"></diandan>
+        <diandan ref="diandan" :tableId="diandanId" :tableState="diandanState" :tableName="diandanName" @reTable="reTable"></diandan>
       </a-tab-pane>
       <a-tab-pane key="2">
         <span slot="tab"> 桌台点单 </span>
@@ -47,17 +47,19 @@ export default {
     return {
       activeKey: '1',
       diandanId: '',
-      diandanState: -1
+      diandanState: -1,
+      diandanName: ''
     }
   },
   methods: {
-    retId(id, state) {
+    retId(id, state, name) {
       this.activeKey = '1'
       this.diandanId = ''
       setTimeout(()=>{
         this.diandanId = id
       }, 200)
       this.diandanState = state
+      this.diandanName = name
     },
     reTable() {
       this.activeKey = '2'

+ 1 - 1
src/views/pos/tablediandangallery.vue

@@ -513,7 +513,7 @@ export default {
       } else {
         debugger
         console.log(this.selectTable)
-        this.$emit('retId', this.selectTable.id, this.selectTable.state)
+        this.$emit('retId', this.selectTable.id, this.selectTable.state,this.selectTable.name)
         // this.$router.push({
         //   name: "pos-tablediandan",
         //   params: { tableId: row.id },

+ 1 - 0
src/views/room/modules/checkIn/EnterAccountModel.vue

@@ -127,6 +127,7 @@ export default {
           vipCardId: e.livingOrder.vipCustomerId,
           contractTeamProtocolId: e.livingOrder.contractTeamProtocolId,
           contractTeamId: e.livingOrder.contractTeamId,
+          agreementUnitId: e.livingOrder.contractTeamId,
           addAccountList: [{
             payType: '',
             money: 0,

+ 2 - 1
src/views/room/modules/checkIn/RefundModal.vue

@@ -163,7 +163,8 @@ export default {
           feeType: e.feeType,
           subjectType: 13,
           payType: e.payType,
-          hotelId: e.hotelId
+          hotelId: e.hotelId,
+          agreementUnitId: e.agreementUnitId
         }
         refundFeeList.push(refundFee)
       })