<!--pages/medinceRecord/medinceRecord.wxml-->
<wxs src="../../filters/filter.wxs" module="moduleFilter"></wxs>
<nav navName="用药记录"></nav>
<view class="page">
   <view class="conbox"  wx:if="{{option2.length>0}}">
    <view class="recordtitle" bindtap="showPicker">
    <view class="name">{{currentName}}</view>
    <image src="{{img_host+'/xia.png'}}" class="xia {{show?'active':''}}"></image>
  </view>
  <scroll-view scroll-y="true"  bindrefresherrefresh="handleRefresher" class="recordwrper scrollbox" refresher-triggered="{{isTriggered}}"	refresher-threshold="100"	refresher-enabled="true" bindscrolltolower="lower" wx:if="{{list.length>0}}">
    <view class="recordcell" wx:for="{{list}}" wx:key="family_id" wx:for-index="idx">
      <view class="namebox">
        <view class="name">{{item.patient_family.card_name_mask}}（<text wx:if="{{item.patient_family.sex==1}}">男</text><text wx:elif="{{item.patient_family.sex==2}}">女</text><text wx:else>未知</text>，{{item.patient_family.age}}岁）</view>
        <view class="date">{{moduleFilter.transforDay(item.created_at,'date')}}</view>
      </view>
      <view class="desc" wx:if="{{item.order_prescription_icd.length>0}}">
        <text class="sickname" wx:for="{{item.order_prescription_icd}}" wx:key="prescription_icd_id" wx:for-item="itemName">{{itemName.icd_name}}</text>
      </view>
      <view class="box" wx:if="{{item.order_product_item.length>0}}">
        <view class="recorddes" wx:for="{{item.order_product_item}}" wx:for-item="itemUnit">
        <text class="text">{{itemUnit.product_name}}{{itemUnit.product_spec}}（数量{{itemUnit.amount}}）</text>
      </view>
      </view>
      <view class="btnbox">
        <view class="btn" data-id="{{idx}}" data-familyid="{{item.patient_family.family_id}}" data-sex="{{item.patient_family.sex}}" bindtap="handleSeeDr" data-age="{{item.patient_family.age}}" data-name="{{tem.patient_family.card_name}}">续方复诊</view>
      </view>
    </view>
  </scroll-view>
  <view wx:else class="nonedata">暂无数据！</view>
  </view>
   
</view>
<van-popup show="{{ show }}" round position="bottom" bind:close="onClose">
  <van-picker title="全部就诊人" show-toolbar columns="{{ option2 }}" bind:cancel="onCancel" bind:confirm="onConfirm"></van-picker>
</van-popup>
<van-dialog
  title="温馨提示"
  message="是否更换就诊人？"
  show="{{ showdialog }}"
  show-cancel-button
  cancelButtonText="否"
  confirmButtonText="是"
  confirm-button-color="#3CC7C0"  bind:confirm="onConfirmDialog"  bind:cancel="onCloseDialog"

>
</van-dialog>
<dialog bind:confirm="confirmConsult" showDialog="{{showDialogConsult}}" message="您有仍在进行中的问诊，是否立即前往继续咨询？" ></dialog>