DESKTOP-B78GIPM\admin 2 роки тому
батько
коміт
23109eb94f
1 змінених файлів з 25 додано та 15 видалено
  1. 25 15
      src/views/room/modules/checkIn/BillRoomForm.vue

+ 25 - 15
src/views/room/modules/checkIn/BillRoomForm.vue

@@ -611,8 +611,8 @@
                   :scroll="{ y: 200, x: 500 }"
                 >
                   <template slot="prefPrice" slot-scope="text, record, index">
-                    <div @click="onCellExpand(index)">
-                      {{text}}
+                    <div>
+                      {{text}}<a-icon @click="onCellExpand(index)" style="margin-left:10px;" type="edit" />
                     <!-- <editable-cell
                       :text="text"
                       
@@ -835,7 +835,7 @@
         </th>
         <th style="display:flex;flex-wrap:wrap;">
           <td v-for="(item, index) in editPriceData" :key="index">
-            <div>
+            <div style="text-align:center;">
               {{item.day}}
             </div>
             <div>
@@ -1065,22 +1065,31 @@ export default {
     editPriceData(){
       let arr = []
       arr.length = this.model.orderInfo.dayCount
-      
-      // model.orderInfo.arrivalTime2
-      // arr.forEach((ele,index)=>{
-      //   ele = {
-      //     day:this.addDate(this.model.orderInfo.arrivalTime2,index),
-      //     price:0
-      //   }
-      // })
       for (let i = 0; i < arr.length; i++) {
         arr[i] = {
           day:this.addDate(this.model.orderInfo.arrivalTime2,i),
-          price:0
+          price: this.model.roomPrices[this.editPriceIndex] && this.model.roomPrices[this.editPriceIndex].prefPrice || 0
         }
+        // if (this.model.roomPrices[this.editPriceIndex]
+        //  && this.model.roomPrices[this.editPriceIndex].editPriceTime
+        //  && this.model.roomPrices[this.editPriceIndex].editPriceTime.filter()
+         
+        //  ) {
+          
+        // }
       }
-      console.log(this.model.orderInfo.arrivalTime2);
-      console.log(arr);
+      // console.log(this.model.orderInfo.arrivalTime2);
+      // console.log(arr);
+      // arr.forEach((item,index)=>{
+      //   if(this.model.roomPrices[this.editPriceIndex] && this.model.roomPrices[this.editPriceIndex].editPriceTime && this.model.roomPrices[this.editPriceIndex].editPriceTime.filter((item2,index2)=>{
+      //     return item2.day == item.day
+      //   }).length==1){
+      //     arr[index].price = this.model.roomPrices.filter((item2,index2)=>{
+      //     return item2.day == item.day
+      //   })[0].prefPrice
+
+      //   }
+      // })
       this.PriceData = arr
       return arr
     },
@@ -1662,7 +1671,8 @@ export default {
           that.model.livingRoomDayPrices.push({
             livingType: 1,
             dayTime: t.editPriceTime? t.editPriceTime[b].toString() : dayTime,
-            price: t.editPrice? t.editPrice[b].toString() : t.prefPrice,
+            // price:  t.editPrice? t.editPrice[b].toString() : t.prefPrice,
+            price: ( t.editPrice && t.editPriceTime && t.editPriceTime[b]==dayTime ) ? t.editPrice[b].toString() : t.prefPrice,
             // dayTime: dayTime,
             // price: t.prefPrice,
             roomLayoutId: t.layoutId,