<template>
  <div>
    <a-row :gutter="[10, 16]">
      <a-col :md="6" :sm="8">
        <a-card>
          <div class="item">
            <div class="item_header">
              <div class="item_header_left">
                <div class="item_header_left_logo">
                  <img class="logo" src="~@/assets/eye.png" />
                </div>
                <div class="item_header_left_title">夜审</div>
              </div>
              <div class="item_header_right">
                <a-switch
                  checked-children="自动"
                  un-checked-children="手动"
                  default-checked
                  v-model="nightTrialModel.autoCheck"
                  @change="(e) => onNightTrialCheckChange(e)"
                />
              </div>
            </div>
            <div class="item_content">
              <div class="item_content_row">
                <div class="row_left">
                  <div class="row_left_tip">夜审时间</div>
                </div>
                <div class="row_right">
                  <a-time-picker
                    :open.sync="open"
                    v-model="nightTrialModel.setNightTrialTime"
                    format="HH:mm:ss"
                    style="width: 80%"
                  >
                    <a-button
                      slot="addon"
                      size="small"
                      @click="handleNightTrialCancel"
                    >
                      取消
                    </a-button>
                    <a-button
                      class="margin_left_6"
                      slot="addon"
                      size="small"
                      type="primary"
                      @click="handleNightTrialConfirm"
                    >
                      确定
                    </a-button>
                  </a-time-picker>
                </div>
              </div>
              <div class="item_content_row">
                <div class="row_left">
                  <div class="row_left_tip">自动交班</div>
                </div>
                <div class="row_right">
                  <a-switch
                    checked-children="已开"
                    un-checked-children="已关"
                    default-checked
                    v-model="nightTrialModel.autoHand"
                    @change="(e) => onNightTrialHandChange(e)"
                  />
                </div>
              </div>
              <div class="item_content_row">
                <div class="row_left">
                  <div class="row_left_tip">住房变为脏房</div>
                </div>
                <div class="row_right">
                  <a-switch
                    checked-children="开启"
                    un-checked-children="关闭"
                    v-model="nightTrialModel.roomToDirty"
                    @change="(e) => onNightTrialHandChange(e)"
                  />
                </div>
              </div>
            </div>
          </div>
        </a-card>
      </a-col>
      <a-col :md="6" :sm="8">
        <a-card>
          <div class="item">
            <div class="item_header">
              <div class="item_header_left">
                <div class="item_header_left_logo">
                  <img class="logo" src="~@/assets/clear.png" />
                </div>
                <div class="item_header_left_title">清扫房间选择服务员</div>
              </div>
              <div class="item_header_right"></div>
            </div>
            <div class="item_content">
              <div class="item_content_row">
                <div class="row_left">
                  <div class="row_left_tip">清扫房间选择服务员</div>
                </div>
                <div class="row_right_1">
                  <a-switch
                    checked-children="开启"
                    un-checked-children="关闭"
                    default-checked
                    v-model="clearModel.status"
                    @change="(e) => onClearChange(e)"
                  />
                </div>
              </div>
            </div>
          </div>
        </a-card>
      </a-col>
      <a-col :md="6" :sm="8">
        <a-card>
          <div class="item">
            <div class="item_header">
              <div class="item_header_left">
                <div class="item_header_left_logo">
                  <img class="logo" src="~@/assets/clear.png" />
                </div>
                <div class="item_header_left_title">房务管理</div>
              </div>
              <div class="item_header_right"></div>
            </div>
            <div class="item_content">
              <div class="item_content_row">
                <div class="row_left">
                  <div class="row_left_tip">开启房务管理功能</div>
                </div>
                <div class="row_right_1">
                  <a-switch
                    checked-children="开启"
                    un-checked-children="关闭"
                    default-checked
                    v-model="houseSettingModel.status"
                    @change="(e) => onHouseSettingChange(e)"
                  />
                </div>
              </div>
            </div>
          </div>
        </a-card>
      </a-col>
      <a-col :md="6" :sm="8">
        <a-card>
          <div class="item">
            <div class="item_header">
              <div class="item_header_left">
                <div class="item_header_left_logo">
                  <img class="logo" src="~@/assets/clear.png" />
                </div>
                <div class="item_header_left_title">押金设置</div>
              </div>
              <div class="item_header_right">
                <div v-show="show_deposit">
                  <a-button
                    type="primary"
                    shape="circle"
                    icon="check"
                    size="small"
                    @click="handleDepositConfirm"
                  >
                  </a-button>
                  <a-button
                    class="margin_left_6"
                    type="danger"
                    shape="circle"
                    icon="close"
                    size="small"
                    @click="handleDepositCancel"
                  >
                  </a-button>
                </div>
              </div>
            </div>
            <div class="item_content">
              <div class="item_content_row">
                <div class="row_left">
                  <div class="row_left_tip">计算公式</div>
                </div>
                <div class="row_right">
                  <a-radio-group
                    :value="depositModel.type"
                    @change="handleDepositChange"
                  >
                    <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>
                </div>
              </div>
              <div class="item_content_row">
                <div class="row_left">
                  <div class="row_left_tip">押金=</div>
                </div>
                <div class="row_right">
                  <div class="row_right_tip" v-show="depositModel.type != 3">
                    <span class="margin_right_4">房费</span>
                    <span class="margin_right_4">{{
                      depositModel.formula
                    }}</span>
                  </div>
                  <a-input-number
                    v-show="depositModel.type == 1"
                    :precision="2"
                    @change="onDepositChange()"
                    v-model="depositModel.multiple"
                    :min="0"
                    :max="999999"
                  />
                  <a-input-number
                    v-show="depositModel.type != 1"
                    :precision="2"
                    @change="onDepositChange()"
                    v-model="depositModel.money"
                    :min="0"
                    :max="999999"
                  />
                </div>
              </div>
              <div class="item_content_row">
                <div class="row_left">
                  <div class="row_left_tip">余额报警</div>
                </div>
                <div class="row_right">
                  <a-switch
                    checked-children="已开"
                    un-checked-children="已关"
                    default-checked
                    v-model="depositModel.alarm"
                    @change="(e) => onDepositAlarmChange(e)"
                  />
                </div>
              </div>
              <div class="item_content_row">
                <div class="row_left">
                  <div class="row_left_tip">余额小于</div>
                </div>
                <div class="row_right">
                  <a-input-number
                    :precision="2"
                    v-model="depositModel.less"
                    :min="0"
                    :max="999999"
                    @change="onDepositChange()"
                  />
                  <div class="margin_left_6">时报警</div>
                </div>
              </div>
            </div>
          </div>
        </a-card>
      </a-col>
      <a-col :md="6" :sm="8">
        <a-card>
          <div class="item">
            <div class="item_header">
              <div class="item_header_left">
                <div class="item_header_left_logo">
                  <img class="logo" src="~@/assets/clear.png" />
                </div>
                <div class="item_header_left_title">撤销入住</div>
              </div>
              <div class="item_header_right">
                <div v-show="show_cancel">
                  <a-button
                    type="primary"
                    shape="circle"
                    icon="check"
                    size="small"
                    @click="handleCancelConfirm"
                  >
                  </a-button>
                  <a-button
                    class="margin_left_6"
                    type="danger"
                    shape="circle"
                    icon="close"
                    size="small"
                    @click="handleCancelCancel"
                  >
                  </a-button>
                </div>
              </div>
            </div>
            <div class="item_content">
              <div class="item_content_row">
                <div class="row_left">
                  <div class="row_left_tip">撤销开关</div>
                </div>
                <div class="row_right">
                  <a-switch
                    checked-children="已开"
                    un-checked-children="已关"
                    default-checked
                    v-model="cancelModel.status"
                    @change="(e) => onCancelStatusChange(e)"
                  />
                </div>
              </div>
              <div class="item_content_row">
                <div class="row_left">
                  <div class="row_left_tip">有效分钟</div>
                </div>
                <div class="row_right">
                  <a-input-number
                    :precision="2"
                    v-model="cancelModel.minute"
                    :min="0"
                    :max="999999"
                    @change="onCancelChange()"
                  />
                  <div class="margin_left_6">内可撤</div>
                </div>
              </div>
            </div>
          </div>
        </a-card>
      </a-col>
      <a-col :md="6" :sm="8">
        <a-card>
          <div class="item">
            <div class="item_header">
              <div class="item_header_left">
                <div class="item_header_left_logo">
                  <img class="logo" src="~@/assets/clear.png" />
                </div>
                <div class="item_header_left_title">其他</div>
              </div>
              <div class="item_header_right"></div>
            </div>
            <div class="item_content">
              <div class="item_content_row">
                <div class="row_left">
                  <div class="row_left_tip">是否显示制卡</div>
                </div>
                <div class="row_right_1">
                  <a-switch
                    checked-children="开启"
                    un-checked-children="关闭"
                    default-checked
                    v-model="roomCardModel.status"
                    @change="(e) => onRoomCardChange(e)"
                  />
                </div>
              </div>
              <div class="item_content_row">
                <div class="row_left">
                  <div class="row_left_tip">是否开启会员验证</div>
                </div>
                <div class="row_right_1">
                  <a-switch
                    checked-children="开启"
                    un-checked-children="关闭"
                    default-checked
                    v-model="memberVerifyModel.status"
                    @change="(e) => onMemberVerifyChange(e)"
                  />
                </div>
              </div>
              <div class="item_content_row">
                <div class="row_left">
                  <div class="row_left_tip">空脏房可以入住</div>
                </div>
                <div class="row_right_1">
                  <a-switch
                    checked-children="开启"
                    un-checked-children="关闭"
                    default-checked
                    v-model="emptyDirtyRoomModel.status"
                    @change="(e) => onEmptyDirtyRoomChange(e)"
                  />
                </div>
              </div>
              <div class="item_content_row">
                <div class="row_left">
                  <div class="row_left_tip">查房完毕才能退房</div>
                </div>
                <div class="row_right_1">
                  <a-switch
                    checked-children="开启"
                    un-checked-children="关闭"
                    default-checked
                    v-model="checkOutModel.status"
                    @change="(e) => onCheckOutChange(e)"
                  />
                </div>
              </div>
              <div class="item_content_row">
                <div class="row_left">
                  <div class="row_left_tip">是否强制性先注销房卡，才能结账</div>
                </div>
                <div class="row_right_1">
                  <a-switch
                    checked-children="开启"
                    un-checked-children="关闭"
                    default-checked
                    v-model="roomCardModel.logoutCard"
                    @change="(e) => onRoomCardChange(e)"
                  />
                </div>
              </div>
            </div>
          </div>
        </a-card>
      </a-col>
      <a-col :md="6" :sm="8">
        <a-card>
          <div class="item">
            <div class="item_header">
              <div class="item_header_left">
                <div class="item_header_left_logo">
                  <img class="logo" src="~@/assets/clear.png" />
                </div>
                <div class="item_header_left_title">扫码支付</div>
              </div>
              <div class="item_header_right">
                <div v-show="show_automatic">
                  <a-button
                    type="primary"
                    shape="circle"
                    icon="check"
                    size="small"
                    @click="handleAutomaticConfirm"
                  >
                  </a-button>
                  <a-button
                    class="margin_left_6"
                    type="danger"
                    shape="circle"
                    icon="close"
                    size="small"
                    @click="handleAutomaticCancel"
                  >
                  </a-button>
                </div>
              </div>
            </div>
            <div class="item_content">
              <div class="item_content_row">
                <div class="row_left">
                  <div class="row_left_tip">自动完成</div>
                </div>
                <div class="row_right">
                  <a-input-number
                    :precision="2"
                    v-model="automaticModel.dayNum"
                    :min="0"
                    :max="999999"
                    @change="onAutomaticChange()"
                  />
                  <div class="margin_left_6">天后</div>
                </div>
              </div>
            </div>
          </div>
        </a-card>
      </a-col>
      <a-col :md="6" :sm="8">
        <a-card>
          <div class="item">
            <div class="item_header">
              <div class="item_header_left">
                <div class="item_header_left_logo">
                  <img class="logo" src="~@/assets/clear.png" />
                </div>
                <div class="item_header_left_title">数据共享</div>
              </div>
              <div class="item_header_right">
                <div v-show="show_share">
                  <a-button
                    type="primary"
                    shape="circle"
                    icon="check"
                    size="small"
                    @click="handleShareConfirm"
                  >
                  </a-button>
                  <a-button
                    class="margin_left_6"
                    type="danger"
                    shape="circle"
                    icon="close"
                    size="small"
                    @click="handleShareCancel"
                  >
                  </a-button>
                </div>
              </div>
            </div>
            <div class="item_content">
              <div class="item_content_row">
                <div class="row_left">
                  <div class="row_left_tip">会员共享</div>
                </div>
                <div class="row_right_1">
                  <a-switch
                    checked-children="开启"
                    un-checked-children="关闭"
                    default-checked
                    v-model="shareModel.member"
                    @change="(e) => onShareMemberChange(e)"
                  />
                </div>
              </div>
              <div class="item_content_row">
                <div class="row_left">
                  <div class="row_left_tip">会员储值共享</div>
                </div>
                <div class="row_right_1">
                  <a-switch
                    checked-children="开启"
                    un-checked-children="关闭"
                    default-checked
                    v-model="shareModel.memberAccount"
                    @change="(e) => onShareMemberAccountChange(e)"
                  />
                </div>
              </div>
              <div class="item_content_row">
                <div class="row_left">
                  <div class="row_left_tip">协议单位</div>
                </div>
                <div class="row_right_1">
                  <a-switch
                    checked-children="开启"
                    un-checked-children="关闭"
                    default-checked
                    v-model="shareModel.agreement"
                    @change="(e) => onShareAgreementChange(e)"
                  />
                </div>
              </div>
              <div class="item_content_row">
                <div class="row_left">
                  <div class="row_left_tip">协议记账共享</div>
                </div>
                <div class="row_right_1">
                  <a-switch
                    checked-children="开启"
                    un-checked-children="关闭"
                    default-checked
                    v-model="shareModel.agreementAccount"
                    @change="(e) => onShareAgreementAccountChange(e)"
                  />
                </div>
              </div>
            </div>
          </div>
        </a-card>
      </a-col>
      <a-col :md="6" :sm="8">
        <a-card>
          <div class="item">
            <div class="item_header">
              <div class="item_header_left">
                <div class="item_header_left_logo">
                  <img class="logo" src="~@/assets/clear.png" />
                </div>
                <div class="item_header_left_title">预定参数</div>
              </div>
              <div class="item_header_right">
                <div v-show="show_preset">
                  <a-button
                    type="primary"
                    shape="circle"
                    icon="check"
                    size="small"
                    @click="handlePresetConfirm"
                  >
                  </a-button>
                  <a-button
                    class="margin_left_6"
                    type="danger"
                    shape="circle"
                    icon="close"
                    size="small"
                    @click="handlePresetCancel"
                  >
                  </a-button>
                </div>
              </div>
            </div>
            <div class="item_content">
              <div class="item_content_row">
                <div class="row_left">
                  <div class="row_left_tip">是否开启</div>
                </div>
                <div class="row_right">
                  <a-switch
                    checked-children="已开"
                    un-checked-children="已关"
                    default-checked
                    v-model="presetModel.status"
                    @change="(e) => onPresetStatusChange(e)"
                  />
                </div>
              </div>
              <div class="item_content_row">
                <div class="row_left">
                  <div class="row_left_tip">超时预定</div>
                </div>
                <div class="row_right">
                  <a-input-number
                    :precision="2"
                    v-model="presetModel.minute"
                    :min="0"
                    :max="999999"
                    @change="onPresetChange()"
                  />
                  <div class="margin_left_6">分钟转NoShow</div>
                </div>
              </div>
            </div>
          </div>
        </a-card>
      </a-col>
      <a-col :md="6" :sm="8">
        <a-card>
          <div class="item">
            <div class="item_header">
              <div class="item_header_left">
                <div class="item_header_left_logo">
                  <img class="logo" src="~@/assets/clear.png" />
                </div>
                <div class="item_header_left_title">计算公式</div>
              </div>
              <div class="item_header_right">
                <div v-show="show_computeFormula">
                  <a-button
                    type="primary"
                    shape="circle"
                    icon="check"
                    size="small"
                    @click="handleComputeFormulaConfirm"
                  >
                  </a-button>
                  <a-button
                    class="margin_left_6"
                    type="danger"
                    shape="circle"
                    icon="close"
                    size="small"
                    @click="handleComputeFormulaCancel"
                  >
                  </a-button>
                </div>
              </div>
            </div>
            <div class="item_content">
              <div class="item_content_row">
                <div class="row_left">
                  <div class="row_left_tip">出租率基数</div>
                </div>
                <div class="row_right">
                  <a-select
                    v-model="computeFormulaModel.cardinal"
                    style="width: 100%"
                    @change="onComputeFormulaChange"
                  >
                    <!--                                        <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
                      v-for="(item, index) in cardinalList"
                      style="width: 100%"
                      :key="index"
                      :value="item.value"
                      >{{ item.text || item.label }}</a-select-option
                    >
                  </a-select>
                  <!--                                    <j-dict-select-tag v-model="computeFormulaModel.cardinal" placeholder="请选择" dictCode="rental_rate_base"-->
                  <!--                                                       @change="onComputeFormulaChange()"/>-->
                </div>
              </div>
            </div>
            <div class="item_content">
              <div class="item_content_row">
                <div class="row_left">
                  <div class="row_left_tip">时租间夜数</div>
                </div>
                <div class="row_right">
                  <a-input-number
                    :precision="2"
                    v-model="computeFormulaModel.nights"
                    :min="0"
                    :max="999999"
                    @change="onComputeFormulaChange()"
                  />
                </div>
              </div>
            </div>
            <div class="item_content">
              <div class="item_content_row">
                <div class="row_left">
                  <div class="row_left_tip">免费房</div>
                </div>
                <div class="row_right">
                  <a-switch
                    checked-children="开启"
                    un-checked-children="关闭"
                    default-checked
                    v-model="computeFormulaModel.status"
                    @change="(e) => onComputeFormulaChange(e)"
                  />
                  <div class="margin_left_6">计算平均房价</div>
                </div>
              </div>
            </div>
          </div>
        </a-card>
      </a-col>
      <a-col :md="6" :sm="8">
        <a-card>
          <div class="item">
            <div class="item_header">
              <div class="item_header_left">
                <div class="item_header_left_logo">
                  <img class="logo" src="~@/assets/clear.png" />
                </div>
                <div class="item_header_left_title">打印单据隐藏信息设置</div>
              </div>
              <div class="item_header_right"></div>
            </div>
            <div class="item_content">
              <div class="item_content_row">
                <div class="row_left">
                  <div class="row_left_tip">隐藏客人信息</div>
                </div>
                <div class="row_right_1">
                  <a-switch
                    checked-children="开启"
                    un-checked-children="关闭"
                    default-checked
                    v-model="printModel.guest"
                    @change="(e) => onPrintGuestChange(e)"
                  />
                </div>
              </div>
              <div class="item_content_row">
                <div class="row_left">
                  <div class="row_left_tip">隐藏收款房价信息</div>
                </div>
                <div class="row_right_1">
                  <a-switch
                    checked-children="开启"
                    un-checked-children="关闭"
                    default-checked
                    v-model="printModel.price"
                    @change="(e) => onPrintPriceChange(e)"
                  />
                </div>
              </div>
            </div>
          </div>
        </a-card>
      </a-col>
      <a-col :md="6" :sm="8">
        <a-card>
          <div class="item">
            <div class="item_header">
              <div class="item_header_left">
                <div class="item_header_left_logo">
                  <img class="logo" src="~@/assets/clear.png" />
                </div>
                <div class="item_header_left_title">线上预定房量是否同步</div>
              </div>
              <div class="item_header_right"></div>
            </div>
            <div class="item_content">
              <div class="item_content_row">
                <div class="row_left">
                  <div class="row_left_tip">同步</div>
                </div>
                <div class="row_right">
                  <a-switch
                    checked-children="开启"
                    un-checked-children="关闭"
                    default-checked
                    v-model="syncModel.status"
                    @change="(e) => onSyncChange(e)"
                  />
                </div>
              </div>
            </div>
          </div>
        </a-card>
      </a-col>
      <a-col :md="6" :sm="8">
        <a-card>
          <div class="item">
            <div class="item_header">
              <div class="item_header_left">
                <div class="item_header_left_logo">
                  <img class="logo" src="~@/assets/clear.png" />
                </div>
                <div class="item_header_left_title">小程序客房服务设置</div>
              </div>
              <div class="item_header_right">
                <div v-show="show_xcxRoom">
                  <a-button
                    type="primary"
                    shape="circle"
                    icon="check"
                    size="small"
                    @click="handleXcxRoomConfirm"
                  >
                  </a-button>
                  <a-button
                    class="margin_left_6"
                    type="danger"
                    shape="circle"
                    icon="close"
                    size="small"
                    @click="handleXcxRoomCancel"
                  >
                  </a-button>
                </div>
              </div>
            </div>
            <div class="item_content">
              <div class="item_content_row">
                <div class="row_left">
                  <div class="row_left_tip">退房功能</div>
                </div>
                <div class="row_right">
                  <a-switch
                    checked-children="开启"
                    un-checked-children="关闭"
                    default-checked
                    v-model="xcxRoomModel.checkOut"
                    @change="(e) => onXcxRoomChange(e)"
                  />
                </div>
              </div>
              <div class="item_content_row">
                <div class="row_left">
                  <div class="row_left_tip">会员储值共享</div>
                </div>
                <div class="row_right">
                  <a-radio-group
                    v-model="xcxRoomModel.checkOutType"
                    @change="onXcxRoomChange"
                  >
                    <a-radio :value="1"> 结账 </a-radio>
                    <a-radio :value="0"> 未结 </a-radio>
                  </a-radio-group>
                </div>
              </div>
              <div class="item_content_row">
                <div class="row_left">
                  <div class="row_left_tip">续住功能</div>
                </div>
                <div class="row_right">
                  <a-switch
                    checked-children="开启"
                    un-checked-children="关闭"
                    default-checked
                    v-model="xcxRoomModel.keepLive"
                    @change="(e) => onXcxRoomChange(e)"
                  />
                </div>
              </div>
              <div class="item_content_row">
                <div class="row_left">
                  <div class="row_left_tip">留言功能</div>
                </div>
                <div class="row_right">
                  <a-switch
                    checked-children="开启"
                    un-checked-children="关闭"
                    default-checked
                    v-model="xcxRoomModel.messageLive"
                    @change="(e) => onXcxRoomChange(e)"
                  />
                </div>
              </div>
              <div class="item_content_row">
                <div class="row_left">
                  <div class="row_left_tip">服务功能</div>
                </div>
                <div class="row_right">
                  <a-switch
                    checked-children="开启"
                    un-checked-children="关闭"
                    default-checked
                    v-model="xcxRoomModel.serviceLive"
                    @change="(e) => onXcxRoomChange(e)"
                  />
                </div>
              </div>
              <div class="item_content_row">
                <div class="row_left">
                  <div class="row_left_tip">维修功能</div>
                </div>
                <div class="row_right">
                  <a-switch
                    checked-children="开启"
                    un-checked-children="关闭"
                    default-checked
                    v-model="xcxRoomModel.repairLive"
                    @change="(e) => onXcxRoomChange(e)"
                  />
                </div>
              </div>
            </div>
          </div>
        </a-card>
      </a-col>
    </a-row>
  </div>
