<view class="inventory-day-container">
  <!-- 切换住院人 -->
  <view class="person-block" a:if="{{jsonData.Inpatient.inpatientName}}">
    <view class="person-name-out">
      <view class="person-name">
        {{ jsonData.Inpatient.inpatientName }}
      </view>
      <view class="person-change" onTap="onAdmissionRegistration">切换住院人</view>
    </view>
    <view class="person-info" a:if="{{jsonData.Inpatient}}">
      {{jsonData.Inpatient.sex ? jsonData.Inpatient.sex + '，' : ''}}{{jsonData.Inpatient.inpatientAge ? jsonData.Inpatient.inpatientAge + '岁，' : ''}}{{jsonData.Inpatient.patientId ? jsonData.Inpatient.patientId : ''}}
    </view>
  </view>
  <!-- 时间切换 -->
  <view class="general-block">
    <view class="general-calendar">
      <view class="general-calendar-pre" onTap="queryPreDay">
        <view class="general-calendar-next a-text am-icon am-icon-left am-calendar-arrow inventory-day-text"></view>
        <view class="general-calendar-pre last-day">上一天</view>
      </view>
      <view class="general-calendar-today" onTap="selectDate">
        <view style="margin-right: 5px" class="general-calendar-next">{{ selectedDateStr }}</view>
        <am-icon type="down_" size="12" />
      </view>
      <view class="general-calendar-pre" onTap="queryNextDay">
        <view class="general-calendar-pre next-day">下一天</view>
        <view class="general-calendar-next a-text am-icon am-icon-right am-calendar-arrow inventory-day-text"></view>
      </view>
    </view>
    <view a:if="{{isError}}" style="margin-top: 40rpx">
      <error-view type="error" title="当天没有住院明细" />
    </view>
    <view a:if="{{!isError}}">
      <view class="general-money-title">本日花费金额(元)</view>
      <view class="general-money-cur">{{jsonData.details.spendToday}}</view>
      <view class="general-money">
        <view>
          <label class="general-money-label">剩余押金：</label>
          ¥{{jsonData.details.depositBalance}}
        </view>
        <view>
          <label class="general-money-label">累计花费：</label>
          ¥{{jsonData.details.spendTotal}}
        </view>
      </view>
    </view>
  </view>
  <!-- 支出明细 -->
  <view class="detail-block" a:if="{{!isError}}">
    <view class="detail-title">支出明细</view>
    <view class="detail-table">
      <view class="detail-table-title">
        <view class="detail-table-title-1">项目名称</view>
        <view class="detail-table-title-2">单价(元)</view>
        <view class="detail-table-title-3">数量</view>
        <view class="detail-table-title-4">单价(元)</view>
      </view>
      <view class="detail-table-data" a:for="{{jsonData.details.payItemList}}">
        <view class="detail-table-title-1">{{item.itemName}}</view>
        <view class="detail-table-title-2">{{item.itemPrice}}</view>
        <view class="detail-table-title-3">{{item.itemCount}}</view>
        <view class="detail-table-title-4">{{item.itemAmount}}</view>
      </view>
    </view>
  </view>
  <!-- 日历选择弹框 -->
  <view class="popup-mask" onTap="closeCalendar" a:if="{{calendarShow}}"></view>
  <view class="popup-calendar" a:if="{{calendarShow}}">
    <calendar type="single" haveYear="{{true}}" onSelect="handleSelect" onChange="onChange" onSelectHasDisableDate="onSelectHasDisableDate" />
  </view>
  <!-- 选择住院人弹框 -->
  <view>
    <choose-hospital onGetDatas="getJsonDataFn" selectIndex="{{ selectIndex }}" />
  </view>
</view>
