<import src="detail.skeleton.wxml" />
<template is="skeleton" wx:if="{{loading}}" />
<view class="intr">
    <view class="num">
        {{detail.sonum}}
    </view>
    <view class="tags">
        <text wx:if="{{detail.brandname}}" style="background-color: #0079FE;">{{detail.brandname}}</text>
        <text wx:if="{{detail.tradefield}}" style="background-color: #4BD863;">{{detail.tradefield}}</text>
    </view>
    <view class="exp">订单类型：{{detail.type}}</view>
    <view class="exp">单据日期：{{detail.billdate || '暂无'}}</view>
    <view class="exp">订单状态：{{detail.status}}</view>
    <view wx:if="{{detail.sa_contractid}}" class="exp">借用套数：{{detail.toolcount}}套</view>
    <view class="exp">订单金额：{{detail.amount}}元</view>
</view>
<navigator url="#" class="box location" bindtap="selectConsignee">
    <van-icon custom-class='icon' name="location" />
    <view class="content">
        <view class="name">
            {{detail.contacts.name || '暂无'}}<text>{{detail.contacts.phonenumber}}</text>
        </view>
        <view class="address">
            {{detail.contacts.address}}
        </view>
    </view>
    <view class="iconfont icon-dibu-bianji" />
</navigator>
<navigator url="#" class="box location" bindtap="selectFinance">
    <view class="content">
        <view class="name">
            开票单位
        </view>
        <view class="address">
            {{detail.finance.enterprisename || '暂无'}}
        </view>
    </view>
    <view class="iconfont icon-dibu-bianji" />
</navigator>
<!-- 合同信息 -->
<view wx:if="{{detail.sa_contractid}}" url="#" class="box location">
    <view class="content">
        <view class="name">
            合同单号：{{detail.contract.billno}}
        </view>
        <view class="address">
            有效期：{{detail.contract.begdate}}-{{detail.contract.enddate}}
        </view>
    </view>
</view>
<view class="box" style="padding: 10rpx 30rpx;">
    <view class="row">
        <view class="label">订单备注</view>
        <textarea disabled="{{detail.status!='新建'}}" bindtap="isEdit" class="remarks" placeholder-class='placeholder' bindblur="changeRemarks" value="{{detail.remarks}}" auto-height placeholder="订单备注" />
    </view>
</view>
<view style="height: 20rpx;" />
<Yl_FunTabs list='{{tabsList}}' active='{{tabsActive}}' bind:onChenge="tabsChange">
    <Product slot='借用工具明细' id='Product' disabled="{{detail.status!='新建'}}" isAdd='{{detail.sa_contractid}}' />
    <Yl_Attachment slot='附件' id='Yl_Attachment' ownertable="sa_order" ownerid="{{detail.sa_orderid}}" disabled="{{detail.status!='新建'}}" />
    <Progress slot='订单进度' id='Progress' />
</Yl_FunTabs>
<view style="height: 130rpx;" />
<view class="footer">
    <view class="count">
        {{detail.amount}}元
    </view>
    <view class="but-box">
        <van-button custom-class='but delete' wx:if="{{detail.status=='新建'}}" bind:click="deleteItem">删除订单</van-button>
        <van-button custom-class='but' wx:if="{{detail.status=='新建'}}" bind:click="submit">提交订单</van-button>
        <van-button custom-class='but' wx:if="{{detail.status=='交期待确认'}}" bind:click="notarize">确认交期</van-button>
    </view>
</view>