Browse Source

优化房态页面 优化房态详情-增加优惠价 优化房价日历页面 更改换房字段

覃浩 2 years ago
parent
commit
7c68b1cb36

+ 176 - 16
src/views/pos/reserve.vue

@@ -5,24 +5,119 @@
       <div class="table-page-search-wrapper">
         <a-form layout="inline">
           <a-row :gutter="24">
-            <a-col :span="8">
-              <a-form-item label="">
+            <a-col :span="3">
+            <a-radio-group v-model="presetTimeTab" style="margin-bottom: 16px">
+              <a-radio-button value="small">金额冲账</a-radio-button>
+              <a-radio-button value="default">商品冲账</a-radio-button>
+            </a-radio-group>
+          </a-col>
+          <a-col :span="4">
+            <a-form-item label="">
+              <a-range-picker
+                  format="YYYY-MM-DD"
+                  :placeholder="['开始日期', '结束日期']"
+                  @change="onChange"
+                  v-model="datetime"
+              />
+            </a-form-item>
+          </a-col>
+          <a-col :span="4">
+            <a-form-item label="预订单状态">
+              <a-select
+                ref="select"
+                v-model:value="orderStatus"
+                style="width: 150px"
+                @focus="focus"
+                @change="handleChange"
+              >
+                <a-select-option value="jack">Jack</a-select-option>
+                <a-select-option value="lucy">Lucy</a-select-option>
+                <a-select-option value="disabled" disabled>Disabled</a-select-option>
+                <a-select-option value="Yiminghe">yiminghe</a-select-option>
+              </a-select>
+            </a-form-item>
+          </a-col>
+          <a-col :span="4">
+            <a-form-item label="POS类型">
+              <a-select
+                ref="select"
+                v-model:value="orderStatus"
+                style="width: 150px"
+                @focus="focus"
+                @change="handleChange"
+              >
+                <a-select-option value="jack">Jack</a-select-option>
+                <a-select-option value="lucy">Lucy</a-select-option>
+                <a-select-option value="disabled" disabled>Disabled</a-select-option>
+                <a-select-option value="Yiminghe">yiminghe</a-select-option>
+              </a-select>
+            </a-form-item>
+          </a-col>
+          <a-col :span="6">
+            <a-form-item label="餐段">
+              <a-select
+                ref="select"
+                v-model:value="orderStatus"
+                style="width: 150px"
+                @focus="focus"
+                @change="handleChange"
+              >
+                <a-select-option value="jack">Jack</a-select-option>
+                <a-select-option value="lucy">Lucy</a-select-option>
+                <a-select-option value="disabled" disabled>Disabled</a-select-option>
+                <a-select-option value="Yiminghe">yiminghe</a-select-option>
+              </a-select>
+            </a-form-item>
+          </a-col>
+          <a-col :span="4">
+              <a-form-item label="预定单号">
                 <j-input
-                    placeholder="取餐号"
+                    placeholder="请输入预定单号"
                     v-model="queryParam.tableNo"
                 ></j-input>
               </a-form-item>
             </a-col>
-            <a-col :span="12">
+            <a-col :span="4">
+            <a-form-item label="操作员">
+              <a-select
+                ref="select"
+                v-model:value="orderStatus"
+                style="width: 150px"
+                @focus="focus"
+                @change="handleChange"
+              >
+                <a-select-option value="jack">Jack</a-select-option>
+                <a-select-option value="lucy">Lucy</a-select-option>
+                <a-select-option value="disabled" disabled>Disabled</a-select-option>
+                <a-select-option value="Yiminghe">yiminghe</a-select-option>
+              </a-select>
+            </a-form-item>
+          </a-col>
+          <a-col :span="4">
+            <a-form-item label="顾客姓名">
+              <j-input
+                  placeholder="请输入顾客姓名"
+                  v-model="queryParam.tableNo"
+              ></j-input>
+            </a-form-item>
+          </a-col>
+          <a-col :span="4">
+            <a-form-item label="顾客手机号">
+              <j-input
+                  placeholder="请输入顾客手机号"
+                  v-model="queryParam.tableNo"
+              ></j-input>
+            </a-form-item>
+          </a-col>
+            <!-- <a-col :span="3">
               <a-form-item label="">
