소스 검색

修改房价方案。修改添加消费

许智捷 2 년 전
부모
커밋
3c2cf69e94

+ 0 - 1
src/views/report/room/sellCollect.vue

@@ -93,7 +93,6 @@ export default {
               children: child,
               attrs: {}
             }
-            console.log(this.mergeCells(text, this.goodDate, 'placeName', index), index)
             obj.attrs.rowSpan = this.mergeCells(text, this.goodDate, 'placeName', index)
             return obj
           },

+ 591 - 195
src/views/room/modules/checkIn/BillRoomForm.vue

@@ -364,65 +364,296 @@
                 </a-col>
                 <a-col :span="12">
                   <a-form-model-item
-                    label="订单来源"
-                    :labelCol="labelCol"
-                    :wrapperCol="wrapperCol"
-                    prop="orderInfo.customerSource"
+                      label="房价方案"
+                      :labelCol="labelCol"
+                      :wrapperCol="wrapperCol"
+                      prop="orderInfo.roomPriceSlnId"
                   >
                     <a-select
-                      placeholder="订单来源"
-                      v-model="model.orderInfo.customerSource"
-                      @change="customerSourceChange"
+                        v-if="model.orderInfo.bookingType !== 5"
+                        placeholder="房价方案"
+                        v-model="model.orderInfo.roomPriceSlnId"
+                        @change="roomPriceChange"
                     >
+                      <a-select-option value="0">平日价</a-select-option>
                       <a-select-option
-                        :value="item.id"
-                        v-for="(item, index) in customerSourceList"
-                        :key="item.id"
+                          :value="item.id"
+                          v-for="(item, index) in housePriceSchemeList"
+                          :key="item.id"
                       >
-                        {{ item.itemText }}
+                        {{ item.priceScheme }}
                       </a-select-option>
                     </a-select>
-                  </a-form-model-item>
-                </a-col>
-                <a-col :span="12" v-if="model.orderInfo.bookingType == 2">
-                  <a-form-model-item
-                    label="时长"
-                    :labelCol="labelCol"
-                    :wrapperCol="wrapperCol"
-                    prop="orderInfo.hourRoomId"
-                  >
                     <a-select
-                      placeholder="时长"
-                      v-model="model.orderInfo.hourRoomId"
-                      @change="hourRoomIdChange"
+                        v-else
+                        placeholder="房价方案"
+                        @change="longRentChange"
                     >
                       <a-select-option
-                        :value="item.id"
-                        v-for="(item, index) in hourRoomRuleList"
-                        :key="item.id"
+                          :value="item.id"
+                          v-for="(item, index) in longRentSchemeList"
+                          :key="item.id"
                       >
-                        {{ item.hourRoomName }}
+                        {{ item.name }}
                       </a-select-option>
                     </a-select>
                   </a-form-model-item>
                 </a-col>
-                <a-col :span="12" v-else>
-                  <a-form-model-item
-                    label="天数"
-                    :labelCol="labelCol"
-                    :wrapperCol="wrapperCol"
-                    prop="orderInfo.dayCount"
-                  >
-                    <a-input-number
-                      v-model="model.orderInfo.dayCount"
-                      placeholder="天数"
-                      :min="1"
-                      @change="dayCountChange"
-                    ></a-input-number
-                    >天
-                  </a-form-model-item>
+                <a-col :span="12">
+                  <div>
+                    <a-col :span="24">
+                      <a-form-model-item
+                          label="订单来源"
+                          :labelCol="labelCol"
+                          :wrapperCol="wrapperCol"
+                          prop="orderInfo.customerSource"
+                      >
+                        <a-select
+                            placeholder="订单来源"
+                            v-model="model.orderInfo.customerSource"
+                            @change="customerSourceChange"
+                        >
+                          <a-select-option
+                              :value="item.id"
+                              v-for="(item, index) in customerSourceList"
+                              :key="item.id"
+                          >
+                            {{ item.itemText }}
+                          </a-select-option>
+                        </a-select>
+                      </a-form-model-item>
+                    </a-col>
+
+                    <a-col :span="24" v-if="model.orderInfo.bookingType == 2">
+                      <a-form-model-item
+                          label="时长"
+                          :labelCol="labelCol"
+                          :wrapperCol="wrapperCol"
+                          prop="orderInfo.hourRoomId"
+                      >
+                        <a-select
+                            placeholder="时长"
+                            v-model="model.orderInfo.hourRoomId"
+                            @change="hourRoomIdChange"
+                        >
+                          <a-select-option
+                              :value="item.id"
+                              v-for="(item, index) in hourRoomRuleList"
+                              :key="item.id"
+                          >
+                            {{ item.hourRoomName }}
+                          </a-select-option>
+                        </a-select>
+                      </a-form-model-item>
+                    </a-col>
+                    <a-col :span="24" v-else>
+                      <a-form-model-item
+                          label="天数"
+                          :labelCol="labelCol"
+                          :wrapperCol="wrapperCol"
+                          prop="orderInfo.dayCount"
+                      >
+                        <a-input-number
+                            v-model="model.orderInfo.dayCount"
+                            placeholder="天数"
+                            :min="1"
+                            @change="dayCountChange"
+                        ></a-input-number
+                        >天
+                      </a-form-model-item>
+                    </a-col>
+                    <a-col :span="24">
+                      <a-form-model-item
+                          label="入住时间"
+                          :labelCol="labelCol"
+                          :wrapperCol="wrapperCol"
+                          prop="orderInfo.arrivalTime2"
+                      >
+                        <j-date
+                            placeholder="入住时间"
+                            v-model="model.orderInfo.arrivalTime2"
+                            style="width: 120px"
+                            :allowClear="false"
+                            :disabled-date="disabledDate"
+                            @change="arrivalTimeChange"
+                        />
+                        <a-time-picker
+                            style="width: 80px; margin-left: 2px"
+                            v-model="model.orderInfo.arrivalTimeSpan"
+                            :default-value="moment('12:00', 'HH:mm')"
+                            format="HH:mm"
+                            :allowClear="false"
+                            @change="arrivalTimeSpanChange"
+                        />
+                      </a-form-model-item>
+                    </a-col>
+                    <a-col :span="24">
+                      <a-form-model-item
+                          label="预离时间"
+                          :labelCol="labelCol"
+                          :wrapperCol="wrapperCol"
+                          prop="orderInfo.dueOutTime2"
+                      >
+                        <j-date
+                            placeholder="预离时间"
+                            v-model="model.orderInfo.dueOutTime2"
+                            style="width: 120px"
+                            :allowClear="false"
+                            :disabled-date="disabledDate"
+                            :disabled="model.orderInfo.bookingType === 2"
+                            @change="arrivalTimeChange2"
+                        />
+                        <a-time-picker
+                            style="width: 80px; margin-left: 2px"
+                            v-model="model.orderInfo.dueOutTimeSpan"
+                            format="HH:mm"
+                            :allowClear="false"
+                            :disabled="true"
+                        />
+                      </a-form-model-item>
+                    </a-col>
+                    <a-col :span="24">
+                      <a-form-model-item
+                          label="销售员工"
+                          :labelCol="labelCol"
+                          :wrapperCol="wrapperCol"
+                          prop="orderInfo.warranter"
+                      >
+                        <a-select
+                            placeholder="销售员工"
+                            v-model="model.orderInfo.warranter"
+                        >
+                          <a-select-option
+                              :value="item.id"
+                              v-for="item in warranterList"
+                              :key="item.id"
+                          >
+                            {{ item.name }}
+                          </a-select-option>
+                        </a-select>
+                      </a-form-model-item>
+                    </a-col>
+                    <a-col :span="24">
+                      <a-form-model-item
+                          label="订单备注"
+                          :labelCol="labelCol"
+                          :wrapperCol="wrapperCol"
+                          prop="orderInfo.remark"
+                      >
+                        <a-textarea
+                            v-model="model.orderInfo.remark"
+                            rows="4"
+                            placeholder="订单备注"
+                        />
+                      </a-form-model-item>
+                    </a-col>
+                  </div>
                 </a-col>
+                <!-- 长租房房价方案start -->
                 <a-col :span="12">
+                  <div v-if="model.orderInfo.bookingType === 5">
+                    <a-form-model-item
+                        label="租金标准"
+                        :labelCol="labelCol"
+                        :wrapperCol="wrapperCol"
+                        prop="">
+                      <a-col :span="7">
+                        <a-input-number v-model="rentCharges.money" :min="0" placeholder="输入金额" style="width: 100%"></a-input-number>
+                      </a-col>
+                      <a-col :span="2"><span>元/</span></a-col>
+                      <a-col :span="7">
+                        <a-input-number v-model="rentCharges.cycleNum" :min="0" placeholder="输入周期" style="width: 80%"></a-input-number>
+                      </a-col>
+                      <a-col :span="2"><span>月</span></a-col>
+
+                      <!--                      <a-col :span="6">-->
+                      <!--                        <a-select v-model="rentCharges.cycleUnit">-->
+                      <!--                          <a-select-option :value="1"> 月 </a-select-option>-->
+                      <!--                          <a-select-option :value="2"> 季 </a-select-option>-->
+                      <!--                          <a-select-option :value="3"> 年 </a-select-option>-->
+                      <!--                        </a-select>-->
+                      <!--                      </a-col>-->
+                    </a-form-model-item>
+                    <a-form-model-item
+                        label="押金金额"
+                        :labelCol="labelCol"
+                        :wrapperCol="wrapperCol"
+                        prop="">
+                      <a-col :span="10">
+                        <a-input-number v-model="depositCharges.money" :min="0" placeholder="输入金额" style="width: 70%"></a-input-number>
+                      </a-col>
+                      <a-col :span="2" v-if="depositCharges.isDepositCustom"><span>元</span></a-col>
+                    </a-form-model-item>
+
+                    <a-form-model-item
+                        label="押付方式"
+                        :labelCol="labelCol"
+                        :wrapperCol="wrapperCol"
+                        prop="orderInfo.roomPriceSlnId">
+                      <a-col :span="8">
+                        <a-select v-model="depositCharges.num" @change="depositNumChange">
+                          <a-select-option :value="1"> 押1 </a-select-option>
+                          <a-select-option :value="2"> 押2 </a-select-option>
+                          <a-select-option :value="3"> 押3 </a-select-option>
+                        </a-select>
+                      </a-col>
+                      <a-col :span="8">
+                        <a-select v-model="rentCharges.num" @change="rentNumChange">
+                          <a-select-option :value="1"> 付1 </a-select-option>
+                          <a-select-option :value="2"> 付2 </a-select-option>
+                          <a-select-option :value="3"> 付3 </a-select-option>
+                        </a-select>
+                      </a-col>
+                    </a-form-model-item>
+                    <a-form-model-item
+                        label="新增费项"
+                        :labelCol="labelCol"
+                        :wrapperCol="wrapperCol">
+                      <a-col :span="8">
+                        <a-select v-model="chargeType">
+                          <a-select-option :value="1"> 一次性费项 </a-select-option>
+                          <a-select-option :value="2"> 周期性费项 </a-select-option>
+                          <a-select-option :value="3"> 抄费类水费 </a-select-option>
+                          <a-select-option :value="4"> 抄费类电费 </a-select-option>
+                          <a-select-option :value="5"> 抄费类燃气费 </a-select-option>
+                        </a-select>
+                      </a-col>
+                      <a-col :span="3">
+                        <a-button @click="addCharges">添加</a-button>
+                      </a-col>
+                      <a-col :span="24">
+                        <a-row v-for="(item, index) in chooseLongRentScheme.houseLongRentChargeList" v-if="!item.isMust">
+                          <a-icon
+                              type="minus-circle"
+                              style="color: #f56c6c"
+                              class="dynamic-delete-button"
+                              @click="removeCharge(index)"
+                          />
+                          <a-col :span="5">
+                            <a-input v-model="item.name" placeholder="输入费项名称" style="width: 90%"></a-input>
+                          </a-col>
+                          <a-col :span="5">
+                            <a-input-number v-model="item.money":min="0" placeholder="输入金额" style="width: 90%" @change="$forceUpdate()"></a-input-number>
+                          </a-col>
+                          <a-col :span="4"><span>{{ item.chargeType == 3 ? '元/吨' : (item.chargeType == 4 ? '元/度' : '元') }}</span></a-col>
+                          <a-col :span="5" v-if="item.chargeType == 2">
+                            <a-input-number v-model="item.cycleNum" :min="0" placeholder="输入周期" style="width: 90%"></a-input-number>
+                          </a-col>
+                          <!--                          <a-col :span="5" v-if="item.chargeType == 2">-->
+                          <!--                            <a-select v-model="item.cycleUnit">-->
+                          <!--                              <a-select-option :value="1"> 月 </a-select-option>-->
+                          <!--                              <a-select-option :value="2"> 季 </a-select-option>-->
+                          <!--                              <a-select-option :value="3"> 年 </a-select-option>-->
+                          <!--                            </a-select>-->
+                          <!--                          </a-col>-->
+                        </a-row>
+
+                      </a-col>
+                    </a-form-model-item>
+                  </div>
+                </a-col>
+                <!-- 长租房房价方案end -->
+                <a-col :span="12" v-if="model.orderInfo.bookingType != 5">
                   <a-form-model-item
                     label="外部单号"
                     :labelCol="labelCol"
@@ -435,57 +666,7 @@
                     ></a-input>
                   </a-form-model-item>
                 </a-col>
-                <a-col :span="12">
-                  <a-form-model-item
-                    label="入住时间"
-                    :labelCol="labelCol"
-                    :wrapperCol="wrapperCol"
-                    prop="orderInfo.arrivalTime2"
-                  >
-                    <j-date
-                      placeholder="入住时间"
-                      v-model="model.orderInfo.arrivalTime2"
-                      style="width: 120px"
-                      :allowClear="false"
-                      :disabled-date="disabledDate"
-                      @change="arrivalTimeChange"
-                    />
-                    <a-time-picker
-                      style="width: 80px; margin-left: 2px"
-                      v-model="model.orderInfo.arrivalTimeSpan"
-                      :default-value="moment('12:00', 'HH:mm')"
-                      format="HH:mm"
-                      :allowClear="false"
-                      @change="arrivalTimeSpanChange"
-                    />
-                  </a-form-model-item>
-                </a-col>
-                <a-col :span="12">
-                  <a-form-model-item
-                    label="预离时间"
-                    :labelCol="labelCol"
-                    :wrapperCol="wrapperCol"
-                    prop="orderInfo.dueOutTime2"
-                  >
-                    <j-date
-                      placeholder="预离时间"
-                      v-model="model.orderInfo.dueOutTime2"
-                      style="width: 120px"
-                      :allowClear="false"
-                      :disabled-date="disabledDate"
-                      :disabled="model.orderInfo.bookingType === 2"
-                      @change="arrivalTimeChange2"
-                    />
-                    <a-time-picker
-                      style="width: 80px; margin-left: 2px"
-                      v-model="model.orderInfo.dueOutTimeSpan"
-                      format="HH:mm"
-                      :allowClear="false"
-                      :disabled="true"
-                    />
-                  </a-form-model-item>
-                </a-col>
-                <a-col :span="12">
+                <a-col :span="12" v-if="model.orderInfo.bookingType != 5">
                   <a-form-model-item
                     label="宾客类型"
                     :labelCol="labelCol"
@@ -625,51 +806,8 @@
                     </p>
                   </a-card>
                 </a-col>
-                <a-col :span="12">
-                  <a-form-model-item
-                    label="房价方案"
-                    :labelCol="labelCol"
-                    :wrapperCol="wrapperCol"
-                    prop="orderInfo.roomPriceSlnId"
-                  >
-                    <a-select
-                      placeholder="房价方案"
-                      v-model="model.orderInfo.roomPriceSlnId"
-                      @change="roomPriceChange"
-                    >
-                      <a-select-option value="0">平日价</a-select-option>
-                      <a-select-option
-                        :value="item.id"
-                        v-for="(item, index) in housePriceSchemeList"
-                        :key="item.id"
-                      >
-                        {{ item.priceScheme }}
-                      </a-select-option>
-                    </a-select>
-                  </a-form-model-item>
-                </a-col>
-                <a-col :span="12">
-                  <a-form-model-item
-                    label="销售员工"
-                    :labelCol="labelCol"
-                    :wrapperCol="wrapperCol"
-                    prop="orderInfo.warranter"
-                  >
-                    <a-select
-                      placeholder="销售员工"
-                      v-model="model.orderInfo.warranter"
-                    >
-                      <a-select-option
-                        :value="item.id"
-                        v-for="item in warranterList"
-                        :key="item.id"
-                      >
-                        {{ item.name }}
-                      </a-select-option>
-                    </a-select>
-                  </a-form-model-item>
-                </a-col>
-                <a-col :span="12">
+
+                <a-col :span="12" v-if="model.orderInfo.bookingType != 5">
                   <a-form-model-item
                     label="早餐数量"
                     :labelCol="labelCol"
@@ -684,23 +822,6 @@
                     >份
                   </a-form-model-item>
                 </a-col>
