<!--components/inner-device-card/index.wxml-->
<view class="sg-item sg-white-bg sg-pad sg-margin-bottom" bindtap="switchChecked" data-index="{{index}}">
  <view class="sg-top sg-flex sg-space-between sg-bottom-border sg-pad-bottom-sm sg-font-small sg-bold">
    <view class="sg-name">{{item.inner_name ? item.inner_name : ''}} - {{item.spec_name ? item.spec_name : ''}}
    </view>
    <view class="sg-flex sg-align-center">
      <view class="sg-status sg-flex sg-align-center" wx:if="{{showStatus}}">
        <view class="sg-dot" style="background: {{item.status ? item.status.color : ''}}"></view>
        <view class="sg-status-name">{{item.status ? item.status.name : ''}}</view>
      </view>
      <view class="sg-status sg-flex sg-align-center sg-font-lg" wx:if="{{showChecked}}">
        <van-icon name="passed" wx:if="{{item.checked}}" class="sg-index-color" />
        <van-icon name="circle" wx:else />
      </view>
      <view class="sg-status sg-flex sg-align-center sg-font-lg" style="margin-left:15rpx" wx:if="{{showDelete}}" catchtap="delete"
        data-index="{{index}}">
        <van-icon name="clear" />
      </view>
      <view style="margin-left:15rpx" class="sg-align-center sg-flex">
        <van-icon class="sg-action sg-index-color sg-icon" wx:if="{{action=='record'}}" name="notes-o" catchtap="navigate"
        data-url="/pages/use-record/index?id={{item.id}}"></van-icon>
      </view>
    </view>
  </view>
  <view class="sg-body sg-font-xs sg-bottom-border sg-pad-bottom-sm">
    <view class="sg-item sg-margin-tb-sm sg-flex">
      <view class="sg-left-item">固定资产编号：{{item.number}}</view>
    </view>
    <view class="sg-item sg-margin-tb-sm sg-flex">
      <view class="sg-left-item sg-width-50">外形尺寸：{{item.shape}}</view>
      <view class="sg-right-item sg-width-50">采购原值：{{item.buy_origin}}</view>
    </view>
    <view class="sg-item sg-margin-tb-sm sg-flex">
      <view class="sg-right-item sg-width-50">出厂日期：{{item.produce_date}}</view>
      <view class="sg-right-item sg-width-50">生产厂家：{{item.manufacturer}}</view>
    </view>
  </view>
  <view class="sg-bottom sg-font-xs sg-flex sg-align-center sg-space-between">
    <view class="sg-left">
      <view class="sg-item sg-margin-tb-sm">目前在用项目：{{item.project ? item.project.name : '无'}}</view>
      <view class="sg-item sg-margin-tb-sm">
        借用时间：{{item.start_date ? item.start_date + '至' + item.end_date : (item.pivot ? item.pivot.start_date + '至' + item.pivot.end_date : '无')}}
      </view>
    </view>
    <view class="sg-white sg-pad-sm sg-index-bg" wx:if="{{editDate}}" catchtap="editDate" data-index="{{index}}">修改时间
    </view>
  </view>
</view>