-                <a-range-picker
-                    format="YYYY-MM-DD"
-                    :placeholder="['开始日期', '结束日期']"
-                    @change="onChange"
-                    v-model="datetime"
-                />
+                <j-input
+                    placeholder="取餐号"
+                    v-model="queryParam.tableNo"
+                ></j-input>
               </a-form-item>
-            </a-col>
+            </a-col> -->
+            
             <a-col :span="2">
             <span>
               <a-button
@@ -77,6 +172,41 @@ import { mixinDevice } from '@/utils/mixin'
 import ReserveModal from '@views/pos/modules/ReserveModal'
 
 const columns = [
+  // {
+  //   title: '预定单号',
+  //   align: 'center',
+  //   dataIndex: 'code'
+  // },
+  // {
+  //   title: '预订单状态',
+  //   align: 'center',
+  //   dataIndex: 'code'
+  // },
+  // {
+  //   title: '就餐时间',
+  //   align: 'center',
+  //   dataIndex: 'code'
+  // },
+  // {
+  //   title: '桌数',
+  //   align: 'center',
+  //   dataIndex: 'code'
+  // },
+  // {
+  //   title: '合计价格',
+  //   align: 'center',
+  //   dataIndex: 'code'
+  // },
+  // {
+  //   title: '定金',
+  //   align: 'center',
+  //   dataIndex: 'code'
+  // },
+  // {
+  //   title: '创建时间',
+  //   align: 'center',
+  //   dataIndex: 'code'
+  // },
   {
     title: '预定单号',
     align: 'center',
@@ -88,27 +218,52 @@ const columns = [
     dataIndex: 'code'
   },
   {
-    title: '就餐时间',
+    title: 'pos类型',
+    align: 'center',
+    dataIndex: 'code'
+  },
+  {
+    title: '来源',
+    align: 'center',
+    dataIndex: 'code'
+  },
+  {
+    title: '预定就餐时间',
+    align: 'center',
+    dataIndex: 'code'
+  },
+  {
+    title: '餐段',
+    align: 'center',
+    dataIndex: 'code'
+  },
+  {
+    title: '预定桌数',
+    align: 'center',
+    dataIndex: 'code'
+  },
+  {
+    title: '预定菜品合计价格(元)',
     align: 'center',
     dataIndex: 'code'
   },
   {
-    title: '桌数',
+    title: '订金金额(元)',
     align: 'center',
     dataIndex: 'code'
   },
   {
-    title: '合计价格',
+    title: '顾客名字',
     align: 'center',
     dataIndex: 'code'
   },
   {
-    title: '定金',
+    title: '性别',
     align: 'center',
     dataIndex: 'code'
   },
   {
-    title: '创建时间',
+    title: '电话',
     align: 'center',
     dataIndex: 'code'
   }
@@ -124,6 +279,11 @@ export default {
       queryParam: {},
       datetime: [],
       columns: columns,
+      // 预定时间tab
+      presetTimeTab: 'small',
+      // 预订单状态
+      orderStatus: ''
+
     }
   },
   methods: {

+ 13 - 9
src/views/room/modules/checkIn/BillRoomInfo.vue

@@ -459,8 +459,8 @@
                 <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.money }}</span>
-                <span v-else>{{ record.money }}</span>
+                <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>
               </template>
               <!-- <template slot="roomId" slot-scope="text, record, index" class="strike_style">
                 {{ getRoomName(text) }}