-                <a-col :span="24">
-                  <a-form-model-item
-                    label="订单备注"
-                    :labelCol="{ xs: { span: 24 }, sm: { span: 3 } }"
-                    :wrapperCol="{
-                      xs: { span: 24 },
-                      sm: { span: 15 },
-                    }"
-                    prop="orderInfo.remark"
-                  >
-                    <a-textarea
-                      v-model="model.orderInfo.remark"
-                      rows="4"
-                      placeholder="订单备注"
-                    />
-                  </a-form-model-item>
-                </a-col>
               </div>
               <div style="width: 43%;">
                 <div
@@ -724,7 +845,9 @@
                   </div>
                 </div>
                 <a-divider />
+                <!-- 账单-->
                 <a-table
+                  v-if="model.orderInfo.bookingType !== 5"
                   :columns="columns"
                   :data-source="model.roomPrices"
                   :pagination="false"
@@ -750,6 +873,17 @@
                     <a-input-number v-model="record.deposit" @change="onCellChangeCopy('deposit', index, $event)" :min="bookingPaidMoney == null ? 0 : bookingPaidMoney"></a-input-number>
                   </template>
                 </a-table>
+                <!-- 长租房账单-->
+                <a-table
+                  v-else
+                  :columns="longRentColumns"
+                  :data-source="chooseLongRentScheme.houseLongRentChargeList"
+                  :pagination="false"
+                  rowKey="id"
+                  :scroll="{ y: 200, x: 500 }"
+                  style=" height: auto"
+                >
+                </a-table>
                 <div
                   style="
                     color: rgba(255, 87, 51, 1);
@@ -759,23 +893,7 @@
                 >
                   合计应收:{{ amount.toFixed(2) }}
                 </div>
-                <div
-                  style="
-                    display: flex;
-                    justify-content: space-between;
-                    align-items: center;
-                    margin-top: 30px;
-                  "
-                >
-                  <!-- <h4
-                    style="
-                      color: rgba(255, 141, 26, 1);
-                      font-weight: 600;
-                      margin-top: 15px;
-                    "
-                  >
-                    收款
-                  </h4> -->
+                <div style=" display: flex; justify-content: space-between; align-items: center; margin-top: 30px; " >
                   <a-tabs
                     default-active-key="1"
                     @change="paymentTabsChange"
@@ -783,6 +901,7 @@
                   >
                     <a-tab-pane key="1" tab="收款">
                       <a-table
+                        v-if="model.orderInfo.bookingType !== 5"
                         :columns="columns2"
                         :data-source="model.orderFees"
                         :pagination="false"
@@ -848,6 +967,38 @@
                           </div>
                         </template>
                       </a-table>
+                      <a-table
+                        v-else
+                        :columns="longRentColumns2"
+                        :data-source="collectionChargeList"
+                        :pagination="false"
+                        rowKey="id"
+                        :scroll="{ y: 160 }"
+                        style=" height: auto">
+                        <template slot="payType" slot-scope="text, record, index" >
+                          <div>
+                            <a-select
+                              v-model="collectionChargeList[index].payType"
+                              placeholder="收款方式">
+                              <a-select-option
+                                :value="item.id"
+                                v-for="item in payTypeList"
+                                :key="item.id">
+                                {{ item.name }}
+                              </a-select-option>
+                            </a-select>
+                          </div>
+                        </template>
+                        <template slot="relMoney" slot-scope="text, record, index">
+                          <div>
+                            <a-input-number
+                              v-model="record.relMoney"
+                              :min="0"
+                              @change="presetNumChange($event, record)"
+                            />
+                          </div>
+                        </template>
+                      </a-table>
                       <div style="color: rgba(255, 141, 26, 1); font-weight: 200">
                         <p style="margin-bottom: 2px">
                           预定已收:{{ bookingPaidMoney }}
@@ -1063,6 +1214,76 @@ const columns = [
   }
 ]
 
