<!--pages/fixedAssets/fixedAssets.wxml-->
<view class="ns" id="top_ban" style="height:{{isIPX?'88px':'64px'}};">
  <image src="../../image/apply/back.png" style="top:{{isIPX?'54px':'30px'}};height: 19.0909px;" mode="widthFix" bindtap="back" referrer="no-referrer|origin|unsafe-url"></image>
  <text style="top:{{isIPX?'54px':'30px'}};">可关联资产</text>
</view>

<view class="search_box" id="top_view" style="margin-top:{{isIPX?'100px':'75px'}};">
  <view style="width:61%;">
    <van-search
    value="{{ name }}"
    shape="round"
    background="transparent"
    placeholder="请输入搜索关键词"
    clearable
    bind:change="goSearch"
  />
  </view>
  <view style="border:1px solid #ddd;background: #fff;border-radius: 30px;padding: 0 25rpx;width:34%;margin-top: 9px;line-height: 38px;height: 38px;">
      <picker bindchange="bindPickerChange" value="{{index}}" range="{{array}}" range-key="assetTableName">
          <view class="picker" style="text-align: center;">
            {{array[index].assetTableName}}
            <image src="../../image/icon/triangle.png" style="height:25rpx;width:25rpx;margin-right: 10rpx;"></image>
          </view>
        </picker>
    </view>
</view>
<scroll-view scroll-y refresher-threshold="0" wx:if="{{index == '0'}}" style="height:{{scrollHeight}}px" bindscrolltolower="paging" lower-threshold="100">
<van-swipe-cell class="workflow" wx:for="{{list}}" wx:key="index" wx:for-item="item">
  <view class="li" bindtap="goUpdate" data-item="{{item}}">
      <view class="tit_box">
        <image src="/image/icon/fixedAssets_icon.png" style="width: 15px;height: 15px;margin-right: 10px;"  referrer="no-referrer|origin|unsafe-url"></image>
        <text class="tit">{{item.name}}</text>
        <view style="flex:1;">
            <text wx:if="{{item.useType=='1'}}" style="text-align: center;float:right;font-size:12px;background:rgb(235, 154, 4,0.2);color:rgb(235, 154, 4);width:50px;line-height: 20px;">自用</text> 
            <text wx:if="{{item.useType=='2'}}" style="text-align: center;float:right;font-size:12px;background:rgb(235, 154, 4,0.2);color:rgb(235, 154, 4);width:50px;line-height: 20px;">闲置</text> 
            <text wx:if="{{item.useType=='3'}}" style="text-align: center;float:right;font-size:12px;background:rgb(235, 154, 4,0.2);color:rgb(235, 154, 4);width:70px;line-height: 20px;">出租或出借</text> 
            <text wx:if="{{item.useType=='4'}}" style="text-align: center;float:right;font-size:12px;background:rgb(235, 4, 4,0.2);color:rgb(235, 4, 4);width:50px;line-height: 20px;">其他</text>     
        </view>
      </view>
      <view class="detail_box">
        <view style="width: 55%;margin-left:5%;">{{item.code}}</view>
        <view style="width: 40%;">
            {{item.assetType}}
        </view>
      </view>

      <view class="detail_box">
        <view style="width: 60%;">
          <image src="/image/icon/clock_icon.png" style="width: 15px;height: 15px;border-radius:5px;margin-right: 5px;"></image>
          <text>{{item.buildTime}}</text>
        </view>
        <view style="width: 40%;text-align: right;">
          原值:
          <text style="color:red">￥{{item.originalValue}}</text>
        </view>
      </view>
  </view>
</van-swipe-cell>
</scroll-view>
<scroll-view scroll-y refresher-threshold="0" wx:if="{{index == '1'}}" style="height:{{scrollHeight}}px" bindscrolltolower="paging" lower-threshold="100">
<van-swipe-cell class="workflow" wx:for="{{list1}}" wx:key="index" wx:for-item="item" >
  <view class="li" bindtap="goUpdate1" data-item="{{item}}">
      <view class="tit_box">
        <image src="/image/icon/fixedAssets_icon.png" style="width: 15px;height: 15px;margin-right: 10px;"  referrer="no-referrer|origin|unsafe-url"></image>
        <text class="tit">{{item.name}}</text>
        <view style="flex:1;">
            <text wx:if="{{item.useType=='1'}}" style="text-align: center;float:right;font-size:12px;background:rgb(235, 154, 4,0.2);color:rgb(235, 154, 4);width:50px;line-height: 20px;">自用</text> 
            <text wx:if="{{item.useType=='2'}}" style="text-align: center;float:right;font-size:12px;background:rgb(235, 154, 4,0.2);color:rgb(235, 154, 4);width:50px;line-height: 20px;">闲置</text> 
            <text wx:if="{{item.useType=='3'}}" style="text-align: center;float:right;font-size:12px;background:rgb(235, 154, 4,0.2);color:rgb(235, 154, 4);width:70px;line-height: 20px;">出租或出借</text> 
            <text wx:if="{{item.useType=='4'}}" style="text-align: center;float:right;font-size:12px;background:rgb(235, 4, 4,0.2);color:rgb(235, 4, 4);width:50px;line-height: 20px;">其他</text>     
        </view>
      </view>
      <view class="detail_box">
        <view style="width: 55%;margin-left:5%;">{{item.code}}</view>
        <view style="width: 40%;">
            {{item.resourceType}}
        </view>
      </view>

      <view class="detail_box">
        <view style="width: 60%;">
          <image src="/image/icon/clock_icon.png" style="width: 15px;height: 15px;border-radius:5px;margin-right: 5px;"></image>
          <text>{{item.createTime}}</text>
        </view>
        <view style="width: 40%;text-align: right;">
          数量/面积:
          <text style="color:red">{{item.totalArea}}</text>
        </view>
      </view>
  </view>
</van-swipe-cell>
</scroll-view>