<import src="detail.skeleton.wxml" />
<template is="skeleton" wx:if="{{loading}}" />
<view class="header">
    <view class="title">{{detail.title}}</view>
    <Yl-tags wx:if="{{appAuth.isdatatag}}" id="Tags" add ownertable='sa_contract' ownerid='{{sa_contractid}}' />
</view>
<!-- 简介 -->
<Yl_Detail list="{{briefs}}">
    <Yl-group wx:if="{{appAuth.isdatateam}}" slot='bottom' id='Group' add ownertable='sa_contract' ownerid='{{sa_contractid}}' />
</Yl_Detail>
<view style="height: 20rpx;" />
<Yl_FunTabs list='{{tabsList}}' active='{{tabsActive}}' bind:onChenge="tabsChange">
    <Preview slot='详细信息' list1='{{list1}}' list2='{{list2}}' />
    <Trace resource='合同' slot='跟进动态' id='Trace' ownertable='sa_contract' ownerid='{{detail.sa_contractid}}' />
    <Work slot='任务' id='Work' ownertable='sa_contract' ownerid='{{detail.sa_contractid}}' disabled="{{isAdmin||isLeader}}" />
    <OrderForm slot='关联订单' id='OrderForm' />
    <PiscountProduct wx:if="{{detail.type=='经销商合作协议'||detail.type=='直销客户合作协议'||detail.type=='居间协议'}}" isSync="{{detail.type=='居间协议'}}" slot='产品明细折扣' id='PiscountProduct' disabled="{{(isAdmin||isLeader)&&detail.status=='新建'}}" />
    <Product wx:else slot='{{detail.type=="工具使用(借用)协议"?  "工具清单": "产品明细折扣"}}' isSync="{{detail.type=='居间协议'}}" synchronous='{{(detail.type=="经销项目协议" || detail.type=="直销项目协议")  && isLeader && detail.status=="新建"}}' disabled="{{(isAdmin||isLeader)&&detail.status=='新建'}}" id='Product' />
    <PiscountType isSync="{{detail.type=='居间协议'}}" slot='产品类别折扣' id='PiscountType' synchronous='{{(detail.type=="经销项目协议" || detail.type=="直销项目协议") && isLeader && detail.status=="新建"}}' disabled="{{(isAdmin||isLeader)&&detail.status=='新建'}}" />
    <Contacts slot='联系人' id='Contacts' />
    <Objective slot='业绩目标' id='Objective' disabled="{{(isAdmin||isLeader)&&detail.status=='新建'}}" />
    <Record slot="操作记录" id="Record" ownertable='sa_contract' ownerid='{{detail.sa_contractid}}' />
    <!-- <view slot='合同条款' /> -->
</Yl_FunTabs>
<!-- 底部 -->
<Yl_Tabbar list='{{tabbarList}}' bind:callback="tabbarOnClick" />