+const longRentColumns = [
+  // {
+  //     title: "",
+  //     dataIndex: "key",
+  //     width: 20,
+  //   },
+  {
+    title: '费项',
+    dataIndex: 'name',
+    width: 70
+  },
+  {
+    title: '费用类型',
+    dataIndex: 'chargeType',
+    width: 80,
+    customRender(text, record) {
+      if (text === 1) {
+        return '一次性'
+      } else if (text === 2) {
+        return '周期性'
+      } else if (text === 3) {
+        return '水费'
+      } else if (text === 4) {
+        return '电费'
+      } else if (text === 5) {
+        return '燃气费'
+      }
+    }
+  },
+  {
+    title: '费用标准',
+    dataIndex: 'marketPrice',
+    width: 60,
+    customRender(text, record) {
+      let standard = ''
+      standard = record.money + '元'
+      if (record.cycleUnit === 1) {
+        standard += '/月'
+      } else if (record.cycleUnit === 1) {
+        standard += '/季'
+      } else if (record.cycleUnit === 1) {
+        standard += '/年'
+      }
+      return standard
+    }
+  }
+  // {
+  //   title: '优惠价',
+  //   dataIndex: 'prefPrice',
+  //   width: 80,
+  //   scopedSlots: { customRender: 'prefPrice' }
+  // },
+  // {
+  //   title: '天数',
+  //   dataIndex: 'day',
+  //   width: 50
+  // },
+  // {
+  //   title: '房费',
+  //   dataIndex: 'roomFee',
+  //   width: 60
+  // },
+  // {
+  //   title: '押金',
+  //   dataIndex: 'deposit',
+  //   scopedSlots: { customRender: 'deposit' },
+  //   width: 100
+  // }
+]
+
 const columns2 = [
   {
     title: '费项',
@@ -1089,6 +1310,31 @@ const columns2 = [
     scopedSlots: { customRender: 'money' }
   }
 ]
+const longRentColumns2 = [
+  {
+    title: '费项',
+    dataIndex: 'name',
+    width: '25%',
+  },
+  {
+    title: '收款方式',
+    dataIndex: 'payType',
+    width: '25%',
+    scopedSlots: { customRender: 'payType' }
+  },
+  {
+    title: '应缴',
+    dataIndex: 'payable',
+    width: '25%',
+    // scopedSlots: { customRender: 'prefPrice' }
+  },
+  {
+    title: '实收',
+    dataIndex: 'relMoney',
+    width: '25%',
+    scopedSlots: { customRender: 'relMoney' }
+  }
+]
 const date = new Date()
 const endDate = new Date(date.setDate(date.getDate() + 1))
 export default {
@@ -1133,8 +1379,10 @@ export default {
       selectedRowKeys: [],
       // data,
       columns,
+      longRentColumns,
       // data2,
       columns2,
+      longRentColumns2,
       wakeList: [{}],
       // model: { rooms: panes, data: data, data2: data2 },
       modelDefault: {},
@@ -1205,7 +1453,34 @@ export default {
       selectIndex: 0,
       customerSourceList: [],
       housePriceSchemeList: [],
-      cesAllDayPriceRule: {}, //全天房计费规则
+      /** 长租房start */
+      // 长租房方案
+      longRentSchemeList: [],
+      // 选中的方案
+      chooseLongRentScheme: {},
+      // 新增费项
+      // 新增时选择的费项类型
+      chargeType: 1,
+      // 收款费项
+      collectionChargeList: [],
+      // 租金费项
+      rentCharges: {
+        num: 0,
+        money: 0,
+        cycleUnit: 1,
+        cycleNum: 0,
+        chargeType: 0
+      },
+      // 押金费项
+      depositCharges: {
+        num: 0,
+        money: 0,
+        cycleUnit: 0,
+        chargeType: 0
+      },
+      longRentFee: [],
+      /** 长租房end */
+      cesAllDayPriceRule: {}, // 全天房计费规则
       bookingdicWayList: [],
       warranterList: [],
       hourRoomRuleList: [],
@@ -1341,7 +1616,6 @@ export default {
       }
     },
     'model.orderInfo.bookingType'(val, old) {
-
       if (val) {
         this.model.orderInfo.dayCount = this.daysBetween(this.model.orderInfo.arrivalTime2, this.model.orderInfo.dueOutTime2)
       }
@@ -1434,7 +1708,6 @@ export default {
       }
     },
     paymentSplit(value) {
-
       if (this.loadRemenmberPayState) {
         console.log(1111111, this.loadRemenmberPayState)
         if (!value) {
@@ -1486,6 +1759,38 @@ export default {
         }
       }
     },
+    'chooseLongRentScheme.houseLongRentChargeList': {
+        handler(newValue, oldValue) {
+          newValue.forEach((e,index) => {
+            this.$watch(
+                () => e.money,
+                (newName, oldName) => {
+                  let num = e.num == null ? 1 : e.num
+                  let payable = e.money * num
+                  e.payable = payable
+                  // this.$set(e,'relMoney', payable)
+                  e.relMoney = payable
+                }
+            );
+          })
+        },
+        deep: true, // 监听数组的变化需要设置 deep 为 true
+    },
+    // collectionChargeList: {
+    //
+    //     handler(newValue, oldValue) {
+    //       newValue.forEach((e,index) => {
+    //         this.$watch(
+    //             () => e.money,
+    //             (newName, oldName) => {
+    //               e.relMoney = e.money
+    //             }
+    //         );
+    //       })
+    //     },
+    //     deep: true, // 监听数组的变化需要设置 deep 为 true
+    // },
+
     // "model.roomIds": {
     //   handler(newValue, oldValue) {
     //     console.log(newValue, oldValue);
@@ -1493,7 +1798,6 @@ export default {
     //   deep: true,
     //   immediate: true,
     // },
-
     cPhone: {
       handler: function (val, old) {
         console.log(val, old)
@@ -1577,6 +1881,7 @@ export default {
         })
       }
     })
+
     //
     // getAction('/business/busHousePriceSchemeLayout/list?hotelId=' + this.model.hotelId, {}
     // ).then((res) => {
@@ -1706,6 +2011,59 @@ export default {
       })
       this.editPriceOk()
     },
+    // 房价方案改变事件
+    longRentChange(record) {
+      console.log(record, 'record')
+      this.chooseLongRentScheme = this.longRentSchemeList.find(e => e.id === record)
+      if (this.chooseLongRentScheme == null) {
+        return
+      }
+      // 押金
+      this.depositCharges = this.chooseLongRentScheme.houseLongRentChargeList.find(e => e.chargeType === 1 && e.isMust)
+      // 租金
+      this.rentCharges = this.chooseLongRentScheme.houseLongRentChargeList.find(e => e.chargeType === 2 && e.isMust)
+      this.collectionChargeList = this.chooseLongRentScheme.houseLongRentChargeList.filter(e => e.chargeType !== 3 && e.chargeType !== 4 && e.chargeType !== 5)
+      console.log(this.depositCharges)
+      console.log(this.rentCharges, 'rentCharges')
+      console.log(this.model.orderFees, 'orderFees')
+    },
+    depositNumChange(value) {
+      let payable = this.depositCharges.money * this.depositCharges.num
+      this.depositCharges.relMoney = payable
+      this.depositCharges.payable = payable
+    },
+    rentNumChange(value) {
+      let payable = this.rentCharges.money * this.rentCharges.num
+      this.rentCharges.relMoney = payable
+      this.rentCharges.payable = payable
+    },
+    addCharges() {
+      if (this.chargeType == null) {
+        this.$message.warning('请先选择要添加的费项')
+        return
+      }
+      let charge = {
+        name: null,
+        chargeType: this.chargeType,
+        money: null,
+        cycleUnit: null,
+        payType: this.payTypeList[0].id
+      }
+      this.chooseLongRentScheme.houseLongRentChargeList.push(charge)
+      if (charge.chargeType === 1 || charge.chargeType === 2) {
+        this.collectionChargeList.push(charge)
+      }
+      this.$forceUpdate()
+    },
+    /** 移除新增费项目 */
+    removeCharge(index) {
+      console.log(index, 'index')
+      let findIndex = this.collectionChargeList.findIndex(e => e === this.chooseLongRentScheme.houseLongRentChargeList[index])
+      if (findIndex !== -1) {
+        this.collectionChargeList.splice(findIndex, 1)
+      }
+      this.chooseLongRentScheme.houseLongRentChargeList.splice(index, 1)
+    },
     // 还原价格
     restorePrice() {
       this.editPriceData.forEach((e) => {
@@ -1742,7 +2100,7 @@ export default {
       this.model.orderInfo.contractTeamProtocolId = null
       this.model.orderInfo.contractTeamId = null
       console.log(value)
-      if (value === 1){
+      if (value === 1) {
         this.changeRoomPrice(100)
       }
     },
@@ -1992,7 +2350,6 @@ export default {
               }
             }
           } else {
-
             var find = orderFees.find(
                 (t) => t.subjectType == 2 && t.roomId == this.model.roomIds[0].id
             )
@@ -2818,6 +3175,7 @@ export default {
       if (!this.remenmberPayState) {
         await this.getHotelInfo()
       }
+      await this.loadScheme()
       if (this.customerSourceList) {
         if (!this.model.orderInfo.customerSource) {
           this.model.orderInfo.customerSource = this.customerSourceList[0].id
@@ -3031,25 +3389,45 @@ export default {
         }
       )
     },
+    // 获取长租方案
+    loadScheme(){
+      getAction('rooms/cesHouseLongRentScheme/page', {}
+      ).then((res) => {
+        if (res.success && res.result.records.length > 0) {
+          this.longRentSchemeList = res.result.records
+          this.longRentSchemeList.forEach(e => {
+            e.houseLongRentChargeList.forEach(ele => {
+              let num = ele.num == null ? 1 : ele.num
+              let payable = ele.money * num
+              this.$set(ele,'payable', payable)
+              this.$set(ele,'relMoney', payable)
+              this.$set(ele,'payType', this.payTypeList[0].id)
+            })
+          })
+        }
+      })
+    },
     submitForm() {
       const that = this
       that.model.livingRoomDayPrices = []
       console.log('that.model.roomPrices', that.model.roomPrices)
-      that.model.roomPrices.forEach((t) => {
-        for (var b = 0; b < that.model.orderInfo.dayCount; b++) {
-          var dayTime = moment(this.model.orderInfo.arrivalTime2)
-            .add(b, 'days')
-            .format('YYYY-MM-DD')
+      console.log('that.model.roomPrices', that.model.orderFees)
+      if (this.model.orderInfo.bookingType !== 5) {
+        that.model.roomPrices.forEach((t) => {
+          for (var b = 0; b < that.model.orderInfo.dayCount; b++) {
+            var dayTime = moment(this.model.orderInfo.arrivalTime2)
+                .add(b, 'days')
+                .format('YYYY-MM-DD')
             console.log(t.editPriceTime)
             if (t.editPriceTime && t.editPriceTime[b]) {
-                that.model.livingRoomDayPrices.push({
+              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.editPriceTime && t.editPriceTime[b] == dayTime
-                    ? t.editPrice[b].toString()
-                    : t.prefPrice,
+                    t.editPrice && t.editPriceTime && t.editPriceTime[b] == dayTime
+                        ? t.editPrice[b].toString()
+                        : t.prefPrice,
                 // dayTime: dayTime,
                 // price: t.prefPrice,
                 roomLayoutId: t.layoutId,
@@ -3068,23 +3446,41 @@ export default {
                 roomId: t.roomId
               })
             }
-        }
-      })
+          }
+        })
+      } else {
+        let chargeList = []
+        this.collectionChargeList.forEach(e => {
+          let subjectType = null
+          if (e.isMust) {
+            subjectType = e.chargeType
+          } else if (e.chargeType === 3 || e.chargeType === 4 || e.chargeType === 5) {
+            subjectType = 12
+          } else {
+            subjectType = 14
+          }
+          let charge = {
+            money: e.relMoney,
+            payType: e.payType,
+            remark: e.name,
+            subjectType: subjectType,
+            roomId: this.model.roomIds[0].id
+          }
+          chargeList.push(charge)
+        })
+        that.model.orderFees = chargeList
+      }
+
       // let arr = JSON.parse(JSON.stringify(that.model.roomIds))
       that.model.roomIds.forEach((t) => {
-        console.log(t)
-        console.log(that.model.roomPrices.findIndex((item) => item.roomId == t.id))
         let info = {}
-        let idx = that.model.roomPrices.findIndex((item) => item.roomId == t.id)
         info = JSON.parse(JSON.stringify(that.model.orderInfo))
         console.log(info, 'info')
-        // 第一行不知道干嘛的,不过加上会导致钟点房的居住订单的预离时间多一天
-        // info.dueOutTime = that.addDate(info.arrivalTime2, that.model.roomPrices[idx].day) + ' ' + moment(that.model.orderInfo.dueOutTimeSpan).format('HH:mm')
-        // info.dueOutTime = that.model.roomPrices[idx].editPriceTime[that.model.roomPrices[idx].editPriceTime.length-1] + " " + moment(that.model.orderInfo.dueOutTimeSpan).format("HH:mm")
         info.dueOutTime = moment(this.model.orderInfo.dueOutTime2).format('yyyy-MM-DD') + ' ' + moment(that.model.orderInfo.dueOutTimeSpan).format('HH:mm')
         t.roomOrderInfo = info
         t.roomOrderInfo.customerSource = t.customerSource
         t.roomId = t.id
+        t.longRentScheme = this.chooseLongRentScheme
         var obj = {
           certNo: t.key4,
           certType: 1,

+ 52 - 66
src/views/room/modules/checkIn/BillRoomInfo.vue

@@ -616,7 +616,7 @@
           :scroll="{ y: 160 }"
         >
           <template slot="payType" slot-scope="text, record, index">
-            {{ getPayTypeText(text) }}{{ record.preferentialStatus === 2 ? '结' : '未' }}
+            {{ getPayTypeText(text) }}
           </template>
           <template slot="subjectType" slot-scope="text, record, index">
             {{ getSubjectTypeText(record.subjectType,record) }}
@@ -1132,7 +1132,7 @@ export default {
       return this.disabled
     },
     feesAmount() {
-      return this.entiretyAmount.reduce(function (total, item) {
+      return this.entiretyList.filter(e => !e.returnItem).reduce(function (total, item) {
         return total + item.money
       }, 0)
     },
@@ -1733,6 +1733,8 @@ export default {
         msg = '赔偿费'
       } else if (text == 13) {
         msg = record.remark
+      } else if (text == 14) {
+        msg = record.remark
       }
       return msg
     },
@@ -1998,20 +2000,35 @@ export default {
           return
         }
       }
-      var livingOrderId = ''
-      if (livingRoom.roomId != '1') {
-        livingOrderId = livingRoom.livingOrder.id
+      if (livingRoom.roomId !== '1' && !livingRoom.isMain) {
+        this.$confirm({
+          title: '提示',
+          content: '是否团队结账?',
+          onOk: function () {
+            that.tabSelectRoomId = '1'
+            that.tabChange('1')
+            that.settle(livingRoom)
+          },
+          onCancel: function () {
+            that.settle(livingRoom)
+          }
+        })
       } else {
-        this.model.livingRoomIds
-          .filter((t) => t.roomId != '1')
-          .forEach((t) => {
-            livingOrderId += t.livingOrder.id + ','
-          })
+        that.settle(livingRoom)
+      }
+    },
+    settle(livingRoom) {
+      var that = this
+      let livingOrderIds = ''
+      if (livingRoom.roomId !== '1') {
+        livingOrderIds = livingRoom.livingOrder.id
+      } else {
+        this.model.livingRoomIds.filter((t) => t.roomId != '1').forEach((t) => {livingOrderIds += t.livingOrder.id + ','})
       }
       /* 判断是否有租借物品未归还 */
       var count = 0
-      await getAction('/order/cesOrderLeaseGoods/checkReturnGoods', {
-        livingOrderId: livingOrderId
+      getAction('/order/cesOrderLeaseGoods/checkReturnGoods', {
+        livingOrderId: livingOrderIds
       }).then((res) => {
         if (res.success) {
           if (res.result && res.result > 0) {
@@ -2027,61 +2044,30 @@ export default {
           }
         }
       })
-      if (count == 0) {
-        let differMoney = this.feesAmount - this.paymentAmount
-        // console.log(livingRoom);
-        console.log(this.model.livingRoomIds);
-        if (this.model.livingRoomIds.length >= 2) {
-          var templistid = []
-          for (let index = 1; index < this.model.livingRoomIds.length; index++) {
-            // const element = array[index];
-            templistid.push(this.model.livingRoomIds[index].livingOrder.id)
-          }
-          // console.log(templistid);
-        }
-
-        if (differMoney > 0) {
-          this.$refs.modalPayOrRefundForm.edit({
-            money: differMoney,
-            collection: this.paymentAmount,
-            consumption: this.feesAmount,
-            subjectType: 5,
-            feeType: 2,
-            bookingOrderId: this.model.orderInfo.id,
-            livingOrderId:
-                livingRoom.roomId != '1' ? livingRoom.livingOrder.id : '',
-            vipCustomerId: livingRoom.livingOrder.vipCustomerId,
-            contractTeamId: livingRoom.livingOrder.contractTeamId,
-            contractTeamProtocolId: livingRoom.livingOrder.contractTeamProtocolId,
-            preferentialType: 1,
-            couponFirstAmount: 0,
-            discount: 9,
-            isRefund: differMoney > 0
-          })
-          this.$refs.modalPayOrRefundForm.title = '结账收款'
-          // this.$refs.modalPayOrRefundForm.isRefund = false
-        } else {
-          this.$refs.modalPayOrRefundForm.edit({
-            money: differMoney,
-            collection: this.paymentAmount,
-            consumption: this.feesAmount,
-            subjectType: 5,
-            feeType: 2,
-            bookingOrderId: this.model.orderInfo.id,
-            livingOrderId: templistid,
-            vipCustomerId: livingRoom.livingOrder.vipCustomerId,
-            contractTeamId: livingRoom.livingOrder.contractTeamId,
-            contractTeamProtocolId: livingRoom.livingOrder.contractTeamProtocolId,
-            preferentialType: 1,
-            couponFirstAmount: 0,
-            discount: 9,
-            isRefund: differMoney > 0
-          })
-          this.$refs.modalPayOrRefundForm.title = '结账退款'
-          // this.$refs.modalPayOrRefundForm.isRefund = true
-        }
-        this.$refs.modalPayOrRefundForm.disableSubmit = false
+      if (count !== 0) {
+        return
       }
+      let differMoney = this.feesAmount - this.paymentAmount
+      this.$refs.modalPayOrRefundForm.edit({
+        money: differMoney,
+        collection: this.paymentAmount,
+        consumption: this.feesAmount,
+        subjectType: 5,
+        feeType: 2,
+        bookingOrderId: this.model.orderInfo.id,
+        livingOrderId:
+            livingRoom.roomId !== '1' ? livingRoom.livingOrder.id : '',
+        livingOrderIds: livingOrderIds,
+        vipCustomerId: livingRoom.livingOrder.vipCustomerId,
+        contractTeamId: livingRoom.livingOrder.contractTeamId,
+        contractTeamProtocolId: livingRoom.livingOrder.contractTeamProtocolId,
+        preferentialType: 1,
+        couponFirstAmount: 0,
+        discount: 9,
+        isRefund: differMoney > 0
+      })
+      this.$refs.modalPayOrRefundForm.title = differMoney > 0 ? '结账收款' : '结账退款'
+      this.$refs.modalPayOrRefundForm.disableSubmit = false
     },
     puls() {
       this.wakeService = true

+ 5 - 3
src/views/room/modules/checkIn/FeeForm.vue

@@ -185,7 +185,7 @@
               :wrapperCol="{xs: { span: 24 },sm: { span: 14 }}"
               label="费项"
               style="padding-top: 10px; padding-bottom: 0px">
-            <a-input v-model="addFeeModel.remark" :disabled="this.barId != 13"></a-input>
+            <a-input v-model="addFeeModel.remark" :disabled="this.barId != 14"></a-input>
           </a-form-model-item>
         </a-col>
         <a-col>
@@ -237,7 +237,7 @@ export default {
               name: '赔偿费'
             },
             {
-              id: 13,
+              id: 14,
               name: '其他'
             }
           ],
@@ -378,7 +378,7 @@ export default {
           this.queryParams.goodTypeId = null
           this.loadData()
           return
-        } else if (item.id === 10 || item.id === 12 || item.id === 13) {
+        } else if (item.id === 10 || item.id === 12 || item.id === 14) {
           this.addFeeModel.remark = this.getSubjectTypeText(item.id)
           this.addFeeVisible = true
           return
@@ -438,6 +438,8 @@ export default {
           msg = '赔偿费'
         } else if (text == 13 && record != null) {
           msg = record.remark
+        } else if (text == 14) {
+          msg = '其他'
         }
         return msg
       },

+ 375 - 0
src/views/room/modules/checkIn/FeeGoodsForm.vue

@@ -0,0 +1,375 @@
+<template>
+  <div>
+    <a-row>
+      <a-col :span="10">
+        <a-row>
+          <a-form-model ref="form" :model="model" :rules="validatorRules">
+            <a-col :span="9">
+              <a-form-model-item>
+                <a-input v-model="queryParams.name" style="width: 80%" placeholder="名称" />
+              </a-form-model-item>
+            </a-col>
+            <a-col :span="3">
+              <a-form-model-item>
+                <a-button @click="loadData" type="primary">搜索</a-button>
+              </a-form-model-item>
+            </a-col>
+          </a-form-model>
+        </a-row>
+        <a-row>
+          <a-col :span="8">
+            <a-tree
+                showIcon
+                :replaceFields="{ children: 'children', title: 'name', key: 'id' }"
+                :treeData="stockTypeList"
+
+            >
+            </a-tree>
+          </a-col>
+          <a-col :span="16">
+            <a-table :columns="columns" :customRow="handleRowClick" :dataSource="dataSource" :pagination="false" :scroll="{ y: 500 }" style="margin-top:10px; overflow-y: scroll">
+              <template slot="sellingPrice" slot-scope="text, record">
+                <a-input-number v-model="record.sellingPrice" :min="0"></a-input-number>
+              </template>
+              <template slot="number" slot-scope="text, record">
+                <a-input-number :max="record.inventory" v-model="record.number" @change="changeNumber" :min="0"></a-input-number>
+              </template>
+              <template slot="inventorySlot" slot-scope="text,record">
+                {{ record.inventory - record.number }}
+              </template>
+            </a-table>
+          </a-col>
+        </a-row>
+      </a-col>
+      <a-col :span="14">
+        <a-table :columns="chooseColumns" @change="pageChange" :dataSource="chooseGoodsList" :pagination="false" :scroll="{ y: 500 }" style="margin-top:10px;">
+          <template slot="sellingPrice" slot-scope="text, record">
+            <a-input-number v-model="record.sellingPrice" :min="0"></a-input-number>
+          </template>
+          <template slot="number" slot-scope="text, record">
+            <a-input-number :max="record.inventory" v-model="record.number" @change="changeNumber" :min="0"></a-input-number>
+          </template>
+          <template slot="inventorySlot" slot-scope="text,record">
+            {{ record.inventory - record.number }}
+          </template>
+        </a-table>
+      </a-col>
+    </a-row>
+    </div>
+</template>
+
+<script>
+import {
+  httpAction,
+  getAction
+} from '@/api/manage'
+import {
+  validateDuplicateValue
+} from '@/utils/util'
+
+import {
+  JeecgListMixin
+} from '@/mixins/JeecgListMixin'
+export default {
+  name: 'FeeGoodsForm',
+  components: {},
+  props: {
+    // 表单禁用
+    disabled: {
+      type: Boolean,
+      default: false,
+      required: false
+    },
+  },
+  data() {
+    return {
+      dataSource: [],
+      chooseGoodsList: [],
+      columns: [
+        {
+          title: '名称',
+          align: 'center',
+          dataIndex: 'name'
+        },
+        {
+          title: '售价',
+          align: 'center',
+          dataIndex: 'sellingPrice',
+          // scopedSlots: {
+          //   customRender: 'sellingPrice'
+          // }
+        },
+        // {
+        //   title: '数量',
+        //   align: 'center',
+        //   dataIndex: 'number',
+        //   width: '80',
+        //   scopedSlots: {
+        //     customRender: 'number'
+        //   }
+        // },
+        {
+          title: '库存',
+          align: 'center',
+          dataIndex: 'inventory',
+          width: '80',
+          scopedSlots: {
+            customRender: 'inventorySlot'
+          }
+        }
+      ],
+      chooseColumns: [
+        {
+          title: '名称',
+          align: 'center',
+          dataIndex: 'name'
+        },
+        {
+          title: '售价',
+          align: 'center',
+          dataIndex: 'sellingPrice',
+          scopedSlots: {
+            customRender: 'sellingPrice'
+          }
+        },
+        {
+          title: '数量',
+          align: 'center',
+          dataIndex: 'number',
+          width: '80',
+          scopedSlots: {
+            customRender: 'number'
+          }
+        },
+        {
+          title: '金额',
+          align: 'center',
+          width: '80',
+          customRender: function (text, record) {
+            return record.sellingPrice * record.number
+          }
+        }
+      ],
+      ipagination: {
+        current: 1,
+        pageSize: 20,
+        pageSizeOptions: ['10', '20', '30'],
+        showTotal: (total, range) => {
+          return range[0] + "-" + range[1] + " 共" + total + "条"
+        },
+        showQuickJumper: true,
+        showSizeChanger: true,
+        total: 0
+      },
+      stockTypeList: [],
+      model: {
+        payType: 1,
+        livingOrderId: '',
+        certType: 1,
+        gender: 1,
+        subjectType: 6,
+        vipCustomerId: null
+      },
+      markerMemberCard: {},
+      queryParams: {},
+      labelCol: {
+        xs: {
+          span: 24
+        },
+        sm: {
+          span: 5
+        }
+      },
+      wrapperCol: {
+        xs: {
+          span: 24
+        },
+        sm: {
+          span: 16
+        }
+      },
+      confirmLoading: false,
+      validatorRules: {
+        subjectType: [{
+          required: true,
+          message: '请输入消费项目!'
+        }],
+        money: [{
+          required: true,
+          message: '请输入金额!'
+        }]
+      },
+      url: {
+        list: '/rooms/cesGoods/kf-goods-list',
+        edit: '/business/busMemberCard/edit',
+        queryById: '/business/busMemberCard/queryById'
+      },
+      gradeList: [],
+      paymentMethodList: [],
+      staffList: [],
+      customerList: [],
+      oldcustomerList: []
+    }
+  },
+  computed: {
+    formDisabled() {
+      return this.disabled
+    },
+    goodsPrice() {
+      let money = this.dataSource.reduce((pre, cur) => pre + cur.sellingPrice * (cur.number || 0), 0)
+      return money
+    }
+  },
+  created() {
+    var _info = JSON.parse(localStorage.getItem('storeInfo'))
+    if (_info) {
+      this.model.hotelId = _info.id
+    }
+    // 备份model原始值
+    this.modelDefault = JSON.parse(JSON.stringify(this.model))
+    this.loadData()
+    this.getbusCustomer()
+    this.loadStockType()
+
+  },
+  methods: {
+    handleRowClick(row) {
+      return {
+        on: {
+          dblclick: () => {
+            if (row.inventory - row.number <= 0) {
+              this.$message.warning('库存不足')
+              return
+            }
+            row.number++
+            if (!this.chooseGoodsList.some(e => e === row)) {
+              this.chooseGoodsList.push(row)
+            }
+          }
+        }
+      }
+
+    },
+    changeNumber() {
+      console.log(this.dataSource)
+    },
+    handleSearch(value) {
+      let result
+      if (!value) {
+        result = this.oldcustomerList
+      } else {
+        result = this.oldcustomerList.filter((t) => t.name.includes(value))
+      }
+      this.customerList = result
+    },
+    handleSelectMember(e) {
+      var find = this.customerList.find((t) => t.id === e)
+      this.model.phone = find.phone
+      this.model.customerName = find.name
+      this.model.customerId = find.id
+    },
+    getbusCustomer() {
+      getAction('/bus/busCustomer/list', {}).then((res) => {
+        if (res.success) {
+          this.customerList = res.result.records
+          this.oldcustomerList = JSON.parse(JSON.stringify(this.customerList))
+        }
+      })
+    },
+    getMarkerMemberByCarId() {
+      console.log(this.model)
+      if (this.model.vipCustomerId == null || this.model.vipCustomerId === '') {
+        this.markerMemberCard = null;
+        return
+      }
+      if (this.markerMemberCard != null && this.markerMemberCard.goodsDiscount != null) {
+        this.dataSource.forEach(e => {
+          e.sellingPrice = e.sellingPrice * this.markerMemberCard.goodsDiscount / 100
+        })
+        return
+      }
+      console.log(this.model.vipCustomerId)
+      getAction('/business/busMemberCard/getMarkerMemberByCarId', { id: this.model.vipCustomerId }).then((res) => {
+        if (res.success) {
+          this.markerMemberCard = res.result
+          this.dataSource.forEach(e => {
+            e.sellingPrice = e.sellingPrice * this.markerMemberCard.goodsDiscount / 100
+          })
+        }
+      })
+    },
+    /**查询商品类别  */
+    loadStockType() {
+      let params = {
+        pageSize: 9999,
+        pageNo: 1
+      }
+      getAction('/rooms/cesStockType/tree', params).then((res) => {
+        if (!res.success) {
+          this.$message.warning('查询失败')
+          return
+        }
+        this.stockTypeList = res.result
+        console.log(this.stockTypeList)
+      })
+    },
+    stockTypeChange(e) {
+      this.queryParams.goodTypeId = e[e.length - 1]
+    },
+    add(obj) {
+      this.modelDefault.livingOrderId = obj.livingOrderId
+      this.modelDefault.roomId = obj.roomId
+      this.modelDefault.vipCustomerId = obj.vipCustomerId
+      this.edit(this.modelDefault)
+    },
+    edit(record) {
+      this.model = Object.assign({}, record)
+      this.visible = true
+      this.loadData()
+    },
+    loadData(arg) {
+      if (this.url.list == 2) {
+        return
+      }
+      if (!this.url.list) {
+        this.$message.error('请设置url.list属性!')
+        return
+      }
+      // 加载数据 若传入参数1则加载第一页的内容
+      if (arg === 1) {
+        this.ipagination.current = 1
+      }
+      let params = {
+        pageSize: this.ipagination.pageSize,
+        pageNo: this.ipagination.current,
+        name: this.queryParams.name,
+        goodType: this.queryParams.goodTypeId
+      }
+      this.loading = true
+      getAction(this.url.list, params).then((res) => {
+        if (res.success) {
+          // update-begin---author:zhangyafei    Date:20201118  for:适配不分页的数据列表------------
+          let arr = []
+          arr = res.result.records || res.result
+          arr.forEach(ele => {
+            ele.number = 0
+          })
+          this.dataSource = JSON.parse(JSON.stringify(arr))
+          if (res.result.total) {
+            this.ipagination.total = res.result.total
+          } else {
+            this.ipagination.total = 0
+          }
+          this.getMarkerMemberByCarId()
+          this.loading = false
+          // update-end---author:zhangyafei    Date:20201118  for:适配不分页的数据列表------------
+        } else {
+          this.$message.warning(res.message)
+        }
+      }).finally(() => {
+        this.loading = false
+      })
+    },
+  }
+}
+</script>

+ 3 - 4
src/views/room/modules/checkIn/PayOrRefund.vue

@@ -749,10 +749,10 @@ export default {
           if (this.realityAmount != this.sumAmount) {
             console.log(this.realityAmount)
             console.log(this.sumAmount)
-            that.$message.warning('实收金额和实收合计必须相等')
+            let mes = that.isRefund ? '应退金额和实收合计必须相等' : '应收金额和实收合计必须相等'
+            that.$message.warning(mes)
             return
           }
-          console.log(this.model)
           // return
           var obj = {}
           var fees = []
@@ -902,8 +902,7 @@ export default {
       let returnFeeList = []
       // let feeList = []
       console.log(this.model)
-      let livingOrderIds = this.model.livingOrderId
-      console.log(livingOrderIds)
+      let livingOrderIds = this.model.livingOrderIds.split(',')
       if (this.model.money < 0) {
         postAction('/business/busOrderFee/refundList', livingOrderIds).then((res) => {
           // 过滤掉退款单

+ 224 - 191
src/views/settings/components/roomModules/housePriceSchemeList.vue

@@ -1,36 +1,39 @@
 <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="6">
-                        <a-form-item label="关键字">
-                            <a-input placeholder="关键字(方案、编号、简码)" v-model="queryParam.paramName" allowClear></a-input>
-                        </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>
-        <!-- 查询区域-END -->
+  <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="6">
+            <a-form-item label="关键字">
+              <a-input placeholder="关键字(方案、编号、简码)" v-model="queryParam.paramName" allowClear></a-input>
+            </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>
+    <!-- 查询区域-END -->
 
-        <!-- 操作按钮区域 -->
-        <div class="table-operator">
-            <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
-            <a-dropdown v-if="selectedRowKeys.length > 0">
-<!--                <a-button style="margin-left: 8px">-->
-<!--                    批量操作 <a-icon type="down" /></a-button>-->
-                <a-button @click="batchDel" type="danger" icon="delete">批量删除</a-button>
-            </a-dropdown>
-        </div>
-        <!-- <div class="table-operator">
+    <!-- 操作按钮区域 -->
+    <div class="table-operator">
+      <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
+      <a-dropdown v-if="selectedRowKeys.length > 0">
+        <!--                <a-button style="margin-left: 8px">-->
+        <!--                    批量操作 <a-icon type="down" /></a-button>-->
+        <a-button @click="batchDel" type="danger" icon="delete">批量删除</a-button>
+      </a-dropdown>
+    </div>
+    <!-- <div class="table-operator">
             <a-tabs v-model:activeKey="activeKey">
                 <a-tab-pane key="1" tab="Tab 1">Content of Tab Pane 1</a-tab-pane>
                 <a-tab-pane key="2" tab="Tab 2" force-render>Content of Tab Pane 2</a-tab-pane>
@@ -38,79 +41,104 @@
             </a-tabs>
         </div> -->
 
-        <!-- table区域-begin -->
-        <div>
-            <!-- <div class="ant-alert ant-alert-info" style="margin-bottom: 16px">
+    <!-- table区域-begin -->
+    <div>
+      <!-- <div class="ant-alert ant-alert-info" style="margin-bottom: 16px">
         <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择
         <a style="font-weight: 600">{{ selectedRowKeys.length }}</a
         >项
         <a style="margin-left: 24px" @click="onClearSelected">清空</a>
       </div> -->
 
-            <a-table ref="table" size="middle" :scroll="{ x: true }" bordered rowKey="id" :columns="columns"
-                     :dataSource="dataSource" :pagination="ipagination" :loading="loading" :rowSelection="{
-                    selectedRowKeys: selectedRowKeys,
-                    onChange: onSelectChange,
-                }" class="j-table-force-nowrap" @change="handleTableChange">
-                <template slot="openSlot" slot-scope="text, record, index">
-                    <a-switch checked-children="开" un-checked-children="关" default-checked :checked="record.open == 1"
-                              @change="e=>changeOpenState(e,record)" />
-                </template>
-                <template slot="htmlSlot" slot-scope="text">
-                    <div v-html="text"></div>
-                </template>
-                <template slot="imgSlot" slot-scope="text, record">
-                    <span v-if="!text" style="font-size: 12px; font-style: italic">无图片</span>
-                    <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt=""
-                         style="max-width: 80px; font-size: 12px; font-style: italic" />
-                </template>
-                <template slot="fileSlot" slot-scope="text">
-                    <span v-if="!text" style="font-size: 12px; font-style: italic">无文件</span>
-                    <a-button v-else :ghost="true" type="primary" icon="download" size="small"
-                              @click="downloadFile(text)">
-                        下载
-                    </a-button>
-                </template>
+      <a-table
+        ref="table"
+        size="middle"
+        :scroll="{ x: true }"
+        bordered
+        rowKey="id"
+        :columns="columns"
+        :dataSource="dataSource"
+        :pagination="ipagination"
+        :loading="loading"
+        :rowSelection="{
+          selectedRowKeys: selectedRowKeys,
+          onChange: onSelectChange,
+        }"
+        class="j-table-force-nowrap"
+        @change="handleTableChange">
+        <template slot="openSlot" slot-scope="text, record, index">
+          <a-switch
+            checked-children="开"
+            un-checked-children="关"
+            default-checked
+            :checked="record.open == 1"
+            @change="e=>changeOpenState(e,record)" />
+        </template>
+        <template slot="htmlSlot" slot-scope="text">
+          <div v-html="text"></div>
+        </template>
+        <template slot="imgSlot" slot-scope="text, record">
+          <span v-if="!text" style="font-size: 12px; font-style: italic">无图片</span>
+          <img
+            v-else
+            :src="getImgView(text)"
+            :preview="record.id"
+            height="25px"
+            alt=""
+            style="max-width: 80px; font-size: 12px; font-style: italic" />
+        </template>
+        <template slot="fileSlot" slot-scope="text">
+          <span v-if="!text" style="font-size: 12px; font-style: italic">无文件</span>
+          <a-button
+            v-else
+            :ghost="true"
+            type="primary"
+            icon="download"
+            size="small"
+            @click="downloadFile(text)">
+            下载
+          </a-button>
+        </template>
 
-                <span slot="action" slot-scope="text, record">
-                    <a @click="handleEdit(record)">编辑</a>
+        <span slot="action" slot-scope="text, record">
+          <a @click="handleEdit(record)">编辑</a>
 
-                    <a-divider type="vertical" />
-                    <a-dropdown>
-                        <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
-                        <a-menu slot="overlay">
-                            <a-menu-item>
-                                <a @click="handleDetailSetting(record)">详情</a>
-                            </a-menu-item>
-                            <a-menu-item>
-                                <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
-                                    <a>删除</a>
-                                </a-popconfirm>
-                            </a-menu-item>
-                        </a-menu>
-                    </a-dropdown>
-                </span>
-            </a-table>
-        </div>
-<!--        <room-layout-form ref="modalForm" @ok="modalFormOk"></room-layout-form>-->
-<!--        <room-layout-price-modal ref="priceModal" @ok="onPriceSave"></room-layout-price-modal>-->
-<!--        <room-layout-detail-modal @saveOk="onSaveOk" ref="detailModal"></room-layout-detail-modal>-->
-        <house-price-scheme-modal ref="modalForm" @ok="modalFormOk"></house-price-scheme-modal>
-        <house-price-scheme-detail-modal ref="detailModal" @ok="modalFormOk"></house-price-scheme-detail-modal>
-    </a-card>
+          <a-divider type="vertical" />
+          <a-dropdown>
+            <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
+            <a-menu slot="overlay">
+              <a-menu-item>
+                <a @click="handleDetailSetting(record)">详情</a>
+              </a-menu-item>
+              <a-menu-item>
+                <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
+                  <a>删除</a>
+                </a-popconfirm>
+              </a-menu-item>
+            </a-menu>
+          </a-dropdown>
+        </span>
+      </a-table>
+    </div>
+    <!--        <room-layout-form ref="modalForm" @ok="modalFormOk"></room-layout-form>-->
+    <!--        <room-layout-price-modal ref="priceModal" @ok="onPriceSave"></room-layout-price-modal>-->
+    <!--        <room-layout-detail-modal @saveOk="onSaveOk" ref="detailModal"></room-layout-detail-modal>-->
+    <house-price-scheme-modal ref="modalForm" @ok="modalFormOk"></house-price-scheme-modal>
+    <house-price-scheme-detail-modal ref="detailModal" @ok="modalFormOk"></house-price-scheme-detail-modal>
+  </a-card>
 </template>
 
 <script>
 
-    import { JeecgListMixin } from "@/mixins/JeecgListMixin";
+    import { JeecgListMixin } from '@/mixins/JeecgListMixin'
     import { modifyAppState } from '@/api/roomLayout'
-    import { filterObj } from "@/utils/util";
-    import HousePriceSchemeModal from "./modules/housePriceSchemeModal";
-    let hotelInfo = JSON.parse(localStorage.getItem('storeInfo'))
+    import { filterObj } from '@/utils/util'
+    import HousePriceSchemeModal from './modules/housePriceSchemeModal'
     import { httpAction, getAction } from '@/api/manage'
-    import HousePriceSchemeDetailModal from "./modules/housePriceSchemeDetailModal";
+    import HousePriceSchemeDetailModal from './modules/housePriceSchemeDetailModal'
+    let hotelInfo = JSON.parse(localStorage.getItem('storeInfo'))
     export default {
-        name: "housePriceSchemeList",
+        name: 'HousePriceSchemeList',
         mixins: [JeecgListMixin],
         components: {
             HousePriceSchemeDetailModal,
@@ -118,96 +146,101 @@
         },
         data() {
             return {
-                
+
                 queryParam: {},
                 // 分页参数
                 ipagination: {
                     current: 1,
                     pageSize: 10,
-                    pageSizeOptions: ["10", "20", "30"],
+                    pageSizeOptions: ['10', '20', '30'],
                     showTotal: (total, range) => {
-                        return range[0] + "-" + range[1] + " 共" + total + "条";
+                        return range[0] + '-' + range[1] + ' 共' + total + '条'
                     },
                     showQuickJumper: true,
                     showSizeChanger: true,
-                    total: 0,
+                    total: 0
                 },
                 // 表头
                 columns: [
+                    // {
+                    //     title: '简码',
+                    //     align: 'center',
+                    //     dataIndex: 'simpleCode'
+                    // },
+                    // {
+                    //     title: '编号',
+                    //     align: 'center',
+                    //     dataIndex: 'number'
+                    // },
                     {
-                        title: "简码",
-                        align: "center",
-                        dataIndex: "simpleCode",
-                    },
-                    {
-                        title: "编号",
-                        align: "center",
-                        dataIndex: "number",
-                    },
-                    {
-                        title: "房价方案",
-                        align: "center",
-                        dataIndex: "priceScheme",
+                        title: '房价方案',
+                        align: 'center',
+                        dataIndex: 'priceScheme'
 
                     },
                     {
-                        title: "客人类型",
-                        align: "center",
-                        dataIndex: "guestTypeName",
+                        title: '客人类型',
+                        align: 'center',
+                        dataIndex: 'guestTypeName'
                     },
                     {
-                        title: "入住时间",
-                        align: "center",
-                        dataIndex: "checkInTimeText",
+                        title: '入住时间',
+                        align: 'center',
+                        dataIndex: 'checkInTimeText'
                     },
                     {
-                        title: "有效期",
-                        align: "center",
-                        dataIndex: "validTimeText",
+                        title: '有效期',
+                        align: 'center',
+                        dataIndex: 'validTimeText'
                     },
                     {
-                        title: "状态",
-                        align: "center",
-                        dataIndex: "open",
-                        scopedSlots: {customRender: "openSlot"},
+                        title: '有效期',
+                        align: 'center',
+                        dataIndex: 'checkInTimeText'
                     },
                     {
-                        title: "排序",
-                        align: "center",
-                        dataIndex: "sort",
+                        title: '状态',
+                        align: 'center',
+                        dataIndex: 'open',
+                        scopedSlots: { customRender: 'openSlot' }
                     },
+                    // {
+                    //     title: '排序',
+                    //     align: 'center',
+                    //     dataIndex: 'sort'
+                    // },
                     {
-                        title: "操作时间",
-                        align: "center",
-                        dataIndex: "createAt",
+                        title: '操作时间',
+                        align: 'center',
+                        dataIndex: 'createAt'
                     },
                     {
-                        title: "操作",
-                        dataIndex: "action",
-                        align: "center",
-                        fixed: "right",
+                        title: '操作',
+                        dataIndex: 'action',
+                        align: 'center',
+                        fixed: 'right',
                         width: 147,
-                        scopedSlots: {customRender: "action"},
-                    },
+                        scopedSlots: { customRender: 'action' }
+                    }
                 ],
                 url: {
                     // list: 'org.jeecg.modules.business/busMarketMember/list',
-                    list: "/rooms/cesHousePriceScheme/list?hotelId=" + hotelInfo.id,
-                    delete: "/rooms/cesHousePriceScheme/remove",
-                    deleteBatch: "/rooms/cesHousePriceScheme/deleteBatch",
-                    exportXlsUrl: "/rooms/cesHousePriceScheme/exportXls",
+                    list: '/rooms/cesHousePriceScheme/list?hotelId=' + hotelInfo.id,
+                    delete: '/rooms/cesHousePriceScheme/remove',
+                    deleteBatch: '/rooms/cesHousePriceScheme/deleteBatch',
+                    exportXlsUrl: '/rooms/cesHousePriceScheme/exportXls',
                     importExcelUrl:
-                        "rooms/cesHousePriceScheme/importExcel",
-                    modifyOpen: "/rooms/cesHousePriceScheme/modifyOpen",
+                        'rooms/cesHousePriceScheme/importExcel',
+                    modifyOpen: '/rooms/cesHousePriceScheme/modifyOpen'
                 },
                 dictOptions: {},
                 superFieldList: [],
                 selectedRowKeys: [],
                 isorter: {
-                    column: "createTime",
-                    order: "desc",
-                },
-            };
+                    column: 'createTime',
+                    order: 'desc'
+                }
+            }
         },
         created() {
             // this.loadData()
@@ -215,7 +248,7 @@
             // this.getMember()
         },
         methods: {
-            
+
             onSaveOk() {
                 this.loadData()
             },
@@ -223,19 +256,19 @@
 
             },
             handleDetailSetting(record) {
-                this.$refs.detailModal.title="详情"
+                this.$refs.detailModal.title = '详情'
                 this.$refs.detailModal.visible = true
-                this.$refs.detailModal.schemeId=record.id
+                this.$refs.detailModal.schemeId = record.id
             },
             changeOpenState(e, record) {
                 console.log(e)
-                var that = this;
+                var that = this
                 this.confirmLoading = true
-                httpAction(this.url.modifyOpen +'/'+ record.id + "?open=" + (e ? 1 : 0), {}, 'put').then((res) => {
+                httpAction(this.url.modifyOpen + '/' + record.id + '?open=' + (e ? 1 : 0), {}, 'put').then((res) => {
                     if (res.success) {
                         that.$message.success('操作成功')
                         that.$emit('ok')
-                        that.loadData(1);
+                        that.loadData(1)
                     } else {
                         that.$message.warning(res.message)
                     }
@@ -246,90 +279,90 @@
             changeAppState(e, param) {
                 modifyAppState(param).then(res => {
                     if (res.code == 200) {
-                        this.loadData();
+                        this.loadData()
                     }
                 })
             },
             getAvatarView: function (avatar) {
-                return getFileAccessHttpUrl(avatar);
+                return getFileAccessHttpUrl(avatar)
             },
 
             batchFrozen: function (status) {
                 if (this.selectedRowKeys.length <= 0) {
-                    this.$message.warning("请选择一条记录!");
-                    return false;
+                    this.$message.warning('请选择一条记录!')
+                    return false
                 } else {
-                    let ids = "";
-                    let that = this;
-                    let isAdmin = false;
+                    let ids = ''
+                    let that = this
+                    let isAdmin = false
                     that.selectionRows.forEach(function (row) {
-                        if (row.username == "admin") {
-                            isAdmin = true;
+                        if (row.username == 'admin') {
+                            isAdmin = true
                         }
-                    });
+                    })
                     if (isAdmin) {
-                        that.$message.warning("管理员账号不允许此操作,请重新选择!");
-                        return;
+                        that.$message.warning('管理员账号不允许此操作,请重新选择!')
+                        return
                     }
                     that.selectedRowKeys.forEach(function (val) {
-                        ids += val + ",";
-                    });
+                        ids += val + ','
+                    })
                     that.$confirm({
-                        title: "确认操作",
-                        content: "是否" + (status == 1 ? "解冻" : "冻结") + "选中账号?",
+                        title: '确认操作',
+                        content: '是否' + (status == 1 ? '解冻' : '冻结') + '选中账号?',
                         onOk: function () {
-                            frozenBatch({ids: ids, status: status}).then((res) => {
+                            frozenBatch({ ids: ids, status: status }).then((res) => {
                                 if (res.success) {
-                                    that.$message.success(res.message);
-                                    that.loadData();
-                                    that.onClearSelected();
+                                    that.$message.success(res.message)
+                                    that.loadData()
+                                    that.onClearSelected()
                                 } else {
-                                    that.$message.warning(res.message);
+                                    that.$message.warning(res.message)
                                 }
-                            });
-                        },
-                    });
+                            })
+                        }
+                    })
                 }
             },
             handleMenuClick(e) {
                 if (e.key == 1) {
-                    this.batchDel();
+                    this.batchDel()
                 } else if (e.key == 2) {
-                    this.batchFrozen(2);
+                    this.batchFrozen(2)
                 } else if (e.key == 3) {
-                    this.batchFrozen(1);
+                    this.batchFrozen(1)
                 }
             },
             handleFrozen: function (id, status, username) {
-                let that = this;
-                //TODO 后台校验管理员角色
-                if ("admin" == username) {
-                    that.$message.warning("管理员账号不允许此操作!");
-                    return;
+                let that = this
+                // TODO 后台校验管理员角色
+                if (username == 'admin') {
+                    that.$message.warning('管理员账号不允许此操作!')
+                    return
                 }
-                frozenBatch({ids: id, status: status}).then((res) => {
+                frozenBatch({ ids: id, status: status }).then((res) => {
                     if (res.success) {
-                        that.$message.success(res.message);
-                        that.loadData();
+                        that.$message.success(res.message)
+                        that.loadData()
                     } else {
-                        that.$message.warning(res.message);
+                        that.$message.warning(res.message)
                     }
-                });
+                })
             },
             handleChangePassword(username) {
-                this.$refs.passwordmodal.show(username);
+                this.$refs.passwordmodal.show(username)
             },
             passwordModalOk() {
-                //TODO 密码修改完成 不需要刷新页面,可以把datasource中的数据更新一下
+                // TODO 密码修改完成 不需要刷新页面,可以把datasource中的数据更新一下
             },
-            onSyncFinally({isToLocal}) {
+            onSyncFinally({ isToLocal }) {
                 // 同步到本地时刷新下数据
                 if (isToLocal) {
-                    this.loadData();
+                    this.loadData()
                 }
-            },
-        },
-    };
+            }
+        }
+    }
 </script>
 <style scoped>
     @import "~@assets/less/common.less";

+ 231 - 0
src/views/settings/components/roomModules/housePriceSchemeSettingModel.vue

@@ -0,0 +1,231 @@
+<template>
+  <div>
+    <j-modal :visible="visible" :title="title" @cancel="visible = !visible" :width="500" @ok="submitForm">
+      <a-form-model ref="form" :model="model">
+        <a-form-model-item v-if="model.type === 1" label="周末房价执行时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="weekends">
+          <a-checkbox-group v-model="model.weekends" >
+            <a-checkbox :value="item.value" v-for="item in weeks" :key="item.value">
+              {{ item.text }}
+            </a-checkbox>
+          </a-checkbox-group>
+        </a-form-model-item>
+
+        <a-form-model-item  v-if="model.type === 2" label="节假日时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="holiday" >
+          <a-radio-group >
+            <a-radio :value="0">同步法定节假日</a-radio>
+            <a-radio :value="1">自定义节假日时间</a-radio>
+          </a-radio-group>
+          <a-col :span="24" v-for="(item, index) in allHolidayArr">
+            <a-range-picker v-model="item.list" format="YYYY-MM-DD" v-if="model.validTime == 1" :disabledDate="disabledDate" style="width: 80%" />
+            <a-icon v-if="index == allHolidayArr.length - 1" type="plus-circle" class="dynamic-delete-button" @click="puls()" />
+            <a-icon v-if="allHolidayArr.length > 1" type="minus-circle" style="color: #f56c6c" class="dynamic-delete-button" @click="() => remove(index)" />
+          </a-col>
+        </a-form-model-item>
+
+
+        <a-form-model-item label="请设置办理入住时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="checkInTime">
+          <a-row>
+            <a-radio-group v-model="model.checkInTime">
+              <a-radio :value="0">无限制</a-radio>
+              <a-radio :value="1">时间段</a-radio>
+            </a-radio-group>
+            <a-col :span="16">
+              <a-range-picker v-model="checkTimeRange" format="YYYY-MM-DD 00:00:00" v-if="model.checkInTime == 1" />
+            </a-col>
+          </a-row>
+        </a-form-model-item>
+        <a-form-model-item label="启用时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="validTime">
+          <a-radio-group v-model="model.validTime">
+                <a-radio :value="0">无限制</a-radio>
+                <a-radio :value="1">时间段</a-radio>
+              </a-radio-group>
+          <a-row>
+            <a-col :span="16">
+              <a-range-picker v-model="validTimeRange" format="YYYY-MM-DD 00:00:00" v-if="model.validTime == 1" />
+            </a-col>
+          </a-row>
+        </a-form-model-item>
+        <a-form-model-item label="状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="openValue">
+          <a-switch
+            checked-children="开启"
+            un-checked-children="关闭"
+            default-checked
+            v-model="model.openValue"
+            @change="e=>onOpenChange(e)"/>
+        </a-form-model-item>
+
+      </a-form-model>
+
+    </j-modal>
+  </div>
+</template>
+
+<script>
+
+import { getAction, httpAction } from '@api/manage'
+import { initDictOptions } from '@comp/dict/JDictSelectUtil'
+import moment from 'moment/moment'
+
+export default {
+  name: 'HousingPriceSchemeSettingModel',
+  components: {
+  },
+  data() {
+    return {
+      visible: false,
+      title: '',
+      labelCol: {
+        xs: { span: 24 },
+        sm: { span: 7 }
+      },
+      wrapperCol: {
+        xs: { span: 24 },
+        sm: { span: 16 }
+      },
+      model: {
+        weekends: []
+      },
+      weeks: [],
+      checkTimeRange: [],
+      validTimeRange: [],
+      allHolidayArr: []
+    }
+  },
+  created() {
+    this.getDictConfig()
+  },
+  methods: {
+    getDictConfig() {
+      initDictOptions('house_price_zmjr').then((res) => {
+        if (res.success) {
+          this.weeks = res.result
+        }
+      })
+    },
+    handleDateChange(date) {
+      // 处理日期变化
+      console.log('选中的日期:', date);
+    },
+    edit(value) {
+      this.visible = true
+      this.$nextTick(() => {
+        this.loadScheme(value)
+      })
+    },
+    loadScheme(value) {
+      getAction('/rooms/cesHousePriceScheme/findAcquiesceScheme', { type: value }).then(resp => {
+        let _record = resp.result
+
+        _record.open === 1 ? _record.openValue = true : _record.openValue = false
+        if (_record.weekend.length > 0){
+          _record.weekends = _record.weekend.split(',');
+        }
+        this.model = Object.assign({}, _record)
+        this.visible = true
+        if (this.model.checkInTime === 1) {
+          this.checkTimeRange =
+              [moment(new Date(this.model.startTime)).format('YYYY-MM-DD 00:00:00'),
+                moment(new Date(this.model.endTime)).format('YYYY-MM-DD 00:00:00')]
+        }
+        if (this.model.validTime === 1) {
+          this.validTimeRange =
+              [moment(new Date(this.model.validStartTime)).format('YYYY-MM-DD 00:00:00'),
+                moment(new Date(this.model.validEndTime)).format('YYYY-MM-DD 00:00:00')]
+        }
+        this.model.holiday = '2023-11-28~2023-11-29'
+        let holidayStrArr = this.model.holiday.split(',')
+        let allHolidayArr = []
+        holidayStrArr.forEach(e => {
+          let holidayArr = e.split('~')
+          if (holidayArr.length > 0) {
+            holidayArr[0] = moment(holidayArr[0])
+            holidayArr[1] = moment(holidayArr[1])
+          }
+          let obj = {
+            list: holidayArr
+          }
+          allHolidayArr.push(obj)
+        })
+        if (allHolidayArr.length === 0) {
+          let obj = {
+            list: []
+          }
+          allHolidayArr.push(obj)
+        }
+        this.allHolidayArr = allHolidayArr
+        console.log(this.allHolidayArr, 'allHolidayArr')
+      })
+    },
+    puls() {
+      let obj = {
+        list: []
+      }
+      this.allHolidayArr.push(obj)
+    },
+    remove(index) {
+      this.allHolidayArr.splice(index, 1)
+
+    },
+    disabledDate(current) {
+      if (this.allHolidayArr.some(e => current >= e.list[0] && current <= moment(e.list[1]).add(1, 'days'))) {
+        return true
+      }
+      return false
+    },
+    submitForm() {
+      const that = this
+      // 触发表单验证
+      if (this.model.checkInTime === 1) {
+        this.model.startTime = moment(this.checkTimeRange[0]).format('YYYY-MM-DD 00:00:00')
+        this.model.endTime = moment(this.checkTimeRange[1]).format('YYYY-MM-DD 00:00:00')
+      }
+      if (this.model.validTime === 1) {
+        this.model.validStartTime = moment(this.validTimeRange[0]).format('YYYY-MM-DD 00:00:00')
+        this.model.validEndTime = moment(this.validTimeRange[1]).format('YYYY-MM-DD 00:00:00')
+      }
+      this.model.weekend = this.model.weekends.join(',')
+      this.model.open = this.model.openValue ? 1 : 0
+      console.log(this.allHolidayArr)
+      let holidayStr = ''
+      this.allHolidayArr.forEach(e => {
+        e.list[0] = moment(e.list[0]).format('YYYY-MM-DD')
+        e.list[1] = moment(e.list[1]).format('YYYY-MM-DD')
+        holidayStr += e.list.join('~')
+        holidayStr += ','
+      })
+      this.holiday = holidayStr
+      console.log(this.model)
+      this.$refs.form.validate((valid) => {
+        if (valid) {
+          that.confirmLoading = true
+          httpAction('/rooms/cesHousePriceScheme/modify', this.model, 'put')
+              .then((res) => {
+                if (res.success) {
+                  that.$message.success(res.message)
+                  that.visible = false
+                } else {
+                  that.$message.warning(res.message)
+                }
+              })
+              .finally(() => {
+                that.confirmLoading = false
+              })
+        }
+      })
+    },
+
+  }
+}
+</script>
+
+<style scoped>
+.dynamic-delete-button {
+  cursor: pointer;
+  position: relative;
+  top: 5px;
+  margin-left: 5px;
+  font-size: 18px;
+  color: #1890ff;
+  transition: all 0.3s;
+}
+</style>

+ 96 - 0
src/views/settings/components/roomModules/housingPriceSetting.vue

@@ -0,0 +1,96 @@
+<template>
+  <div>
+    <a-form-model>
+      <a-row>
+        <a-form-model-item>
+          <a-radio-group v-model="setType" style="margin-bottom: 16px" button-style="solid">
+            <a-radio-button value="1">房价设置</a-radio-button>
+            <a-radio-button value="2">计费规则设置</a-radio-button>
+            <a-radio-button value="3">房价方案配置</a-radio-button>
+          </a-radio-group>
+        </a-form-model-item>
+        <a-form-model-item v-if="setType === '1'">
+          <a-col :span="24">
+            <a-radio-group v-model="priceSetting" style="margin-bottom: 16px" button-style="solid">
+              <a-radio-button value="0">平日房</a-radio-button>
+              <a-radio-button value="1">周末房</a-radio-button>
+              <a-radio-button value="2">法定节假日</a-radio-button>
+            </a-radio-group>
+            <a-button @click="openSetting" v-if="priceSetting != '0'" type="primary" style="margin-left: 50px">
+              {{ priceSetting === '1' ? '设置周末时间' : '设置法定节假日' }}
+            </a-button>
+          </a-col>
+          <a-col :span="24">
+            <house-price-scheme-detail-list v-if="priceSetting == '0'" key="detail0" :typess="0"></house-price-scheme-detail-list>
+            <house-price-scheme-detail-list v-if="priceSetting == '1'" key="detail1" :typess="1"></house-price-scheme-detail-list>
+            <house-price-scheme-detail-list v-if="priceSetting == '2'" key="detail2" :typess="2" ></house-price-scheme-detail-list>
+          </a-col>
+        </a-form-model-item>
+        <a-form-model-item v-if="setType === '2'">
+          <a-col :span="24">
+            <a-radio-group v-model="chargeRule" style="margin-bottom: 16px" button-style="solid">
+              <a-radio-button value="1">全天房设置</a-radio-button>
+              <a-radio-button value="2">钟点房设置</a-radio-button>
+            </a-radio-group>
+          </a-col>
+          <a-col :span="24">
+            <all-days-room-fee-rule v-if="chargeRule == '1'"></all-days-room-fee-rule>
+            <hour-room-rule-list v-if="chargeRule == '2'"></hour-room-rule-list>
+          </a-col>
+        </a-form-model-item>
+        <a-form-model-item v-if="setType === '3'">
+          <a-col :span="24">
+            <a-radio-group v-model="priceScheme" style="margin-bottom: 16px" button-style="solid">
+              <a-radio-button value="1">特殊房价方案</a-radio-button>
+              <a-radio-button value="2">长租房房价方案</a-radio-button>
+            </a-radio-group>
+          </a-col>
+          <a-col :span="24">
+              <house-price-scheme-list v-if="priceScheme == '1'"></house-price-scheme-list>
+              <long-rent-scheme v-if="priceScheme == '2'"></long-rent-scheme>
+            </a-col>
+        </a-form-model-item>
+      </a-row>
+    </a-form-model>
+    <house-price-scheme-setting-model ref="housePriceSchemeSetting"></house-price-scheme-setting-model>
+  </div>
+</template>
+
+
+<script>
+import housePriceSchemeDetailList from '@views/settings/components/roomModules/modules/housePriceSchemeDetailList'
+import allDaysRoomFeeRule from '@views/settings/components/roomModules/allDaysRoomFeeRule'
+import hourRoomRuleList from '@views/settings/components/roomModules/hourRoomRule/table'
+import HousePriceSchemeList from '@views/settings/components/roomModules/housePriceSchemeList'
+import longRentScheme from '@views/settings/components/roomModules/longRentScheme'
+import HousePriceSchemeSettingModel from '@views/settings/components/roomModules/housePriceSchemeSettingModel'
+
+export default {
+  name: 'housingPriceSetting',
+  components: {
+    HousePriceSchemeSettingModel,
+    housePriceSchemeDetailList,
+    allDaysRoomFeeRule,
+    hourRoomRuleList,
+    HousePriceSchemeList,
+    longRentScheme
+  },
+  data() {
+    return {
+      setType: '1',
+      priceSetting: '0',
+      chargeRule: '1',
+      priceScheme: '1'
+    }
+  },
+  methods: {
+    openSetting() {
+      this.$refs.housePriceSchemeSetting.edit(this.priceSetting)
+      this.$refs.housePriceSchemeSetting.title = this.priceSetting === '1' ? '设置周末房价执行时间' : '设置法定节假日房价执行时间'
+    }
+  }
+}
+</script>
+
+<style scoped>
+</style>

+ 221 - 0
src/views/settings/components/roomModules/longRentSchemeModel.vue

@@ -0,0 +1,221 @@
+<template>
+  <j-modal
+      :title="title"
+      :width="800"
+      :visible="visible"
+      :destroyOnClose="true"
+      switchFullscreen
+      @ok="handleOk"
+      @cancel="close">
+    <a-form-model >
+      <a-form-model-item
+          label="房价名称"
+          :labelCol="labelCol"
+          :wrapperCol="wrapperCol">
+        <a-col :span="8">
+          <a-input v-model="newScheme.name"></a-input>
+        </a-col>
+      </a-form-model-item>
+      <a-form-model-item
+          label="租金标准"
+          :labelCol="labelCol"
+          :wrapperCol="wrapperCol"
+          prop="">
+        <a-col :span="7">
+          <a-input-number v-model="rentCharges.money" :min="0" placeholder="输入金额" style="width: 100%"></a-input-number>
+        </a-col>
+        <a-col :span="1"><span>元/</span></a-col>
+        <a-col :span="7">
+          <a-input-number v-model="rentCharges.cycleNum" :min="0" placeholder="输入周期" style="width: 80%"></a-input-number> 月
+        </a-col>
+      </a-form-model-item>
+      <a-form-model-item
+          label="押金标准"
+          :labelCol="labelCol"
+          :wrapperCol="wrapperCol"
+          prop="">
+        <a-col :span="10" >
+          <a-input-number v-model="depositCharges.money" :min="0" placeholder="输入金额" style="width: 70%"></a-input-number>
+          <span> 元</span>
+        </a-col>
+      </a-form-model-item>
+
+      <a-form-model-item
+          label="押付方式"
+          :labelCol="labelCol"
+          :wrapperCol="wrapperCol"
+          prop="orderInfo.roomPriceSlnId">
+        <a-col :span="8">
+          <a-select v-model="depositCharges.num">
+            <a-select-option :value="1"> 押1 </a-select-option>
+            <a-select-option :value="2"> 押2 </a-select-option>
+            <a-select-option :value="3"> 押3 </a-select-option>
+          </a-select>
+        </a-col>
+        <a-col :span="8">
+          <a-select v-model="rentCharges.num">
+            <a-select-option :value="1"> 付1 </a-select-option>
+            <a-select-option :value="2"> 付2 </a-select-option>
+            <a-select-option :value="3"> 付3 </a-select-option>
+          </a-select>
+        </a-col>
+      </a-form-model-item>
+      <a-form-model-item
+          label="新增费项"
+          :labelCol="labelCol"
+          :wrapperCol="wrapperCol">
+        <a-col :span="8">
+          <a-select v-model="chargeType">
+            <a-select-option :value="1"> 一次性费项 </a-select-option>
+            <a-select-option :value="2"> 周期性费项 </a-select-option>
+            <a-select-option :value="3"> 抄费类水费 </a-select-option>
+            <a-select-option :value="4"> 抄费类电费 </a-select-option>
+            <a-select-option :value="5"> 抄费类燃气费 </a-select-option>
+          </a-select>
+          <a-button @click="addCharges">添加</a-button>
+
+        </a-col>
+        <a-col :span="24">
+          <a-row v-for="(item, index) in customChargeList">
+            <a-icon
+                type="minus-circle"
+                style="color: #f56c6c"
+                class="dynamic-delete-button"
+                @click="removeCharge(index)"
+            />
+            <a-col :span="5">
+              <a-input v-model="item.name" placeholder="输入费项名称" style="width: 90%"></a-input>
+            </a-col>
+            <a-col :span="5">
+              <a-input-number v-model="item.money":min="0" placeholder="输入金额" style="width: 90%"></a-input-number>
+            </a-col>
+            <a-col :span="2"><span>{{ item.chargeType == 3 ? '元/吨' : (item.chargeType == 4 ? '元/度' : '元') }}</span></a-col>
+            <a-col :span="5" v-if="item.chargeType == 2">
+              <a-input-number v-model="item.cycleNum" :min="0" placeholder="输入周期" style="width: 90%"></a-input-number>
+            </a-col>
+            <a-col :span="1" v-if="item.chargeType == 2"><span>月</span></a-col>
+          </a-row>
+        </a-col>
+      </a-form-model-item>
+    </a-form-model>
+  </j-modal>
+
+</template>
+
+<script>
+
+let hotelInfo = JSON.parse(localStorage.getItem('storeInfo'))
+import { httpAction, getAction, postAction } from '@/api/manage'
+export default {
+  name: 'longRentSchemeModel',
+
+  watch:{
+    // 'rentCharges.money'(newValue) {
+    //   if (!this.depositCharges.isDepositCustom) {
+    //     this.depositCharges.money = newValue
+    //   }
+    // }
+  },
+  data() {
+    return {
+      title: '',
+      visible: false,
+      url: '',
+      labelCol: {
+        xs: { span: 24 },
+        sm: { span: 7 }
+      },
+      wrapperCol: {
+        xs: { span: 24 },
+        sm: { span: 16 }
+      },
+      // 自定义费项
+      customChargeList: [],
+      // 新增时选择的费项类型
+      chargeType: 1,
+      rentCharges: {
+        name: '租金',
+        chargeType: 2,
+        isMust: true
+      },
+      depositCharges: {
+        name: '押金',
+        chargeType: 1,
+        isMust: true
+      },
+      newScheme: {}
+    };
+  },
+  created() {
+
+  },
+  methods: {
+    add() {
+      this.url = 'rooms/cesHouseLongRentScheme/add'
+    },
+    edit(record) {
+      this.url = 'rooms/cesHouseLongRentScheme/edit'
+      this.newScheme = record
+      this.depositCharges = record.houseLongRentChargeList.find(e => e.isMust && e.chargeType === 1)
+      this.rentCharges = record.houseLongRentChargeList.find(e => e.isMust && e.chargeType === 2)
+      this.customChargeList = record.houseLongRentChargeList.filter(e => !e.isMust)
+    },
+    addCharges() {
+      if (this.chargeType == null) {
+        this.$message.warning('请先选择要添加的费项')
+        return
+      }
+      let charge = {
+        name: null,
+        chargeType: this.chargeType,
+        money: null,
+        cycleUnit: null
+      }
+      this.customChargeList.push(charge)
+      this.$forceUpdate()
+    },
+    /** 移除新增费项目 */
+    removeCharge(index) {
+      console.log(index, 'index')
+      this.customChargeList.splice(index,1)
+    },
+    close() {
+      this.visible = false
+      Object.assign(this.$data, this.$options.data())
+    },
+    handleOk() {
+      console.log(this.depositCharges)
+      console.log(this.rentCharges)
+      console.log(this.customChargeList)
+      let chargeList = JSON.parse(JSON.stringify(this.customChargeList))
+      chargeList.push(this.depositCharges)
+      chargeList.push(this.rentCharges)
+      this.newScheme.houseLongRentChargeList = chargeList
+      postAction(this.url, this.newScheme
+      ).then((res) => {
+        if (res.success) {
+          this.$message.success(res.message)
+          this.$emit('ok')
+          this.visible = false
+          Object.assign(this.$data, this.$options.data())
+        } else {
+          this.$message.warning(res.message)
+        }
+      })
+    }
+  }
+};
+</script>
+<style scoped>
+@import "~@assets/less/common.less";
+
+.dynamic-delete-button {
+  cursor: pointer;
+  position: relative;
+  /* top: 4px; */
+  margin-left: 5px;
+  font-size: 18px;
+  color: #1890ff;
+  transition: all 0.3s;
+}
+</style>

+ 189 - 161
src/views/settings/components/roomModules/modules/housePriceSchemeDetailList.vue

@@ -1,65 +1,92 @@
 <template>
-    <a-card :bordered="false" :schemeId="schemeId">
-        <!-- <a-radio-group v-model="tablemode" :style="{ marginBottom: '8px' }">
+  <a-card :bordered="false" :schemeId="schemeId">
+    <!-- <a-radio-group v-model="tablemode" :style="{ marginBottom: '8px' }">
             <a-radio-button value="ordinaryDays">平日房价</a-radio-button>
             <a-radio-button value="weekend">周末房价</a-radio-button>
         </a-radio-group> -->
-        <div>
-            <a-table ref="table" size="middle" :scroll="{ x: true }" bordered rowKey="id" :columns="columns"
-                     :dataSource="handlelistData" :pagination="ipagination" :loading="loading" :rowSelection="{
-                    selectedRowKeys: selectedRowKeys,
-                    onChange: onSelectChange,
-                }" class="j-table-force-nowrap" @change="handleTableChange"
-                :rowKey="(record, index) => index + 1">
-                <template slot="openSlot" slot-scope="text, record, index">
-                    <a-switch checked-children="开" un-checked-children="关" default-checked :checked="record.open == 1"
-                              @change="e=>changeOpenState(e,record)" />
-                </template>
-                <template slot="moneySlot" slot-scope="text, record">
-                    <div>
-                        <a-input-number v-model="record.money" :step="1" :min="0" :precision="2"
-                                        @blur="onMoneyChange(record)" />
-                    </div>
-                </template>
-                <template slot="layoutPrice" slot-scope="text, record">
-                    <div>
-                        {{ record.layoutPrice }}
-                    </div>
-                </template>
-                <template slot="breakfastNumberSlot" slot-scope="text, record">
-                    <div>
-                        <a-input-number v-model="record.breakfastNumber" :step="1" :min="0" :precision="0"
-                                        @blur="onNumberChange(record)" />
-                    </div>
-                </template>
-                <template slot="departureTimeSlot" slot-scope="text, record">
-                    <div>
-                        <a-time-picker :default-value="moment(record.departureTime, 'HH:mm')" format="HH:mm"
-                                       @change="e=>onDepartureTimeChange(e,record)">
-                        </a-time-picker>
-                    </div>
-                </template>
-                <template slot="imgSlot" slot-scope="text, record">
-                    <span v-if="!text" style="font-size: 12px; font-style: italic">无图片</span>
-                    <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt=""
-                         style="max-width: 80px; font-size: 12px; font-style: italic" />
-                </template>
-                <template slot="fileSlot" slot-scope="text">
-                    <span v-if="!text" style="font-size: 12px; font-style: italic">无文件</span>
-                    <a-button v-else :ghost="true" type="primary" icon="download" size="small"
-                              @click="downloadFile(text)">
-                        下载
-                    </a-button>
-                </template>
+    <div>
+      <a-table
+        ref="table"
+        size="middle"
+        :scroll="{ x: true }"
+        bordered
+        rowKey="id"
+        :columns="columns"
+        :dataSource="handlelistData"
+        :pagination="ipagination"
+        :loading="loading"
+        :rowSelection="{
+          selectedRowKeys: selectedRowKeys,
+          onChange: onSelectChange,
+        }"
+        class="j-table-force-nowrap"
+        @change="handleTableChange"
+        :rowKey="(record, index) => index + 1">
+        <template slot="openSlot" slot-scope="text, record, index">
+          <a-switch
+            checked-children="开"
+            un-checked-children="关"
+            default-checked
+            :checked="record.open == 1"
+            @change="e=>changeOpenState(e,record)" />
+        </template>
+        <template slot="money" slot-scope="text, record">
+          <a @click="editMoney(record)">{{ text }}</a>
+        </template>
+        <!--        <template slot="breakfastNumberSlot" slot-scope="text, record">-->
+        <!--          <div>-->
+        <!--            <a-input-number-->
+        <!--              v-model="record.breakfastNumber"-->
+        <!--              :step="1"-->
+        <!--              :min="0"-->
+        <!--              :precision="0"-->
+        <!--              @blur="onNumberChange(record)" />-->
+        <!--          </div>-->
+        <!--        </template>-->
+        <template slot="departureTimeSlot" slot-scope="text, record">
+          <div>
+            <a-time-picker
+              :default-value="moment(record.departureTime, 'HH:mm')"
+              format="HH:mm"
+              @change="e=>onDepartureTimeChange(e,record)">
+            </a-time-picker>
+          </div>
+        </template>
+        <template slot="imgSlot" slot-scope="text, record">
+          <span v-if="!text" style="font-size: 12px; font-style: italic">无图片</span>
+          <img
+            v-else
+            :src="getImgView(text)"
+            :preview="record.id"
+            height="25px"
+            alt=""
+            style="max-width: 80px; font-size: 12px; font-style: italic" />
+        </template>
+        <template slot="fileSlot" slot-scope="text">
+          <span v-if="!text" style="font-size: 12px; font-style: italic">无文件</span>
+          <a-button
+            v-else
+            :ghost="true"
+            type="primary"
+            icon="download"
+            size="small"
+            @click="downloadFile(text)">
+            下载
+          </a-button>
+        </template>
 
-                <span slot="action" slot-scope="text, record" class="operationBtn_style">
-                    <a @click="handleReset(record)">重置</a>
-                    <a @click="handleMoney(record)">房价日历</a>
-                </span>
-            </a-table>
-        </div>
-        <house-price-scheme-layout-modal ref="modalForm" @ok="modalFormOk"></house-price-scheme-layout-modal>
-    </a-card>
+        <span slot="action" slot-scope="text, record" class="operationBtn_style">
+          <a @click="handleReset(record)">重置</a>
+          <a @click="handleMoney(record)">房价日历</a>
+        </span>
+      </a-table>
+    </div>
+    <house-price-scheme-layout-modal ref="modalForm" @ok="modalFormOk"></house-price-scheme-layout-modal>
+
+    <a-modal :visible="visible" title="修改前台价" @ok="editMoneyOk" @cancel="visible = !visible">
+      <a-input-number style="width: 100%;margin: auto" v-model="choosePriceSchemeLayout.money" />
+    </a-modal>
+  </a-card>
 </template>
 
 <script>
@@ -68,13 +95,13 @@
     import '@/assets/less/TableExpand.less'
     import { mixinDevice } from '@/utils/mixin'
     import { JeecgListMixin } from '@/mixins/JeecgListMixin'
-    import moment from 'moment';
+    import moment from 'moment'
     import { httpAction, getAction } from '@/api/manage'
-    import HousePriceSchemeLayoutModal from "./housePriceSchemeLayout/housePriceSchemeLayoutModal";
+    import HousePriceSchemeLayoutModal from './housePriceSchemeLayout/housePriceSchemeLayoutModal'
 
     export default {
-        name: 'housePriceSchemeDetailList',
-        mixins:[JeecgListMixin, mixinDevice],
+        name: 'HousePriceSchemeDetailList',
+        mixins: [JeecgListMixin, mixinDevice],
         components: {
             HousePriceSchemeLayoutModal
         },
@@ -82,8 +109,14 @@
             schemeId: {
                 type: String,
                 default: () => {
-                    return ""
+                    return ''
                 }
+            },
+            typess: {
+              type: Number,
+              default: () => {
+                return null
+              }
             }
         },
         data () {
@@ -92,13 +125,13 @@
                 // 表头
                 columns: [
                     {
-                        title: "序号",
+                        title: '序号',
                         align: 'center',
-                        customRender: (text, record, index) => index + 1,
+                        customRender: (text, record, index) => index + 1
                     },
                     {
-                        title:'房型',
-                        align:"center",
+                        title: '房型',
+                        align: 'center',
                         dataIndex: 'layoutName'
                     },
                     // {
@@ -112,24 +145,19 @@
                     //     dataIndex: 'layoutPrice'
                     // },
                     {
-                        title:'挂牌价(元)',
-                        align:"center",
-                        // dataIndex: 'layoutPrice',
-                        customRender(text, record) {
-                            return record.layoutPrice
-                        }
+                        title: '挂牌价(元)',
+                        align: 'center',
+                        dataIndex: 'layoutPrice'
                     },
                     {
-                        title:'前台价(散客)',
-                        align:"center",
-                        // dataIndex: 'layoutPrice',
-                        customRender(text, record) {
-                            return record.layoutPrice
-                        }
+                        title: '前台价(散客)',
+                        align: 'center',
+                        dataIndex: 'money',
+                        scopedSlots: { customRender: 'money' }
                     },
                     {
-                        title:'微信小程序(散客)',
-                        align:"center",
+                        title: '微信小程序(散客)',
+                        align: 'center',
                         // dataIndex: 'layoutPrice',
                         customRender(text, record) {
                             return record.layoutPrice
@@ -181,26 +209,27 @@
                     {
                         title: '查看每日房价',
                         dataIndex: 'action',
-                        align:"center",
-                        fixed:"right",
-                        width:180,
+                        align: 'center',
+                        fixed: 'right',
+                        width: 180,
                         scopedSlots: { customRender: 'action' }
                     }
                 ],
                 url: {
-                    list: "/business/busHousePriceSchemeLayout/list",
-                    delete: "/business/busHousePriceSchemeLayout/delete",
-                    deleteBatch: "/business/busHousePriceSchemeLayout/deleteBatch",
-                    exportXlsUrl: "/business/busHousePriceSchemeLayout/exportXls",
-                    importExcelUrl: "business/busHousePriceSchemeLayout/importExcel",
-                    editMoney: "/business/busHousePriceSchemeLayout/editMoney",
-                    editNumber: "/business/busHousePriceSchemeLayout/editNumber",
-                    editTime: "/business/busHousePriceSchemeLayout/editTime",
+                    list: '/business/busHousePriceSchemeLayout/list',
+                    delete: '/business/busHousePriceSchemeLayout/delete',
+                    deleteBatch: '/business/busHousePriceSchemeLayout/deleteBatch',
+                    exportXlsUrl: '/business/busHousePriceSchemeLayout/exportXls',
+                    importExcelUrl: 'business/busHousePriceSchemeLayout/importExcel',
+                    editMoney: '/business/busHousePriceSchemeLayout/editMoney',
+                    editNumber: '/business/busHousePriceSchemeLayout/editNumber',
+                    editTime: '/business/busHousePriceSchemeLayout/editTime'
                 },
-                dictOptions:{},
-                superFieldList:[],
+                dictOptions: {},
+                superFieldList: [],
                 queryParam: {
-                  schemeId: this.schemeId
+                  schemeId: this.schemeId,
+                  type: this.typess
                 },
                 tablemode: 'ordinaryDays',
                 // 会员参数
@@ -210,14 +239,15 @@
                 // 列表数据处理
                 handlelistData: [],
                 // 钟点房参数
-                hourlyRoomList: []
-
+                hourlyRoomList: [],
+                visible: false,
+                choosePriceSchemeLayout: {}
             }
         },
          created() {
             // console.log(JeecgListMixin);
-            this.getSuperFieldList();
-
+            this.getSuperFieldList()
+           console.log(this.typess, '2222222222')
             // console.log(this.dataSource);
             // console.log(this.dataSource);
         },
@@ -231,33 +261,31 @@
             this.getHourlyRoom()
             // 获取会员方案
             this.getMember()
-            console.log(this.handlelistData);
+            console.log(this.handlelistData)
             // console.log(this.memberList);
-
-
         },
         computed: {
-            importExcelUrl: function(){
-                return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
-            },
+            importExcelUrl: function() {
+                return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
+            }
         },
         methods: {
             moment,
-            initDictConfig(){
+            initDictConfig() {
             },
             // 拿到会员
             async getMember() {
-                await getAction("/org.jeecg.modules.business/busMarketMember/list", {
+                await getAction('/org.jeecg.modules.business/busMarketMember/list', {
                     pageNo: 1,
-                    pageSize: 100,
+                    pageSize: 100
                 }).then(res => {
-                    console.log(res);
+                    console.log(res)
                     this.memberList = res.result.records
                 })
                 let templist = {
                     title: '会员',
                     children: [
-                    ],
+                    ]
                 }
                 this.memberList.forEach(item => {
                     let tempchildren = {
@@ -266,9 +294,8 @@
                         discount: item.discount
                     }
                     templist.children.push(tempchildren)
-
                 })
-                this.columns.splice(5,0,templist)
+                this.columns.splice(5, 0, templist)
                 // this.memberList = templist
                 this.handlelistData.forEach(item => {
                     templist.children.forEach(index => {
@@ -290,7 +317,7 @@
             let templist = {
                     title: '协议',
                     children: [
-                    ],
+                    ]
                 }
                 this.agreementList.forEach(item => {
                     let tempchildren = {
@@ -299,9 +326,8 @@
                         discount: item.marketAgreementCustomer.discount
                     }
                     templist.children.push(tempchildren)
-
                 })
-                this.columns.splice(5,0,templist)
+                this.columns.splice(5, 0, templist)
                 // this.memberList = templist
                 this.handlelistData.forEach(item => {
                     templist.children.forEach(index => {
@@ -312,16 +338,16 @@
             // 获取钟点房
             async getHourlyRoom() {
                 await getAction('/rooms/cesHourRoomRule/list', {
-                    pageNo:1,
-                    pageSize:999
+                    pageNo: 1,
+                    pageSize: 999
                 }).then(res => {
-                    console.log(res);
+                    console.log(res)
                     this.hourlyRoomList = res.result.records
                 })
                 let templist = {
                     title: '钟点房价(元/分钟)',
                     children: [
-                    ],
+                    ]
                 }
                 this.hourlyRoomList.forEach(item => {
                     let tempchildren = {
@@ -331,9 +357,8 @@
                         duration: item.afterOpenRoomPay + '元' + '/' + item.afterOpenRoom + '分钟'
                     }
                     templist.children.push(tempchildren)
-
                 })
-                this.columns.splice(5,0,templist)
+                this.columns.splice(5, 0, templist)
                 // this.memberList = templist
                 this.handlelistData.forEach(item => {
                     templist.children.forEach(index => {
@@ -341,43 +366,23 @@
                     })
                 })
             },
-            getSuperFieldList(){
-                let fieldList=[];
-                fieldList.push({type:'string',value:'tenantId',text:'关联租户'})
-                fieldList.push({type:'string',value:'hotelId',text:'关联酒店'})
-                fieldList.push({type:'string',value:'schemeId',text:'关联房价方案'})
-                fieldList.push({type:'string',value:'layoutId',text:'关联房型'})
-                fieldList.push({type:'number',value:'money',text:'执行房价'})
-                fieldList.push({type:'date',value:'departureTime',text:'默认离店时间'})
-                fieldList.push({type:'int',value:'breakfastNumber',text:'早餐数量'})
-                fieldList.push({type:'int',value:'lunchNumber',text:'中餐数量'})
-                fieldList.push({type:'int',value:'dinnerNumber',text:'晚餐数量'})
-                fieldList.push({type:'int',value:'delFlag',text:'删除状态'})
+            getSuperFieldList() {
+                let fieldList = []
+                fieldList.push({ type: 'string', value: 'tenantId', text: '关联租户' })
+                fieldList.push({ type: 'string', value: 'hotelId', text: '关联酒店' })
+                fieldList.push({ type: 'string', value: 'schemeId', text: '关联房价方案' })
+                fieldList.push({ type: 'string', value: 'layoutId', text: '关联房型' })
+                fieldList.push({ type: 'number', value: 'money', text: '执行房价' })
+                fieldList.push({ type: 'date', value: 'departureTime', text: '默认离店时间' })
+                fieldList.push({ type: 'int', value: 'breakfastNumber', text: '早餐数量' })
+                fieldList.push({ type: 'int', value: 'lunchNumber', text: '中餐数量' })
+                fieldList.push({ type: 'int', value: 'dinnerNumber', text: '晚餐数量' })
+                fieldList.push({ type: 'int', value: 'delFlag', text: '删除状态' })
                 this.superFieldList = fieldList
             },
-            onMoneyChange(record){
-                var that = this;
-                //修改执行房价
-                var param = {
-                    money: record.money,
-                    id: record.id
-                }
-                console.log(param)
-
-                httpAction(this.url.editMoney, param, 'post').then((res) => {
-                    if (res.success) {
-                        that.$message.success('操作成功')
-                        that.$emit('ok')
-                    } else {
-                        that.$message.warning(res.message)
-                    }
-                }).finally(() => {
-                    that.confirmLoading = false
-                })
-            },
-            onNumberChange(record){
-                //修改早餐数量
-                var that = this;
+            onNumberChange(record) {
+                // 修改早餐数量
+                var that = this
                 var param = {
                     breakfastNumber: record.breakfastNumber,
                     id: record.id
@@ -394,11 +399,11 @@
                     that.confirmLoading = false
                 })
             },
-            onDepartureTimeChange(e,record){
+            onDepartureTimeChange(e, record) {
                 var _time = moment(new Date(e)).format('HH:mm:ss')
                 console.log(_time)
-                //修改时间
-                var that = this;
+                // 修改时间
+                var that = this
                 var param = {
                     departureTime: _time,
                     id: record.id
@@ -415,10 +420,33 @@
                     that.confirmLoading = false
                 })
             },
-            handleMoney(record){
-                this.$refs.modalForm.title="每日房价"
+            handleMoney(record) {
+                this.$refs.modalForm.title = '每日房价'
                 this.$refs.modalForm.visible = true
-                this.$refs.modalForm.edit(record);
+                this.$refs.modalForm.edit(record)
+            },
+            editMoney(record) {
+              this.visible = true
+              this.choosePriceSchemeLayout = record
+            },
+            editMoneyOk() {
+              var that = this
+              // 修改执行房价
+              var param = {
+                money: this.choosePriceSchemeLayout.money,
+                id: this.choosePriceSchemeLayout.id
+              }
+              httpAction(this.url.editMoney, param, 'post').then((res) => {
+                if (res.success) {
+                  this.$message.success('操作成功')
+                  this.$emit('ok')
+                } else {
+                  this.$message.warning(res.message)
+                }
+              }).finally(() => {
+                this.visible = false
+                this.confirmLoading = false
+              })
             },
             // 重置按钮
             handleReset() {

+ 231 - 265
src/views/settings/components/roomModules/modules/housePriceSchemeForm.vue

@@ -1,312 +1,278 @@
 <template>
-    <a-spin :spinning="confirmLoading">
-        <j-form-container :disabled="formDisabled">
-            <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
-                <a-form-model-item label="房价方案" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="priceScheme">
-                    <a-input v-model="model.priceScheme" placeholder="请输入房价方案" allowClear></a-input>
-                </a-form-model-item>
-                <a-form-model-item label="编号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="number">
-                    <a-input v-model="model.number" placeholder="请输入编号"></a-input>
-                </a-form-model-item>
-                <a-form-model-item label="客人来源" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="guestSource">
-                    <a-select
-                            v-model="model.guestSource"
-                            placeholder="请选择客人来源"
-                            :allowClear="true"
-                    >
-                        <a-select-option :value="item.id" v-for="(item,index) in customerSourceList" :key="index">{{ item.itemText }}</a-select-option>
-                    </a-select>
-                </a-form-model-item>
-                <a-form-model-item label="客人类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="guestType">
-                    <a-row>
-                        <a-col :span="10">
-                            <a-select
-                                    style="width: 100%"
-                                    v-model="model.guestType"
-                                    placeholder="请选择客人类型"
-                                    :allowClear="true"
-                                    @change="e=>handleGuestType(e)"
-                            >
-                                <a-select-option :value="undefined">请选择</a-select-option>
-                                <a-select-option :value="item.value" v-for="item in guestTypeList" :key="item.value">{{ item.text }}</a-select-option>
-                            </a-select>
-                        </a-col>
-                        <a-col :span="8">
-                            <a-select
-                                    v-if="model.guestType == 2"
-                                    style="width: 100%"
-                                    v-model="model.martketMemberId"
-                                    placeholder="请选择会员"
-                                    :allowClear="true"
-                                    @change="e=>handleGuestType(e)"
-                            >
-                                <a-select-option :value="undefined">请选择</a-select-option>
-                                <a-select-option :value="item.id" v-for="item in customerList" :key="item.id">{{ item.name }}</a-select-option>
-                            </a-select>
+  <a-spin :spinning="confirmLoading">
+    <j-form-container :disabled="formDisabled">
+      <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
+        <a-form-model-item label="房价方案" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="priceScheme">
+          <a-input v-model="model.priceScheme" placeholder="请输入房价方案" allowClear></a-input>
+        </a-form-model-item>
+        <!--                <a-form-model-item label="编号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="number">-->
+        <!--                    <a-input v-model="model.number" placeholder="请输入编号"></a-input>-->
+        <!--                </a-form-model-item>-->
+        <a-form-model-item label="客人类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="guestType">
+          <a-row>
+            <a-col :span="10">
+              <a-select
+                style="width: 100%"
+                v-model="model.guestType"
+                placeholder="请选择客人类型"
+                :allowClear="true"
+                @change="e=>handleGuestType(e)"
+              >
+                <a-select-option :value="undefined">请选择</a-select-option>
+                <a-select-option :value="item.value" v-for="item in guestTypeList" :key="item.value">{{ item.text }}</a-select-option>
+              </a-select>
+            </a-col>
+            <a-col :span="8">
+              <a-select
+                v-if="model.guestType == 2"
+                style="width: 100%"
+                v-model="model.martketMemberId"
+                placeholder="请选择会员"
+                :allowClear="true"
+                @change="e=>handleGuestType(e)"
+              >
+                <a-select-option :value="undefined">请选择</a-select-option>
+                <a-select-option :value="item.id" v-for="item in customerList" :key="item.id">{{ item.name }}</a-select-option>
+              </a-select>
 
-                            <a-select
-                                    v-if="model.guestType == 3"
-                                    style="width: 100%"
-                                    v-model="model.agreementUnitId"
-                                    placeholder="请选择协议单位"
-                                    :allowClear="true"
-                                    @change="e=>handleGuestType(e)"
-                            >
-                                <a-select-option :value="undefined">请选择</a-select-option>
-                                <a-select-option :value="item.id" v-for="item in agreementUnitList" :key="item.id">{{ item.customerName }}</a-select-option>
-                            </a-select>
+              <a-select
+                v-if="model.guestType == 3"
+                style="width: 100%"
+                v-model="model.agreementUnitId"
+                placeholder="请选择协议单位"
+                :allowClear="true"
+                @change="e=>handleGuestType(e)"
+              >
+                <a-select-option :value="undefined">请选择</a-select-option>
+                <a-select-option :value="item.id" v-for="item in agreementUnitList" :key="item.id">{{ item.customerName }}</a-select-option>
+              </a-select>
 
-                            <a-input v-if="model.guestType == 4" style="width: 90%;margin: auto;" v-model="model.mediation" placeholder="请输入名称/简介/联系人"></a-input>
-                        </a-col>
-                    </a-row>
-                </a-form-model-item>
-                <a-form-model-item label="入住时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="checkInTime">
-                    <a-radio-group v-model="model.checkInTime">
-                        <a-radio :value="0">无限制</a-radio>
-                        <a-radio :value="1">时间段</a-radio>
-                    </a-radio-group>
-                    <a-row>
-                        <a-col :span="16">
-                            <a-range-picker @change="onCheckTimeChange" v-model="checkTimeRange" format="YYYY-MM-DD 00:00:00" v-if="model.checkInTime == 1" />
-                        </a-col>
-                    </a-row>
-                </a-form-model-item>
-                <a-form-model-item label="周末假日" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="weekends">
-                    <a-checkbox-group v-model="model.weekends" @change="onChange">
-                        <a-checkbox :value="item.value" v-for="item in weeks" :key="item.value">
-                            {{ item.text }}
-                        </a-checkbox>
-                    </a-checkbox-group>
-                </a-form-model-item>
-                <a-form-model-item label="节假日" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="holiday">
-                    <a-date-picker valueFormat="YYYY-MM-DD"
-                                   v-model="model.holiday"
-                                   :open='open'
-                                   type="dates"
-                                   :showToday="false"
-                                   @ok="handleOk"
-                                   @change="handleChange"
-                                   @openChange="openChangeOne"
-                                   @panelChange="panelChangeOne">
-                        <template slot="renderExtraFooter" style="float: right">
-                            <a-button slot="addon" size="small" @click="handleHolidCancel">
-                                取消
-                            </a-button>
-                            <a-button class="margin_left_6" slot="addon" size="small" type="primary" @click="handleHolidConfirm">
-                                确定
-                            </a-button>
-                        </template>
-                    </a-date-picker>
-                </a-form-model-item>
-                <a-form-model-item label="有效期" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="validTime">
-                    <a-radio-group v-model="model.validTime">
-                        <a-radio :value="0">无限制</a-radio>
-                        <a-radio :value="1">时间段</a-radio>
-                    </a-radio-group>
-                    <a-row>
-                        <a-col :span="16">
-                            <a-range-picker @change="onValidTimeChange" v-model="validTimeRange" format="YYYY-MM-DD 00:00:00" v-if="model.validTime == 1" />
-                        </a-col>
-                    </a-row>
-                </a-form-model-item>
-                <a-form-model-item label="是否开启" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="openValue">
-                    <a-switch checked-children="开启" un-checked-children="关闭" default-checked
-                              v-model="model.openValue"
-                              @change="e=>onOpenChange(e)"/>
-                </a-form-model-item>
+              <a-input v-if="model.guestType == 4" style="width: 90%;margin: auto;" v-model="model.mediation" placeholder="请输入名称/简介/联系人"></a-input>
+            </a-col>
+          </a-row>
+        </a-form-model-item>
+        <a-form-model-item label="有效期" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="validTime">
+          <a-radio-group v-model="model.validTime">
+            <a-radio :value="0">无限制</a-radio>
+            <a-radio :value="1">时间段</a-radio>
+          </a-radio-group>
+          <a-row>
+            <a-col :span="16">
+              <a-range-picker @change="onValidTimeChange" v-model="validTimeRange" format="YYYY-MM-DD 00:00:00" v-if="model.validTime == 1" />
+            </a-col>
+          </a-row>
+        </a-form-model-item>
+        <a-form-model-item label="入住时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="checkInTime">
+          <a-radio-group v-model="model.checkInTime">
+            <a-radio :value="0">无限制</a-radio>
+            <a-radio :value="1">时间段</a-radio>
+          </a-radio-group>
+          <a-row>
+            <a-col :span="16" v-if="model.checkInTime == 1">
+              <a-time-picker v-model="startTime" format="HH:mm"></a-time-picker>
+              <a-time-picker v-model="endTime" format="HH:mm"></a-time-picker>
+            </a-col>
+          </a-row>
+        </a-form-model-item>
 
-                <a-form-model-item label="排序" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="sort">
-                    <a-input-number style="width:50%;" v-model="model.sort" :min="0"  placeholder="请填写排序"/>
-                </a-form-model-item>
-            </a-form-model>
+        <a-form-model-item label="是否开启" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="openValue">
+          <a-switch
+            checked-children="开启"
+            un-checked-children="关闭"
+            default-checked
+            v-model="model.openValue"
+            @change="e=>onOpenChange(e)"/>
+        </a-form-model-item>
 
-        </j-form-container>
-    </a-spin>
+        <!--                <a-form-model-item label="排序" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="sort">-->
+        <!--                    <a-input-number style="width:50%;" v-model="model.sort" :min="0"  placeholder="请填写排序"/>-->
+        <!--                </a-form-model-item>-->
+      </a-form-model>
+
+    </j-form-container>
+  </a-spin>
 </template>
 <script>
-    import { getRoomPlans, getSelectList } from "@/api/api";
-    import { httpAction, getAction } from "@/api/manage";
-    import { validateDuplicateValue } from "@/utils/util";
+    import { getRoomPlans, getSelectList } from '@/api/api'
+    import { httpAction, getAction } from '@/api/manage'
     import { initDictOptions } from '@/components/dict/JDictSelectUtil'
     import moment from 'moment'
+    import dayjs from 'dayjs'
     export default {
-        name: "housePriceSchemeForm",
+        name: 'HousePriceSchemeForm',
         props: {
             disabled: {
                 type: Boolean,
                 default: false,
-                required: false,
-            },
+                required: false
+            }
         },
         data() {
             return {
                 model: {
-                    weekends:[],
+                    // weekends:[],
                 },
                 labelCol: {
                     xs: { span: 24 },
-                    sm: { span: 5 },
+                    sm: { span: 5 }
                 },
                 wrapperCol: {
                     xs: { span: 24 },
-                    sm: { span: 16 },
+                    sm: { span: 16 }
                 },
                 confirmLoading: false,
                 validatorRules: {
-                    priceScheme: [{ required: true, message: "请输入房价方案!" }],
-                    number: [{ required: true, message: "请输入编号!" }],
-                    guestSource: [{ required: true, message: "请选择客人来源!" }],
-                    guestType: [{ required: true, message: "请选择客人类型!" }],
-                    checkInTime: [{ required: true, message: "请选择入住时间!" }],
-                    validTime: [{ required: true, message: "请选择有效期!" }],
-                    open: [{ required: true, message: "请选择是否开启!" }],
-                    sort: [{ required: true, message: "请填写排序!" }],
+                    priceScheme: [{ required: true, message: '请输入房价方案!' }],
+                    guestType: [{ required: true, message: '请选择客人类型!' }],
+                    checkInTime: [{ required: true, message: '请选择入住时间!' }],
+                    validTime: [{ required: true, message: '请选择有效期!' }],
+                    open: [{ required: true, message: '请选择是否开启!' }]
                 },
                 url: {
-                    add: "/rooms/cesHousePriceScheme/save",
-                    edit: "/rooms/cesHousePriceScheme/modify",
-                    queryById: "/rooms/cesHousePriceScheme/queryById",
-                    queryCustomerList:'/org.jeecg.modules.business/busMarketMember/queryList',
-                    queryAgreementUnitList:'/business/busMarketAgreementUnit/queryList',
+                    add: '/rooms/cesHousePriceScheme/save',
+                    edit: '/rooms/cesHousePriceScheme/modify',
+                    queryById: '/rooms/cesHousePriceScheme/queryById',
+                    queryCustomerList: '/org.jeecg.modules.business/busMarketMember/queryList',
+                    queryAgreementUnitList: '/business/busMarketAgreementUnit/queryList'
                 },
                 iconChooseVisible: false,
-                customerSourceList:[],
-                guestTypeList:[],
-                weeks:[],
+                customerSourceList: [],
+                guestTypeList: [],
+                // weeks:[],
                 open: false,
-                customerList:[],
-                agreementUnitList:[],
-                checkTimeRange:[],
-                validTimeRange:[],
-            };
+                customerList: [],
+                agreementUnitList: [],
+                checkTimeRange: [],
+                validTimeRange: [],
+                startTime: null,
+                endTime: null
+            }
         },
         computed: {
             formDisabled() {
-                return this.disabled;
-            },
+                return this.disabled
+            }
         },
         created() {
-            var _info = JSON.parse(localStorage.getItem("storeInfo"));
+            var _info = JSON.parse(localStorage.getItem('storeInfo'))
             if (_info) {
-                this.model.hotelId = _info.id;
-                this.initData();
-                this.getDictConfig();
+                this.model.hotelId = _info.id
+                this.initData()
+                this.getDictConfig()
             }
-            this.modelDefault = JSON.parse(JSON.stringify(this.model));
+            this.modelDefault = JSON.parse(JSON.stringify(this.model))
         },
         methods: {
             initData() {
                 getRoomPlans(this.model.hotelId, null).then((res) => {
                     if (res.success) {
-                        this.roomPlans = res.result;
+                        this.roomPlans = res.result
                     }
-                });
-
-            },
-            getDictConfig(){
-                var that = this;
-                //客户来源
-                var param = {
-                    dictName:'客人来源设置'
-                }
-                // var values = JSON.parse(JSON.stringify(param))
-                that.confirmLoading = true;
-                getAction('/business/busDictItem/queryList',param).then((res)=>{
-                    console.log(res)
-                    if(res.success){
-                        if (res.code == 200 && res.result) {
-                            this.customerSourceList = res.result;
-                            this.model.guestSource = res.result[0].id;
-                        }
-                    }
-                }).finally(() => {
-                    that.confirmLoading = false;
                 })
+            },
+            getDictConfig() {
+                var that = this
+                // 客户来源
+                // var param = {
+                //     dictName:'客人来源设置'
+                // }
+                // // var values = JSON.parse(JSON.stringify(param))
+                // that.confirmLoading = true;
+                // getAction('/business/busDictItem/queryList',param).then((res)=>{
+                //     console.log(res)
+                //     if(res.success){
+                //         if (res.code == 200 && res.result) {
+                //             this.customerSourceList = res.result;
+                //             this.model.guestSource = res.result[0].id;
+                //         }
+                //     }
+                // }).finally(() => {
+                //     that.confirmLoading = false;
+                // })
 
-                //初始化字典 - 客人类型
+                // 初始化字典 - 客人类型
                 initDictOptions('guest_type').then((res) => {
                     if (res.success) {
-                        this.guestTypeList = res.result;
-                    }
-                    this.model.guestType = res.result[0].value;
-                });
-                //初始化字典 - 客人类型
-                initDictOptions('house_price_zmjr').then((res) => {
-                    if (res.success) {
-                        that.weeks = res.result;
+                        this.guestTypeList = res.result
                     }
-                });
+                    this.model.guestType = res.result[0].value
+                })
+                // 初始化字典 - 客人类型
+                // initDictOptions('house_price_zmjr').then((res) => {
+                //     if (res.success) {
+                //         that.weeks = res.result;
+                //     }
+                // });
 
-                getAction(this.url.queryCustomerList,{}).then((res)=>{
-                    if(res.success){
+                getAction(this.url.queryCustomerList, {}).then((res) => {
+                    if (res.success) {
                         this.customerList = res.result
-                    }else{
+                    } else {
 
                     }
                 })
 
-                getAction(this.url.queryAgreementUnitList,{}).then((res)=>{
-                    if(res.success){
+                getAction(this.url.queryAgreementUnitList, {}).then((res) => {
+                    if (res.success) {
                         this.agreementUnitList = res.result
-                    }else{
+                    } else {
 
                     }
                 })
             },
             selectIcons() {
-                this.iconChooseVisible = true;
+                this.iconChooseVisible = true
             },
             handleIconCancel() {
-                this.iconChooseVisible = false;
+                this.iconChooseVisible = false
             },
             handleIconChoose(value) {
-                console.log(value);
-                this.model.icon = value;
-                this.iconChooseVisible = false;
+                console.log(value)
+                this.model.icon = value
+                this.iconChooseVisible = false
             },
             add() {
-                this.edit(this.modelDefault);
+                this.edit(this.modelDefault)
             },
             edit(record) {
                 let _record = record
-                _record.guestType = record.guestType.toString();
-                if (record.id){
-                    if (record.open == 1){
-                        _record.openValue =true
-                    }else{
-                        _record.openValue =false
+                // _record.guestType = record.guestType.toString();
+                if (record.id) {
+                    if (record.open == 1) {
+                        _record.openValue = true
+                    } else {
+                        _record.openValue = false
                     }
 
-                    if (record.weekend.length > 0){
-                        _record.weekends = record.weekend.split(',');
-                    }
-                }else{
+                    // if (record.weekend.length > 0){
+                    //     _record.weekends = record.weekend.split(',');
+                    // }
+                } else {
                     _record.checkInTime = 0
                     _record.validTime = 0
                 }
 
                 console.log(_record)
-                this.model = Object.assign({}, _record);
-                this.visible = true;
-                if(this.model.id){
-                    if (this.model.checkInTime === 1){
-                        this.checkTimeRange =
-                            [moment(new Date(this.model.startTime)).format('YYYY-MM-DD 00:00:00'),
-                                moment(new Date(this.model.endTime)).format('YYYY-MM-DD 00:00:00')]
+                this.model = Object.assign({}, _record)
+                this.visible = true
+                if (this.model.id) {
+                    if (this.model.checkInTime === 1) {
+                        this.startTime = moment(this.model.startTime, 'HH:mm')
+                        this.endTime = moment(this.model.endTime, 'HH:mm')
+                        // this.endTime = moment(this.validTimeRange[0]).format('YYYY-MM-DD 00:00:00')
                     }
-                    if (this.model.validTime === 1){
+                    if (this.model.validTime === 1) {
                         this.validTimeRange =
                             [moment(new Date(this.model.validStartTime)).format('YYYY-MM-DD 00:00:00'),
                                 moment(new Date(this.model.validEndTime)).format('YYYY-MM-DD 00:00:00')]
                     }
-
                 }
 
                 getSelectList({ id: this.model.id }).then((res) => {
                     if (res.success) {
-                        this.members = res.result;
+                        this.members = res.result
                     }
-                });
+                })
             },
             onCheckTimeChange(date, dateString) {
                 // this.checkStartTime = dateString[0];
@@ -329,88 +295,88 @@
                 // }
                 // console.log(this.validTimeRange.length);
             },
-            onOpenChange(e){
+            onOpenChange(e) {
                 console.log(e)
                 console.log(this.model.openValue)
                 // this.model.open = e?1:0;
                 // this.model.openValue = e
 
                 // this.model.openValue = !this.model.openValue
-                this.model.openValue = e;
+                this.model.openValue = e
             },
             submitForm() {
-                const that = this;
+                const that = this
                 // 触发表单验证
-                if (this.model.checkInTime == 1){
-                    this.model.startTime =moment(this.checkTimeRange[0]).format('YYYY-MM-DD 00:00:00');
-                    this.model.endTime =moment(this.checkTimeRange[1]).format('YYYY-MM-DD 00:00:00');
+                if (this.model.checkInTime == 1) {
+                    // this.model.startTime =moment(this.checkTimeRange[0]).format('YYYY-MM-DD 00:00:00');
+                    // this.model.endTime =moment(this.checkTimeRange[1]).format('YYYY-MM-DD 00:00:00');
+                    this.model.startTime = moment(this.startTime).format('HH:mm')
+                    this.model.endTime = moment(this.endTime).format('HH:mm')
                 }
-                if (this.model.validTime == 1){
-                    this.model.validStartTime =moment(this.validTimeRange[0]).format('YYYY-MM-DD 00:00:00');
-                    this.model.validEndTime =moment(this.validTimeRange[1]).format('YYYY-MM-DD 00:00:00');
+                if (this.model.validTime == 1) {
+                    this.model.validStartTime = moment(this.validTimeRange[0]).format('YYYY-MM-DD 00:00:00')
+                    this.model.validEndTime = moment(this.validTimeRange[1]).format('YYYY-MM-DD 00:00:00')
                 }
-                this.model.weekend = this.model.weekends.join(',');
-                this.model.open = this.model.openValue?1:0;
+                // this.model.weekend = this.model.weekends.join(',');
+                this.model.open = this.model.openValue ? 1 : 0
                 console.log(this.model)
                 this.$refs.form.validate((valid) => {
                     if (valid) {
-                        that.confirmLoading = true;
-                        let httpurl = "";
-                        let method = "";
+                        that.confirmLoading = true
+                        let httpurl = ''
+                        let method = ''
                         if (!this.model.id) {
-                            httpurl += this.url.add;
-                            method = "post";
+                            httpurl += this.url.add
+                            method = 'post'
                         } else {
-                            httpurl += this.url.edit;
-                            method = "put";
+                            httpurl += this.url.edit
+                            method = 'put'
                         }
 
-
-
                         httpAction(httpurl, this.model, method)
                             .then((res) => {
                                 if (res.success) {
-                                    that.$message.success(res.message);
-                                    that.$emit("ok");
+                                    that.$message.success(res.message)
+                                    that.$emit('ok')
                                 } else {
-                                    that.$message.warning(res.message);
+                                    that.$message.warning(res.message)
                                 }
                             })
                             .finally(() => {
-                                that.confirmLoading = false;
-                            });
+                                that.confirmLoading = false
+                            })
                     }
-                });
+                })
             },
-            onChange(){
+            onChange() {
 
             },
             handleHolidCancel() {
                 this.open = false
             },
-            handleHolidConfirm(){
+            handleHolidConfirm() {
                 this.open = false
             },
             moment,
             range(start, end) {
-                const result = [];
+                const result = []
                 for (let i = start; i < end; i++) {
-                    result.push(i);
+                    result.push(i)
                 }
-                return result;
+                return result
             },
 
             disabledDate(current) {
                 // Can not select days before today and today
-                return current && current < moment().endOf('day');
+                return current && current < moment().endOf('day')
             },
 
             disabledDateTime() {
                 return {
                     disabledHours: () => this.range(0, 24).splice(4, 20),
                     disabledMinutes: () => this.range(30, 60),
-                    disabledSeconds: () => [55, 56],
-                };
+                    disabledSeconds: () => [55, 56]
+                }
             },
             // 弹出日历和关闭日历的回调
             openChangeOne(status) {
@@ -420,25 +386,25 @@
             },
             // 得到年份选择器的值
             panelChangeOne(value) {
-                this.queryParam.year = moment(new Date(value)).format('YYYY');
-                this.open = false;
+                this.queryParam.year = moment(new Date(value)).format('YYYY')
+                this.open = false
             },
-            handleOk(e){
+            handleOk(e) {
                 console.log(e)
             },
-            handleChange(e){
+            handleChange(e) {
                 console.log(e)
                 console.log(this.model.holiday)
-                this.model.holiday = e+",";
+                this.model.holiday = e + ','
             },
-            handleFocus(){
-                this.open = true;
+            handleFocus() {
+                this.open = true
             },
-            handleGuestType(e){
+            handleGuestType(e) {
                 console.log(e)
             }
-        },
-    };
+        }
+    }
 </script>
 <style scoped>
     .avatar-uploader>.ant-upload {

+ 4 - 1
src/views/settings/components/roomModules/modules/housePriceSchemeModal.vue

@@ -15,6 +15,8 @@
 <script>
 
     import HousePriceSchemeForm from "./housePriceSchemeForm";
+    import moment from 'moment/moment'
+    import { httpAction } from '@api/manage'
     export default {
         name: 'housePriceSchemeModal',
         components: {
@@ -54,7 +56,8 @@
             },
             handleCancel () {
                 this.close()
-            }
+            },
+
         }
     }
 </script>

+ 21 - 25
src/views/settings/roomSettings.vue

@@ -25,25 +25,25 @@
       </a-tab-pane>
       <a-tab-pane key="4">
                 <span slot="tab">
-                    <a-icon type="clock-circle"/>
-                    全天房计费
-                </span>
-        <all-days-rule></all-days-rule>
-      </a-tab-pane>
-      <a-tab-pane key="5">
-                <span slot="tab">
-                    <a-icon type="history"/>
-                    钟点房计费
-                </span>
-        <hour-room-rule-list></hour-room-rule-list>
-      </a-tab-pane>
-      <a-tab-pane key="6">
-                <span slot="tab">
                     <a-icon type="file"/>
-                    房价方案
+                    房价设置
                 </span>
-        <house-price-scheme-list></house-price-scheme-list>
+        <housing-price-setting></housing-price-setting>
       </a-tab-pane>
+<!--      <a-tab-pane key="5">-->
+<!--                <span slot="tab">-->
+<!--                    <a-icon type="history"/>-->
+<!--                    钟点房计费-->
+<!--                </span>-->
+<!--        <hour-room-rule-list></hour-room-rule-list>-->
+<!--      </a-tab-pane>-->
+<!--      <a-tab-pane key="6">-->
+<!--                <span slot="tab">-->
+<!--                    <a-icon type="file"/>-->
+<!--                    房价方案-->
+<!--                </span>-->
+<!--        <house-price-scheme-list></house-price-scheme-list>-->
+<!--      </a-tab-pane>-->
       <a-tab-pane key="7">
                 <span slot="tab">
                     <a-icon type="thunderbolt"/>
@@ -72,14 +72,6 @@
                 </span>
         <meal-coupon-list></meal-coupon-list>
       </a-tab-pane>
-
-      <a-tab-pane key="11">
-                <span slot="tab">
-                    <a-icon type="file"/>
-                    长租
-                </span>
-        <long-rent-scheme></long-rent-scheme>
-      </a-tab-pane>
     </a-tabs>
   </a-card>
 </template>
@@ -89,12 +81,14 @@ import roomLayoutList from './components/roomModules/roomLayoutList.vue'
 import goodList from './components/roomModules/goodList.vue'
 import roomNumList from './components/roomModules/roomNumSettings/roomNumList.vue'
 import allDaysRule from './components/roomModules/allDaysRoomFeeRule.vue'
+import housingPriceSetting from '@views/settings/components/roomModules/housingPriceSetting'
 import MealCouponList from './components/roomModules/mealCouponList'
 import ServiceRepairList from './components/roomModules/serviceRepairList'
 import hourRoomRuleList from './components/roomModules/hourRoomRule/table.vue'
 import MarketObjectiveList from './components/roomModules/marketObjectiveList'
 import RoomUtilitySettingList from './components/roomModules/roomUtilitySettingList'
 import HousePriceSchemeList from './components/roomModules/housePriceSchemeList'
+import LongRentScheme from '@views/settings/components/roomModules/longRentScheme'
 
 export default {
   components: {
@@ -106,8 +100,10 @@ export default {
     roomLayoutList,
     goodList,
     roomNumList,
+    housingPriceSetting,
     allDaysRule, // 全天房计费规则tabContent
-    hourRoomRuleList
+    hourRoomRuleList,
+    LongRentScheme
   },
   data() {
     return {}