</template>

<script>
import { ajaxGetDictItems, getDictItemsFromCache } from "@/api/api";
import { httpAction, getAction } from "@/api/manage";
import moment from "moment";
export default {
  name: "paramSettings",
  data() {
    return {
      labelCol: {
        xs: { span: 24 },
        sm: { span: 6 },
      },
      wrapperCol: {
        xs: { span: 24 },
        sm: { span: 12 },
      },
      url: {
        query_nighttrial: "/business/busNightTrial/queryByHotelId",
        nighttrial_autocheck: "/business/busNightTrial/editAutoCheck",
        nighttrial_time: "/business/busNightTrial/editNightTrialTime",
        nighttrial_autohand: "/business/busNightTrial/editAutoHand",
        query_clear: "/business/busClear/queryByHotelId",
        clear_status: "/business/busClear/editStatus",
        query_housesetting: "/business/busHouseSetting/queryByHotelId",
        housesetting_status: "/business/busHouseSetting/editStatus",
        query_deposit: "/business/busDepositSetting/queryByHotelId",
        deposit_edit: "/business/busDepositSetting/editInfo",
        query_cancel: "/business/busCancel/queryByHotelId",
        cancel_edit: "/business/busCancel/editInfo",
        query_roomcard: "/business/busOtherRoomCard/queryByHotelId",
        roomcard_status: "/business/busOtherRoomCard/editStatus",
        query_memberverify: "/business/busOtherMemberVerify/queryByHotelId",
        memberverify_status: "/business/busOtherMemberVerify/editStatus",
        query_emptydirtyroom: "/business/busOtherEmptyDirtyRoom/queryByHotelId",
        emptydirtyroom_status: "/business/busOtherEmptyDirtyRoom/editStatus",
        query_checkout: "/business/busOtherCheckout/queryByHotelId",
        checkout_status: "/business/busOtherCheckout/editStatus",
        query_automatic: "/business/busParamWeep/queryByHotelId",
        automatic_edit: "/business/busParamWeep/editInfo",
        query_share: "/business/busParamShare/queryByHotelId",
        share_edit: "/business/busParamShare/editInfo",
        query_preset: "/business/busParamPreset/queryByHotelId",
        preset_edit: "/business/busParamPreset/editInfo",
        query_compute: "/business/busParamComputeFormula/queryByHotelId",
        compute_edit: "/business/busParamComputeFormula/editInfo",
        query_print: "/business/busParamPrintHide/queryByHotelId",
        print_editGuest: "/business/busParamPrintHide/editGuest",
        print_editPrice: "/business/busParamPrintHide/editPrice",
        query_sync: "/business/busParamPresetSync/queryByHotelId",
        sync_status: "/business/busParamPresetSync/editInfo",
        query_xcxRoom: "/business/busParamXcxRoom/queryByHotelId",
        xcxRoom_edit: "/business/busParamXcxRoom/editInfo",
      },
      hotelId: "",
      open: false,
      nightTrialModel: {
        setNightTrialTime: moment("06:00:00", "HH:mm:ss"),
        autoCheck: true,
        autoHand: true,
      },
      clearModel: {
        status: true,
      },
      houseSettingModel: {
        status: true,
      },
      show_deposit: false,
      depositModel: {
        type: "1",
        formula: "+",
        money: 100,
        alarm: true,
        alarmValue: 1,
        less: 10.0,
        multiple: 0.5,
      },
      show_cancel: false,
      cancelModel: {
        status: true,
        statusValue: 1,
        minute: 60,
      },
      roomCardModel: {
        status: true,
      },
      memberVerifyModel: {
        status: true,
      },
      emptyDirtyRoomModel: {
        status: true,
      },
      checkOutModel: {
        status: true,
      },
      show_automatic: false,
      automaticModel: {
        dayNum: 30,
      },
      show_share: false,
      shareModel: {
        agreementAccount: false,
        agreementAccountValue: 0,
        agreement: false,
        agreementValue: 0,
        memberAccount: false,
        memberAccountValue: 0,
        member: false,
        memberValue: 0,
      },
      show_preset: false,
      presetModel: {
        status: true,
        statusValue: 1,
        minute: 60,
      },
      cardinalList: [],
      show_computeFormula: false,
      computeFormulaModel: {
        cardinal: "1",
        nights: 0,
        status: false,
      },
      printModel: {
        guest: true,
        price: true,
      },
      syncModel: {
        status: true,
      },
      show_xcxRoom: false,
      xcxRoomModel: {
        checkOut: true,
        checkOutType: 1,
        keepLive: true,
        messageLive: true,
        serviceLive: true,
        repairLive: true,
      },
    };
  },
  created() {
    //备份model原始值
    this.initConfig();

    var info = JSON.parse(localStorage.getItem("storeInfo"));
    this.hotelId = info.id;
  },
  methods: {
    initConfig() {
      // 获取夜审信息
      getAction(this.url.query_nighttrial, {}).then((res) => {
        console.log(res);
        if (res.success) {
          // this.nightTrialModel = res.result
          var _time = moment(res.result.setNightTrialTime, "HH:mm:ss");
          var _model = {
            id: res.result.id,
            autoCheck: res.result.autoCheck == 1 ? true : false,
            autoHand: res.result.autoHand == 1 ? true : false,
            setNightTrialTime: _time,
            roomToDirty: res.result.roomToDirty,
          };
          this.nightTrialModel = _model;
        } else {
        }
      });

      // 获取清扫信息
      getAction(this.url.query_clear, {}).then((res) => {
        if (res.success) {
          var _model = {
            id: res.result.id,
            status: res.result.status == 1 ? true : false,
          };
          this.clearModel = _model;
        } else {
        }
      });

      // 获取房务管理信息
      getAction(this.url.query_housesetting, {}).then((res) => {
        if (res.success) {
          var _model = {
            id: res.result.id,
            status: res.result.status == 1 ? true : false,
          };
          this.houseSettingModel = _model;
        } else {
        }
      });

      // 获取押金设置
      getAction(this.url.query_deposit, {}).then((res) => {
        if (res.success) {
          var _data = res.result;
          var _formula = _data.depositType == 1 ? "x" : "+";
          var _model = {
            id: _data.id,
            type: _data.depositType + "",
            formula: _formula,
            multiple: _data.depositMultiple,
            money: _data.depositMoney,
            alarm: _data.balanceAlarm == 1 ? true : false,
            alarmValue: _data.balanceAlarm,
            less: _data.balanceLess,
          };
          this.depositModel = _model;
        } else {
        }
      });

      // 获取撤销入住信息
      getAction(this.url.query_cancel, {}).then((res) => {
        if (res.success) {
          var _model = {
            id: res.result.id,
            status: res.result.status == 1 ? true : false,
            minute: res.result.minute,
          };
          this.cancelModel = _model;
        } else {
        }
      });

      //获取其他信息
      //制卡
      getAction(this.url.query_roomcard, {}).then((res) => {
        if (res.success) {
          var _model = {
            id: res.result.id,
            status: res.result.status == 1 ? true : false,
            logoutCard: res.result.logoutCard,
          };
          this.roomCardModel = _model;
        } else {
        }
      });
      //会员验证
      getAction(this.url.query_memberverify, {}).then((res) => {
        if (res.success) {
          var _model = {
            id: res.result.id,
            status: res.result.status == 1 ? true : false,
          };
          this.memberVerifyModel = _model;
        } else {
        }
      });
      //空脏房
      getAction(this.url.query_emptydirtyroom, {}).then((res) => {
        if (res.success) {
          var _model = {
            id: res.result.id,
            status: res.result.status == 1 ? true : false,
          };
          this.emptyDirtyRoomModel = _model;
        } else {
        }
      });
      //退房
      getAction(this.url.query_checkout, {}).then((res) => {
        if (res.success) {
          var _model = {
            id: res.result.id,
            status: res.result.status == 1 ? true : false,
          };
          this.checkOutModel = _model;
        } else {
        }
      });

      //扫码支付
      getAction(this.url.query_automatic, {}).then((res) => {
        if (res.success) {
          var _model = {
            id: res.result.id,
            dayNum: res.result.dayNum,
          };
          this.automaticModel = _model;
        } else {
        }
      });

      //数据共享
      getAction(this.url.query_share, {}).then((res) => {
        if (res.success) {
          var _model = {
            id: res.result.id,
            agreement: res.result.agreementShare,
            agreementValue: res.result.agreementShare ? 1 : 0,
            agreementAccount: res.result.agreementAccountShare,
            agreementAccountValue: res.result.agreementAccountShare ? 1 : 0,
            member: res.result.memberShare,
            memberValue: res.result.memberShare ? 1 : 0,
            memberAccount: res.result.memberAccountShare,
            memberAccountValue: res.result.memberAccountShare ? 1 : 0,
          };
          this.shareModel = _model;
        } else {
        }
      });

      //预定参数
      getAction(this.url.query_preset, {}).then((res) => {
        if (res.success) {
          var _model = {
            id: res.result.id,
            status: res.result.status,
            statusValue: res.result.status ? 1 : 0,
            minute: res.result.minute,
          };
          this.presetModel = _model;
        } else {
        }
      });

      //计算公式
      if (getDictItemsFromCache("rental_rate_base")) {
        this.cardinalList = getDictItemsFromCache("rental_rate_base");
        return;
      }
      //根据字典Code, 初始化字典数组
      ajaxGetDictItems("rental_rate_base", null).then((res) => {
        if (res.success) {
          this.cardinalList = res.result;
        }
      });
      getAction(this.url.query_compute, {}).then((res) => {
        if (res.success) {
          var _model = {
            id: res.result.id,
            status: res.result.status == 1 ? true : false,
            nights: res.result.nights,
            cardinal: res.result.cardinal + "",
          };
          this.computeFormulaModel = _model;
        } else {
        }
      });

      //打印单据隐藏信息设置
      getAction(this.url.query_print, {}).then((res) => {
        if (res.success) {
          var _model = {
            id: res.result.id,
            guest: res.result.guest == 1 ? true : false,
            price: res.result.price == 1 ? true : false,
          };
          this.printModel = _model;
        } else {
        }
      });

      //线上预定房量是否同步
      getAction(this.url.query_sync, {}).then((res) => {
        if (res.success) {
          var _model = {
            id: res.result.id,
            status: res.result.status == 1 ? true : false,
          };
          this.xcxRoomModel = _model;
        } else {
        }
      });

      //小程序客房服务设置
      getAction(this.url.query_xcxRoom, {}).then((res) => {
        if (res.success) {
          var _model = {
            id: res.result.id,
            checkOut: res.result.checkOut == 1 ? true : false,
            checkOutType: res.result.checkOutType,
            keepLive: res.result.keepLive == 1 ? true : false,
            messageLive: res.result.messageLive == 1 ? true : false,
            serviceLive: res.result.serviceLive == 1 ? true : false,
            repairLive: res.result.repairLive == 1 ? true : false,
          };
          this.syncModel = _model;
        } else {
        }
      });
    },
    onNightTrialCheckChange(val) {
      console.log("夜审" + val);
      var _value = 0;
      if (val) {
        // 自动
        _value = 1;
      }
      this.confirmLoading = true;
      var that = this;
      var _id = this.nightTrialModel.id ? this.nightTrialModel.id : "";
      var param = {
        autoCheck: _value,
        hotelId: this.hotelId,
        id: _id,
      };

      httpAction(this.url.nighttrial_autocheck, param, "post")
        .then((res) => {
          if (res.success) {
            that.$message.success("操作成功");
            that.$emit("ok");
            that.nightTrialModel.id = res.result.id;
          } else {
            that.$message.warning(res.message);
          }
        })
        .finally(() => {
          that.confirmLoading = false;
        });
    },
    handleOpenChange(open) {
      console.log("open", open);
      this.open = open;
    },
    handleNightTrialCancel() {
      this.open = false;
    },
    handleNightTrialConfirm() {
      this.open = false;
      this.confirmLoading = true;
      var that = this;
      var _time = moment(
        new Date(this.nightTrialModel.setNightTrialTime)
      ).format("HH:mm:ss");
      var _id = this.nightTrialModel.id ? this.nightTrialModel.id : "";
      var param = {
        setNightTrialTime: _time,
        hotelId: this.hotelId,
        id: _id,
      };
      httpAction(this.url.nighttrial_time, param, "post")
        .then((res) => {
          if (res.success) {
            that.$message.success("操作成功");
            that.$emit("ok");
            that.nightTrialModel.id = res.result.id;
          } else {
            that.$message.warning(res.message);
          }
        })
        .finally(() => {
          that.confirmLoading = false;
        });
    },
    onNightTrialHandChange(val) {
      console.log("夜审" + val);
      var _value = 0;
      if (val) {
        // 自动
        _value = 1;
      }
      this.confirmLoading = true;
      var that = this;
      var _id = this.nightTrialModel.id ? this.nightTrialModel.id : "";
      var param = {
        autoHand: _value,
        hotelId: this.hotelId,
        id: _id,
        roomToDirty: this.nightTrialModel.roomToDirty,
      };

      httpAction(this.url.nighttrial_autohand, param, "post")
        .then((res) => {
          if (res.success) {
            that.$message.success("操作成功");
            that.$emit("ok");
            that.nightTrialModel.id = res.result.id;
          } else {
            that.$message.warning(res.message);
          }
        })
        .finally(() => {
          that.confirmLoading = false;
        });
    },
    onClearChange(val) {
      var _value = 0;
      if (val) {
        // 开启
        _value = 1;
      }
      this.confirmLoading = true;
      var that = this;
      var _id = this.clearModel.id ? this.clearModel.id : "";
      var param = {
        status: _value,
        hotelId: this.hotelId,
        id: _id,
      };

      httpAction(this.url.clear_status, param, "post")
        .then((res) => {
          if (res.success) {
            that.$message.success("操作成功");
            that.$emit("ok");
            that.clearModel.id = res.result.id;
          } else {
            that.$message.warning(res.message);
          }
        })
        .finally(() => {
          that.confirmLoading = false;
        });
    },
    onHouseSettingChange(val) {
      var _value = 0;
      if (val) {
        // 开启
        _value = 1;
      }
      this.confirmLoading = true;
      var that = this;
      var _id = this.houseSettingModel.id ? this.houseSettingModel.id : "";
      var param = {
        status: _value,
        hotelId: this.hotelId,
        id: _id,
      };

      httpAction(this.url.housesetting_status, param, "post")
        .then((res) => {
          if (res.success) {
            that.$message.success("操作成功");
            that.$emit("ok");
            that.houseSettingModel.id = res.result.id;
          } else {
            that.$message.warning(res.message);
          }
        })
        .finally(() => {
          that.confirmLoading = false;
        });
    },
    handleDepositChange(e) {
      console.log(e.target.value);
      var _type = e.target.value;
      this.depositModel.type = _type;
      this.show_deposit = true;
      if (_type == 1) {
        this.depositModel.formula = "x";
      }
      if (_type == 2) {
        this.depositModel.formula = "+";
      }
    },
    handleDepositCancel() {
      this.show_deposit = false;
    },
    handleDepositConfirm() {
      // 押金设置提交
      this.confirmLoading = true;
      var that = this;
      var _id = this.depositModel.id ? this.depositModel.id : "";
      var param = {
        hotelId: this.hotelId,
        id: _id,
        depositType: this.depositModel.type,
        depositMultiple: this.depositModel.multiple,
        depositMoney: this.depositModel.money,
        balanceAlarm: this.depositModel.alarmValue,
        balanceLess: this.depositModel.less,
      };

      httpAction(this.url.deposit_edit, param, "post")
        .then((res) => {
          if (res.success) {
            that.$message.success("操作成功");
            that.$emit("ok");
            that.depositModel.id = res.result.id;
          } else {
            that.$message.warning(res.message);
          }
        })
        .finally(() => {
          that.confirmLoading = false;
          that.show_deposit = false;
        });
    },
    onDepositChange() {
      this.show_deposit = true;
    },
    onDepositAlarmChange(val) {
      this.show_deposit = true;
      var _value = 0;
      if (val) {
        // 自动
        _value = 1;
      }
      this.depositModel.alarmValue = _value;
    },
    onCancelChange() {
      this.show_cancel = true;
    },
    onCancelStatusChange(val) {
      this.show_cancel = true;
      var _value = 0;
      if (val) {
        // 自动
        _value = 1;
      }
      this.cancelModel.statusValue = _value;
    },
    handleCancelCancel() {
      this.show_cancel = false;
    },
    handleCancelConfirm() {
      this.confirmLoading = true;
      var that = this;
      var _id = this.cancelModel.id ? this.cancelModel.id : "";
      var param = {
        hotelId: this.hotelId,
        id: _id,
        status: this.cancelModel.statusValue,
        minute: this.cancelModel.minute,
      };

      httpAction(this.url.cancel_edit, param, "post")
        .then((res) => {
          if (res.success) {
            that.$message.success("操作成功");
            that.$emit("ok");
            that.cancelModel.id = res.result.id;
          } else {
            that.$message.warning(res.message);
          }
        })
        .finally(() => {
          that.confirmLoading = false;
          that.show_cancel = false;
        });
    },
    onRoomCardChange(val) {
      var _value = 0;
      if (val) {
        // 开启
        _value = 1;
      }
      this.confirmLoading = true;
      var that = this;
      var _id = this.roomCardModel.id ? this.roomCardModel.id : "";
      var param = {
        status: _value,
        hotelId: this.hotelId,
        id: _id,
        logoutCard: this.roomCardModel.logoutCard,
      };

      httpAction(this.url.roomcard_status, param, "post")
        .then((res) => {
          if (res.success) {
            that.$message.success("操作成功");
            that.$emit("ok");
            that.roomCardModel.id = res.result.id;
          } else {
            that.$message.warning(res.message);
          }
        })
        .finally(() => {
          that.confirmLoading = false;
        });
    },
    onMemberVerifyChange(val) {
      var _value = 0;
      if (val) {
        // 开启
        _value = 1;
      }
      this.confirmLoading = true;
      var that = this;
      var _id = this.memberVerifyModel.id ? this.memberVerifyModel.id : "";
      var param = {
        status: _value,
        hotelId: this.hotelId,
        id: _id,
      };

      httpAction(this.url.memberverify_status, param, "post")
        .then((res) => {
          if (res.success) {
            that.$message.success("操作成功");
            that.$emit("ok");
            that.memberVerifyModel.id = res.result.id;
          } else {
            that.$message.warning(res.message);
          }
        })
        .finally(() => {
          that.confirmLoading = false;
        });
    },
    onEmptyDirtyRoomChange(val) {
      var _value = 0;
      if (val) {
        // 开启
        _value = 1;
      }
      this.confirmLoading = true;
      var that = this;
      var _id = this.emptyDirtyRoomModel.id ? this.emptyDirtyRoomModel.id : "";
      var param = {
        status: _value,
        hotelId: this.hotelId,
        id: _id,
      };

      httpAction(this.url.emptydirtyroom_status, param, "post")
        .then((res) => {
          if (res.success) {
            that.$message.success("操作成功");
            that.$emit("ok");
            that.emptyDirtyRoomModel.id = res.result.id;
          } else {
            that.$message.warning(res.message);
          }
        })
        .finally(() => {
          that.confirmLoading = false;
        });
    },
    onCheckOutChange(val) {
      var _value = 0;
      if (val) {
        // 开启
        _value = 1;
      }
      this.confirmLoading = true;
      var that = this;
      var _id = this.checkOutModel.id ? this.checkOutModel.id : "";
      var param = {
        status: _value,
        hotelId: this.hotelId,
        id: _id,
      };

      httpAction(this.url.checkout_status, param, "post")
        .then((res) => {
          if (res.success) {
            that.$message.success("操作成功");
            that.$emit("ok");
            that.checkOutModel.id = res.result.id;
          } else {
            that.$message.warning(res.message);
          }
        })
        .finally(() => {
          that.confirmLoading = false;
        });
    },

    onAutomaticChange() {
      this.show_automatic = true;
    },
    handleAutomaticConfirm() {
      this.confirmLoading = true;
      var that = this;
      var _id = this.automaticModel.id ? this.automaticModel.id : "";
      var param = {
        hotelId: this.hotelId,
        id: _id,
        dayNum: this.automaticModel.dayNum,
      };

      httpAction(this.url.automatic_edit, param, "post")
        .then((res) => {
          if (res.success) {
            that.$message.success("操作成功");
            that.$emit("ok");
            that.automaticModel.id = res.result.id;
          } else {
            that.$message.warning(res.message);
          }
        })
        .finally(() => {
          that.confirmLoading = false;
          that.show_automatic = false;
        });
    },
    handleAutomaticCancel() {
      this.show_automatic = false;
    },
    onShareMemberChange(val) {
      if (!this.show_share) {
        this.show_share = true;
      }
      var _value = 0;
      if (val) {
        // 开启
        _value = 1;
      }
      this.shareModel.memberValue = _value;
    },
    onShareMemberAccountChange(val) {
      if (!this.show_share) {
        this.show_share = true;
      }
      var _value = 0;
      if (val) {
        // 开启
        _value = 1;
      }
      this.shareModel.memberAccountValue = _value;
    },
    onShareAgreementChange(val) {
      if (!this.show_share) {
        this.show_share = true;
      }
      var _value = 0;
      if (val) {
        // 开启
        _value = 1;
      }
      this.shareModel.agreementValue = _value;
    },
    onShareAgreementAccountChange(val) {
      if (!this.show_share) {
        this.show_share = true;
      }
      var _value = 0;
      if (val) {
        // 开启
        _value = 1;
      }
      this.shareModel.agreementAccountValue = _value;
    },
    handleShareCancel() {
      this.show_share = false;
    },
    handleShareConfirm() {
      this.confirmLoading = true;
      var that = this;
      var _id = this.shareModel.id ? this.shareModel.id : "";
      var param = {
        hotelId: this.hotelId,
        id: _id,
        memberAccountShare: this.shareModel.memberAccountValue,
        memberShare: this.shareModel.memberValue,
        agreementAccountShare: this.shareModel.agreementAccountValue,
        agreementShare: this.shareModel.agreementValue,
      };
      console.log(param);
      httpAction(this.url.share_edit, param, "post")
        .then((res) => {
          if (res.success) {
            that.$message.success("操作成功");
            that.$emit("ok");
            that.shareModel.id = res.result.id;
          } else {
            that.$message.warning(res.message);
          }
        })
        .finally(() => {
          that.confirmLoading = false;
          that.show_share = false;
        });
    },
    handlePresetCancel() {
      this.show_preset = false;
    },
    onPresetChange() {
      if (!this.show_preset) {
        this.show_preset = true;
      }
    },
    onPresetStatusChange(val) {
      if (!this.show_preset) {
        this.show_preset = true;
      }
      var _value = 0;
      if (val) {
        // 开启
        _value = 1;
      }
      this.presetModel.statusValue = _value;
    },
    handlePresetConfirm() {
      this.confirmLoading = true;
      var that = this;
      var _id = this.presetModel.id ? this.presetModel.id : "";
      var param = {
        hotelId: this.hotelId,
        id: _id,
        status: this.presetModel.statusValue,
        minute: this.presetModel.minute,
      };

      httpAction(this.url.preset_edit, param, "post")
        .then((res) => {
          if (res.success) {
            that.$message.success("操作成功");
            that.$emit("ok");
            that.presetModel.id = res.result.id;
          } else {
            that.$message.warning(res.message);
          }
        })
        .finally(() => {
          that.confirmLoading = false;
          that.show_preset = false;
        });
    },
    onPrintGuestChange(val) {
      var _value = 0;
      if (val) {
        // 开启
        _value = 1;
      }
      this.confirmLoading = true;
      var that = this;
      var _id = this.printModel.id ? this.printModel.id : "";
      var param = {
        hotelId: this.hotelId,
        id: _id,
        guest: _value,
      };

      httpAction(this.url.print_editGuest, param, "post")
        .then((res) => {
          if (res.success) {
            that.$message.success("操作成功");
            that.$emit("ok");
            that.printModel.id = res.result.id;
          } else {
            that.$message.warning(res.message);
          }
        })
        .finally(() => {
          that.confirmLoading = false;
        });
    },
    onPrintPriceChange(val) {
      var _value = 0;
      if (val) {
        // 开启
        _value = 1;
      }
      this.confirmLoading = true;
      var that = this;
      var _id = this.printModel.id ? this.printModel.id : "";
      var param = {
        hotelId: this.hotelId,
        id: _id,
        price: _value,
      };

      httpAction(this.url.print_editPrice, param, "post")
        .then((res) => {
          if (res.success) {
            that.$message.success("操作成功");
            that.$emit("ok");
            that.printModel.id = res.result.id;
          } else {
            that.$message.warning(res.message);
          }
        })
        .finally(() => {
          that.confirmLoading = false;
        });
    },
    onSyncChange(val) {
      var _value = 0;
      if (val) {
        // 开启
        _value = 1;
      }
      this.confirmLoading = true;
      var that = this;
      var _id = this.syncModel.id ? this.syncModel.id : "";
      var param = {
        hotelId: this.hotelId,
        id: _id,
        status: _value,
      };

      httpAction(this.url.sync_status, param, "post")
        .then((res) => {
          if (res.success) {
            that.$message.success("操作成功");
            that.$emit("ok");
            that.syncModel.id = res.result.id;
          } else {
            that.$message.warning(res.message);
          }
        })
        .finally(() => {
          that.confirmLoading = false;
        });
    },
    onXcxRoomChange() {
      if (!this.show_xcxRoom) {
        this.show_xcxRoom = true;
      }
    },
    handleXcxRoomCancel() {
      this.show_xcxRoom = false;
    },
    handleXcxRoomConfirm() {
      this.confirmLoading = true;
      var that = this;
      var _id = this.xcxRoomModel.id ? this.xcxRoomModel.id : "";
      var param = {
        hotelId: this.hotelId,
        id: _id,
        checkOut: this.xcxRoomModel.checkOut ? 1 : 0,
        checkOutType: this.xcxRoomModel.checkOutType,
        keepLive: this.xcxRoomModel.keepLive ? 1 : 0,
        messageLive: this.xcxRoomModel.messageLive ? 1 : 0,
        serviceLive: this.xcxRoomModel.serviceLive ? 1 : 0,
        repairLive: this.xcxRoomModel.repairLive ? 1 : 0,
      };

      httpAction(this.url.xcxRoom_edit, param, "post")
        .then((res) => {
          if (res.success) {
            that.$message.success("操作成功");
            that.$emit("ok");
            that.xcxRoomModel.id = res.result.id;
          } else {
            that.$message.warning(res.message);
          }
        })
        .finally(() => {
          that.confirmLoading = false;
          that.show_xcxRoom = false;
        });
    },
    onComputeFormulaChange() {
      if (!this.show_computeFormula) {
        this.show_computeFormula = true;
      }
    },
    handleComputeFormulaCancel() {
      this.show_computeFormula = false;
    },
    handleComputeFormulaConfirm() {
      this.confirmLoading = true;
      var that = this;
      var _id = this.computeFormulaModel.id ? this.computeFormulaModel.id : "";
      var param = {
        hotelId: this.hotelId,
        id: _id,
        status: this.computeFormulaModel.status ? 1 : 0,
        nights: this.computeFormulaModel.nights,
        cardinal: this.computeFormulaModel.cardinal,
      };

      httpAction(this.url.compute_edit, param, "post")
        .then((res) => {
          if (res.success) {
            that.$message.success("操作成功");
            that.$emit("ok");
            that.computeFormulaModel.id = res.result.id;
          } else {
            that.$message.warning(res.message);
          }
        })
        .finally(() => {
          that.confirmLoading = false;
          that.show_computeFormula = false;
        });
    },
  },
};
</script>