@@ -805,6 +805,16 @@ const columns = [
     }
   },
   {
+    title: '优惠价',
+    align: 'center',
+    dataIndex: 'money',
+    scopedSlots: { customRender: 'money' },
+    width: 67,
+    // customRender: function (text, record) {
+    //   return (record.originalMoney / record.feeType)
+    // }
+  },
+  {
     title: '数量',
     dataIndex: 'feeType',
     width: 60,
@@ -824,13 +834,7 @@ const columns = [
     scopedSlots: { customRender: 'originalMoney' },
     width: 67
   },
-  {
-    title: '优惠价',
-    align: 'center',
-    dataIndex: 'money',
-    scopedSlots: { customRender: 'money' },
-    width: 67
-  }
+  
 ]
 
 const columns2 = [

+ 69 - 34
src/views/room/modules/checkIn/StrikeBalanceModel.vue

@@ -24,7 +24,7 @@
         {{ getSubjectTypeText(text, record) }}
       </template>
       <template slot="money" slot-scope="text, record">
-        <a-input-number v-model=record.money @blur="handleBlur()" :min="0"></a-input-number>
+        <a-input-number v-model='record.money' @blur="handleBlur()" :max="record.oldPrice" :min="0"></a-input-number>
       </template>
       <template slot="remark" slot-scope="text, record">
         <a-textarea v-model=record.remark></a-textarea>
@@ -45,11 +45,11 @@
         {{ record.money }}
       </template>
       <template slot="num" slot-scope="text, record">
-        <!-- {{  }} -->
-        <a-input-number v-model="record.num" :min="1" :max="record.feeGoodVo.num"></a-input-number>
-        <!-- {{ record.feeGoodVo.num }} -->
+        <a-input-number v-model="record.num" :min="1" :max="record.feeGoodVo.num" @change="changeValue(record)"></a-input-number>
+      </template>
+      <template slot="money" slot-scope="text, record">
+        <a-input-number v-model=record.money @blur="handleBlur()" :max="record.oldPrice" :min="0"></a-input-number>
       </template>
-      
       <template slot="remark" slot-scope="text, record">
         <a-textarea v-model=record.remark></a-textarea>
       </template>
@@ -83,7 +83,7 @@ const columns = [
   {
     title: '金额',
     dataIndex: 'oldPrice',
-    width: 60,
+    width: 40,
     align: 'center'
   },
   {
@@ -169,7 +169,7 @@ export default {
   data() {
     return {
       title: '',
-      width: 800,
+      width: 1000,
       visible: false,
       disableSubmit: false,
       showYinshou: true,
@@ -182,7 +182,12 @@ export default {
     }
   },
   methods: {
-
+    // 冲账数量变化
+    changeValue(val) {
+      console.log(val);
+      let tempvalue = val.oldPrice / val.feeGoodVo.num * val.num
+      return val.money = tempvalue
+    },
     edit(record, map) {
       this.visible = true
       console.log(record)
@@ -199,10 +204,12 @@ export default {
       this.feesList.forEach(e => {
         e.roomName = map.get(e.roomId)
         e.oldPrice = e.money
+        e.money = 0
       })
       this.productList.forEach(e => {
         e.roomName = map.get(e.roomId)
         e.oldPrice = e.money
+        e.money = 0
         let tempnum = JSON.parse(JSON.stringify(e.feeGoodVo))
         this.$set(e,'num',tempnum.num)
       })
@@ -214,35 +221,63 @@ export default {
       this.visible = false
     },
     handleOk() {
-      // console.log(111);
-      let fees = []
-      if (this.feesList.some(e => e.money > e.oldPrice || e.money < 0)) {
-        this.$message.warning('冲账金额不能超过原金额,且不能小于0')
-        return
-      } 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)
+      if (this.tebdata == 'default') {
+        let productfees = []
+        if (this.productList.some(e => e.money > e.oldPrice || e.money < 0)) {
+          this.$message.warning('冲账金额不能超过原金额,且不能小于0')
+          return
+        } else {
+          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)
+            }
+          })
+        }
+        if (productfees.length === 0) {
+          return
+        }
+        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('冲账失败')
           }
-        })
-      }
-      if (fees.length === 0) {
-        return
-      }
-      console.log(fees);
-      postAction('/business/busOrderFee/strike-balance', fees).then(resp => {
-        if (resp.result === true) {
-          this.$message.success('冲账成功')
-          this.$emit('ok')
-          this.visible = false
+        });
+      } else {
+        let fees = []
+        if (this.feesList.some(e => e.money > e.oldPrice || e.money < 0)) {
+          this.$message.warning('冲账金额不能超过原金额,且不能小于0')
+          return
         } else {
-          this.$message.warning('冲账失败')
+          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)
+            }
+          })
         }
