覃浩 2 jaren geleden
bovenliggende
commit
785d584f93

+ 21 - 18
src/views/room/modules/checkIn/BillRoomInfo.vue

@@ -1565,6 +1565,12 @@ export default {
         this.chooseLivingRoom = find
         console.log(this.model)
         console.log(find)
+        // this.loadStrikeDate()
+        this.strikeList.forEach(item => {
+          let tempindex = this.entiretyList.findIndex(index => index.id == item.returnFeeId)
+          console.log(this.tempindex);
+          this.entiretyList.splice(tempindex+1,0,item)
+        })
         this.$emit('changeLivingStatu', find.livingOrder.settleType !== 2)
       }
     },
@@ -1697,7 +1703,8 @@ export default {
           bookingOrderId: this.id
         }
       }
-      getAction(this.url.getBookingOrderInfo, obj).then((res) => {
+      await getAction(this.url.getBookingOrderInfo, obj).then((res) => {
+        console.log(res);
         if (res.success) {
           if (res.result.livingRoomIds.length > 1) {
             let index = res.result.livingRoomIds.findIndex(e => e.isMain === true)
@@ -1728,10 +1735,9 @@ export default {
           console.log(this.model);
           this.getWakeServiceData()
           this.getMessageData()
-          // 查询冲账账单
-          this.loadStrikeDate()
+          
           // 查询账单
-          getAction('/business/busRoomBookingOrders/living-fees', {
+        getAction('/business/busRoomBookingOrders/living-fees', {
             bookingOrderId: this.model.orderInfo.id,
             isAllFee: true
           }).then((res) => {
@@ -1759,6 +1765,8 @@ export default {
               }
             }
           })
+          // 查询冲账账单
+          this.loadStrikeDate()
           if (this.model.orderInfo.vipCustomerId) {
             this.getMemberCard()
           }
@@ -1766,9 +1774,10 @@ export default {
       })
     },
     // 获取冲账单
-    loadStrikeDate() {
-      getAction('/business/busOrderFee/strike-balance-page', { bookingOrderId: this.model.orderInfo.id })
+    async loadStrikeDate() {
+      await getAction('/business/busOrderFee/strike-balance-page', { bookingOrderId: this.model.orderInfo.id })
           .then(res => {
+            console.log(res);
             if (res.success) {
               //
               if (res.result && res.result.records.length > 0) {
@@ -1790,18 +1799,12 @@ export default {
                 //   })
                 // }
                 // 处理全部账单加上冲帐单
-                this.strikeList.forEach(item => {
-                  let tempindex = this.entiretyList.findIndex(index => index.id == item.returnFeeId)
-                  console.log(this.tempindex);
-                  this.entiretyList.splice(tempindex+1,0,item)
-                  // this.entiretyList.forEach(index => {
-                    // if (item.returnFeeId == index.id) {
-                    //   let tempindex = this.entiretyList.indexOf(index)
-                    //   console.log(tempindex);
-                    //   this.entiretyList.splice(tempindex,0,item)
-                    // }
-                  // })
-                })
+                // console.log(this.entiretyList);
+                // this.strikeList.forEach(item => {
+                //   let tempindex = this.entiretyList.findIndex(index => index.id == item.returnFeeId)
+                //   console.log(this.tempindex);
+                //   this.entiretyList.splice(tempindex+1,0,item)
+                // })
                 //   // if (item == this.entiretyList.find(index => index.id = item.returnFeeId)) {
                 //     templist.push(this.entiretyList.find(index => index.id = item.returnFeeId),item)
                   // }

+ 7 - 3
src/views/settings/components/roomModules/modules/housePriceSchemeDetailList.vue

@@ -52,7 +52,7 @@
                     </a-button>
                 </template>
 
-                <span slot="action" slot-scope="text, record">
+                <span slot="action" slot-scope="text, record" class="operationBtn_style">
                     <a @click="handleReset(record)">重置</a>
                     <a @click="handleMoney(record)">房价日历</a>
                 </span>
@@ -183,7 +183,7 @@
                         dataIndex: 'action',
                         align:"center",
                         fixed:"right",
-                        width:147,
+                        width:180,
                         scopedSlots: { customRender: 'action' }
                     }
                 ],
@@ -430,5 +430,9 @@
 </script>
 
 <style scoped>
-
+.operationBtn_style {
+    display: flex;
+    justify-content: space-between;
+    padding: 0 25px;
+}
 </style>

+ 182 - 11
src/views/settings/components/roomModules/modules/housePriceSchemeLayout/housePriceSchemeLayoutForm.vue

@@ -12,7 +12,12 @@
 <!--      </div>-->
 <!--    </template>-->
 <!--  </a-calendar>-->
-  <div>
+<!--        <ul class="events">-->
+          <!--          <li v-for="item in getListData(value)" :key="item.content">-->
+          <!--            <a-badge :status="'success'" :text="item.classify_rname +'('+item.num+')'" />-->
+          <!--          </li>-->
+          <!--        </ul>-->
+  <!-- <div>
     <a-calendar style="background: #fff" @select="handleSelecrt" @panelChange="onPanelChange" :header-render="headerRender">
       <div slot="dateFullCellRender" slot-scope="value" class="ant-fullcalendar-date" :class="{'ant-fullcalendar-date-has-content':getListData(value).length>0}">
         <div class="ant-fullcalendar-value">{{getCaledarDate(value)}}</div>
@@ -22,19 +27,65 @@
               {{item.content}}
             </a-button>
           </div>
-          <!--        <ul class="events">-->
-          <!--          <li v-for="item in getListData(value)" :key="item.content">-->
-          <!--            <a-badge :status="'success'" :text="item.classify_rname +'('+item.num+')'" />-->
-          <!--          </li>-->
-          <!--        </ul>-->
+          
         </div>
       </div>
-    </a-calendar>
+    </a-calendar> -->
 
     <a-modal v-model="visibleMoney" title="修改房价" @ok="handleOk" :width="300">
       <a-input-number style="width: 100%;margin: auto" v-model="updateMoney" :min="0" :precision="2" />
     </a-modal>
-  </div>
+  <!-- </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'">
+      <!-- <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> -->
+    
+  </a-table>
 </template>
 
 <script>
@@ -59,6 +110,15 @@
     },
     data () {
       return {
+        columns: [
+          {
+            title: '房型',
+            dataIndex: 'layoutName',
+            scopedSlots: { customRender: 'layoutName' }
+          }
+        ],
+        // 表格数据
+        calendarData: [],
         labelCol: {
           xs: { span: 24 },
           sm: { span: 5 },
@@ -131,26 +191,126 @@
           }
         });
       })
-      this.getDateList()
+      // this.getDateList()
     },
     methods: {
+      // 修改价格
+      // editPrice(record,item) {
+      //   console.log(record);
+      //   console.log(item);
+      //   this.visibleMoney = true
+      // },
       // 获取数据
-      getDateList() {
+      async getDateList() {
         console.log(this.dataSource);
-        getAction('/business/busHousePriceSchemeLayout/layoutPricePage', {
+        await getAction('/business/busHousePriceSchemeLayout/layoutPricePage', {
           pageNo: 1,
           pageSize: 10,
           schemeId: this.model.schemeId
         }).then(res => {
           console.log(res);
+          if (res.success) {
+            let tmeplist = res.result.records
+            let tempcol = []
+            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
+                  // tempdate: index.money,
+                  // dataIndex: ,
+                  // schemeLayoutId: index.schemeLayoutId
+                // }
+              })
+              temprol.push(tempindex)
+            });
+            console.log(temprol);
+            console.log(this.columns);
+            this.calendarData = temprol
+            // temprol.forEach(cust => [
+              
+            // ])
+          }
         })
       },
+      // 处理周末
+      isWeekend(date = new Date()) {
+        return date.getDay() === 6 || date.getDay() === 0;
+      },
+      // // 处理周末
+      // exitCustomRow(record, index) {
+      //   console.log(record);
+      //   for (let item in record) {
+      //     console.log(item);
+      //     const d1 = new Date(item);
+      //     let tempcolor = this.isWeekend(d1)
+      //     // console.log(this.isWeekend(d1));
+      //     console.log(tempcolor);
+      //     if (this.isWeekend(d1)) {
+      //       // console.log(123);
+      //       return 'table-color-dust'
+      //     }
+      //     // if (!this.isWeekend(d1)) {
+      //     //   // console.log(123);
+      //     //   return {
+      //     //     style: {
+      //     //       background: 'red',
+      //     //     },
+      //     //   }
+      //     // }
+      //   }
+      //   console.log(index);
+      // },
       edit (record) {
         console.log(record);
         this.model = Object.assign({}, record);
         this.visible = true;
         this.schemeLayoutId = record.id
+        this.getDateList()
       },
+      
       handleMoney(e,value,item){
         var _time = moment(new Date(value)).format('YYYY-MM-DD 00:00:00')
         this.visibleMoney = true
@@ -472,4 +632,15 @@
     letter-spacing: 5px;
     font-weight: bold;
   }
+  .table-color-dust {
+    background-color: #F5222D;
+  }
+  .cell_style {
+    color: red !important;
+    /* color: #f6de90; */
+  }
+  .cell_stylez {
+    color: #000 !important;
+  }
+
 </style>

+ 1 - 1
src/views/settings/components/roomModules/modules/housePriceSchemeLayout/housePriceSchemeLayoutModal.vue

@@ -24,7 +24,7 @@
     data () {
       return {
         title:'',
-        width:1000,
+        width:1400,
         visible: false,
         disableSubmit: false
       }