<import src="detail.skeleton.wxml" />
<template is="skeleton" wx:if="{{loading}}" />

<view class="header">
    <view class="title">{{detail.projectname}}</view>
    <Yl-tags id="Tags" add ownertable='sa_project' ownerid='{{sa_projectid}}' bindonGetList='onGetList' />
</view>
<!-- 简介 -->
<Yl_Detail list="{{briefs}}">
    <view slot='bottom'>
        <Yl-group id='Group' add ownertable='sa_project' ownerid='{{sa_projectid}}' />
        <TaskTabs id='TaskTabs' disabled='{{isAdmin||isLeader}}' sa_projectid='{{sa_projectid}}' sa_projstagetempid='{{detail.sa_projstagetempid}}' bindchangeCallBack="taskTabsChange" />
    </view>
</Yl_Detail>
<view style="height: 20rpx;" />

<Yl_FunTabs list='{{tabsList}}' active='{{tabsActive}}' bind:onChenge="tabsChange">
    <Preview slot='详细信息' list1='{{list1}}' list2='{{list2}}' />
    <Trace slot='跟进动态' id='Trace' ownertable='sa_project' ownerid='{{detail.sa_projectid}}' />
    <Work slot='任务' id='Work' ownertable='sa_project' ownerid='{{detail.sa_projectid}}' disabled="{{isAdmin||isLeader}}" />
    <Task slot='项目评估' id='Task' disabled="{{per.query(options,'assess')||isAdmin||isLeader}}" />
    <Contract slot='合同' id='Contract' disabled="{{per.query(options,'assess')||isAdmin||isLeader}}" isInsert='{{isInsert}}' />
    <Treaty slot='关联客户' id='Treaty' disabled="{{per.query(options,'client')||isAdmin||isLeader}}" />
    <Product slot='产品配置单' id='Product' signamount_due="{{detail.signamount_due}}" discountrate="{{detail.discountrate * 100}}" disabled="{{(per.query(options,'product')||isAdmin||isLeader )&&detail.status=='跟进中'}}" />
    <Contacts slot='联系人' id='Contacts' disabled="{{per.query(options,'contacts')||isAdmin||isLeader}}" />
    <Opponent slot='竞争对手' id='Opponent' disabled="{{per.query(options,'opposites')||isAdmin||isLeader}}" />
    <Offers slot='报价单' id='Offers' disabled="{{per.query(options,'offer')||isAdmin||isLeader}}" isInsert='{{isInsert}}' />
    <Record slot='操作记录' id="Record" ownertable='sa_project' ownerid='{{detail.sa_projectid}}' />
    <ReportingProgress slot='报备进度' id='ReportingProgress' />
    <Files slot='附件' id="Files" ownertable='sa_project' ownerid='{{detail.sa_projectid}}' />
    <Clue slot='关联线索' id="Clue" />
    <view style="height: 140rpx;" />
</Yl_FunTabs>
<!-- 底部 -->
<Yl_Tabbar list='{{tabbarList}}' bind:callback="tabbarOnClick" />
<wxs src='../../utils/wxmlQueryPer.wxs' module="per" />

<!-- 查重 -->
<van-popup show="{{ repetitionShow }}" custom-class='popup' round position="bottom" custom-style="height: 100%;" bind:close="repClose">
    <view class="title">
        查重
        <van-icon custom-class='icon' size='40rpx' name="cross" bindtap="repClose" />
    </view>
    <navigator url="/packageA/project/detail?id={{item.sa_projectid}}" class="enterprise" wx:for="{{repetitionList}}" wx:key="sa_projectid">
        <view class="enterprise_title">{{item.projectname}}</view>
        <view class="tag-box">
            <van-tag custom-class='tag' wx:for="{{item.tag_sys}}" wx:key="index" wx:for-item='tag' color='#3874f6' text-color='#fff' round>{{tag}}</van-tag>
            <van-tag custom-class='tag' wx:for="{{item.tag}}" wx:key="index" wx:for-item='tag' color='#FA8C16' text-color='#fff' round>{{tag}}</van-tag>
        </view>
        <view class="exp">项目状态:{{item.status ||' --'}}</view>
        <view class="exp">项目编号:{{item.projectnum ||' --'}}</view>
        <view class="exp">项目地址:{{item.address ||' --'}}</view>
        <view class="exp">项目类型:{{item.projecttype ||' --'}}</view>
        <view class="exp">领域:{{item.tradefield||' --'}}</view>
        <view class="exp">品牌:{{item.brandname||' --'}}</view>
        <view class="exp">负责人:{{item.leader[0].name||' --'}}</view>
        <view class="exp">手机号:{{item.phonenumber||" --"}}</view>
    </navigator>
</van-popup>