-      });
+        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()

+ 16 - 6
src/views/room/modules/fangtaiModal/exchangeHouses/exchangeHousesForm.vue

@@ -12,6 +12,10 @@
             rowKey="id"
             :columns="columns"
             :dataSource="tableData">
+            <template slot="arrivalTime" slot-scope="text, record, index">
+                <!-- {{ getSubjectTypeText(text,record) }} -->
+                {{ handleDateFromat(record.arrivalTime) + '—' + handleDateFromat(record.dueOutTime) }}
+              </template>
           </a-table>
           <a-form-model ref="form" :model="model" slot="detail">
             <a-row>
@@ -194,11 +198,11 @@ const columns = [
     // scopedSlots: { customRender: 'roomId' }
   },
   {
-    title: '抵时间',
+    title: '抵时间',
     dataIndex: 'arrivalTime',
-    width: 120,
-    align: 'center'
-    // scopedSlots: { customRender: 'roomId' }
+    width: 180,
+    align: 'center',
+    scopedSlots: { customRender: 'arrivalTime' }
   }
 ]
 
@@ -346,6 +350,12 @@ export default {
         })
     },
     methods: {
+      // 处理日期
+        handleDateFromat(val) {
+          let str  = val.substr(5, 5)
+          console.log(str);
+          return str
+        },
         plus() {
           // var sum = this.payList.reduce(function (total, item) {
           //   return total + item.money
@@ -552,8 +562,8 @@ export default {
               marketPrice: record.layout.marketPrice,
               layoutName: record.layout.name,
               customerName: record.livingData.livingCustomers.customerName,
-              arrivalTime: record.livingData.livingOrder.arrivalTime
-
+              arrivalTime: record.livingData.livingOrder.arrivalTime,
+              dueOutTime: record.livingData.livingOrder.dueOutTime
             }]
             this.model = Object.assign({}, record)
             this.loadData()

+ 8 - 89
src/views/settings/components/roomModules/modules/housePriceSchemeLayout/housePriceSchemeLayoutForm.vue

@@ -36,66 +36,12 @@
     <a-modal v-model="visibleMoney" title="修改房价" @ok="handleOk">
       <a-input-number style="width: 100%;margin: auto" v-model="updateMoney" />
     </a-modal>
-  <!-- </div> -->
   <a-table :columns="columns" :alert="true" :data-source="calendarData" :rowKey="(record, index) => index + 1">
-    <!-- 111 -->
-    <!-- <template slot="layoutName" slot-scope="text, record">
-      <a-button type="primary">Primary Button</a-button>
-    </template> -->
-    <!-- <div slot-scope="text, record" v-for="item in columns"> -->
     <template v-for="item in columns" :slot="item.dataIndex" slot-scope="text, record">
-      <!-- {{  }} -->
       <div :class="isWeekend(new Date(item.dataIndex)) ? 'cell_style' : 'cell_stylez'" @click="editPrice(record,item,record[item.dataIndex])">
-      <!-- <div class="cell_style"> -->
         {{ record[item.dataIndex] }}
-        <!-- <a-button block></a-button>  -->
       </div>
-      <!-- <a-button type="primary">Primary Button</a-button> -->
     </template>
-    <!-- </div> -->
-      <!-- <template slot-scope="text, record">
-         -->
-          <!-- 111 -->
-          <!-- <template :slot="item.dataIndex" slot-scope="text, record">
-            111
-          </template> -->
-          <!-- {{ record[index] }}111 -->
-          <!-- {{ record[index] = 1 }} -->
-          
-        <!-- <template :slot="record[index]" slot-scope="text, record">
-          {{ record[index] }}
-        </template>
-        <template :slot="record[index]" slot-scope="text, record">
-          {{ record[index] }}
-        </template>
-        <template :slot="record[index]" slot-scope="text, record">
-          {{ record[index] }}
-        </template> -->
-      <!-- </div>
-      </template> -->
-      <!-- <template slot-scope="scopes">
-        {{ calendarData }}
-        <div v-for="item in scopes">
-          
-        </div>
-      </template> -->
-    
-      
-      <!-- {{ record.dataIndex }} -->
-       <!-- <div>
-            111
-        </div> -->
-        <!-- <el-dialog
-    title="提示"
-    :visible.sync="visibleMoney"
-    width="30%"
-    :before-close="handleClose">
-    <span>这是一段信息</span>
-    <span slot="footer" class="dialog-footer">
-      <el-button @click="visibleMoney = false">取 消</el-button>
-      <el-button type="primary" @click="visibleMoney = false">确 定</el-button>
-    </span>
-  </el-dialog> -->
   </a-table>
 </div>
 </template>
@@ -238,6 +184,14 @@
       // 获取数据
       async getDateList() {
         console.log(this.dataSource);
+        this.columns = [
+          {
+            title: '房型',
+            dataIndex: 'layoutName',
+            scopedSlots: { customRender: 'layoutName' }
+          }
+        ]
+        this.calendarData = []
         await getAction('/business/busHousePriceSchemeLayout/layoutPricePage', {
           pageNo: 1,
           pageSize: 10,
@@ -251,65 +205,30 @@
             tmeplist[0].schemeLayoutDailyPriceList.forEach(index => {
               let tempindex = {
                 title: index.date,
-                // schemeLayoutId: schemeLayoutId,
                 dataIndex: index.date,
                 align: 'center',
-                // key: 'key',
-                // customCell: (record) => {
-                //   for (let item in record) {
-                //     const d1 = new Date(item);
-                //     let tempcolor = this.isWeekend(d1)
-                //     console.log(tempcolor);
-                //     if (tempcolor) {
-                //       return {
-                //         style:{
-                //           color:'red'
-                //         }
-                //       }
-                //     }
-                //   }
-                // }
                 'scopedSlots': { 'customRender': index.date }
-                // customRender(text, record) {
-                //     // return record.layoutPrice
-                //     record.forEach(item => {
-
-                //     })
-                // }
-                // const d1 = new Date(item);
-                  // let tempcolor = this.isWeekend(d1)
               }
               tempcol.push(tempindex)
             });
-            // console.log(tempcol);
             this.columns = this.columns.concat(tempcol)
-            // console.log(this.columns);
             let temprol = []
             tmeplist.forEach(item => {
               console.log(item);
               // let 
               let tempindex = {}
               item.schemeLayoutDailyPriceList.forEach(index => {
-                // var tempdate = index.date
-                // tempindex = {
                   tempindex[index.date] = index.money
                   tempindex['schemeLayoutId'] = index.schemeLayoutId
                   tempindex['layoutName'] = item.layoutName
                   tempindex['hotelId'] = item.hotelId
                   tempindex['id'] = item.id
-                  // tempdate: index.money,
-                  // dataIndex: ,
-                  // schemeLayoutId: index.schemeLayoutId
-                // }
               })
               temprol.push(tempindex)
             });
             console.log(temprol);
             console.log(this.columns);
             this.calendarData = temprol
-            // temprol.forEach(cust => [
-              
-            // ])
           }
         })
       },