<style lang="less" scoped>
.item {
  text-align: center;
  height: 220px;
  margin-bottom: 10px;
}
.item_header {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-items: center;
  justify-content: center;
}
.item_header_left {
  flex: 3;
  display: flex;
  flex-direction: row;
}
.item_header_left_logo {
  flex: 1;
}
.item_header_left_logo .logo {
  width: 32px;
  height: 32px;
  max-height: 50px;
  max-width: 50px;
}
.item_header_left_title {
  flex: 2;
  font-size: 14px;
  font-weight: bold;
  color: black;
  display: flex;
  align-items: center;
}
.item_header_right {
  flex: 2;
}
.item_content {
  padding-top: 15px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-items: center;
  font-size: 14px;
}
.item_content_row {
  width: 90%;
  display: flex;
  flex-direction: row;
  padding-bottom: 12px;
}
.row_left {
  flex: 1;
  display: flex;
  flex-direction: row;
  align-items: center;
}
.row_left_tip {
  flex: 1;
}
.row_right {
  flex: 2;
  text-align: left;
  display: flex;
  flex-direction: row;
  align-items: center;
}
.row_right_1 {
  flex: 1;
  text-align: left;
}
.row_right_tip {
  display: flex;
  align-items: center;
}
.row_middle {
  flex: 1;
}
.row_right {
  /deep/ .ant-time-picker-panel-addon {
    text-align: right;
  }
}
.margin_left_6 {
  margin-left: 6px;
}
.margin_left_4 {
  margin-left: 4px;
}
.margin_right_4 {
  margin-right: 4px;
}
/*.ant-time-picker-panel-addon{*/
/*    text-align: right*/
/*}*/
</style>
