<import src="detail.skeleton.wxml" />
<template is="skeleton" wx:if="{{loading}}" />
<view class="header">
    <view class="title">{{detail.projectname}}</view>
    <Yl-tags wx:if="{{appAuth.isdatatag}}" id="Tags" add='{{disabled}}' ownertable='sa_project' ownerid='{{sa_projectid}}' bindonGetList='onGetList' />
</view>
<!-- 简介 -->
<Yl_Detail list="{{briefs}}">
    <view slot='bottom'>
        <Yl-group wx:if="{{appAuth.isdatateam}}" id='Group' add='{{disabled}}' ownertable='sa_project' ownerid='{{sa_projectid}}' />
        <TaskTabs id='TaskTabs' disabled='{{(isAdmin||isLeader) && disabled}}' 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 resource='项目商机' slot='跟进动态' id='Trace' ownertable='sa_project' ownerid='{{detail.sa_projectid}}' isAdmin="{{per.query(options,'expenseBreakdown')}}" />
    <Work slot='任务' id='Work' ownertable='sa_project' ownerid='{{detail.sa_projectid}}' disabled="{{(isAdmin||isLeader) && disabled}}" />
    <Task slot='项目评估' id='Task' disabled="{{(per.query(options,'assess')||isAdmin||isLeader) && disabled}}" />
    <Contract slot='合同' id='Contract' disabled="{{(per.query(options,'assess')||isAdmin||isLeader) && disabled}}" isInsert='{{isInsert}}' />
    <Treaty slot='关联客户' id='Treaty' disabled="{{(per.query(options,'client')||isAdmin||isLeader) && disabled}}" />
    <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)&& disabled}}" />
    <Opponent slot='竞争对手' id='Opponent' disabled="{{(per.query(options,'opposites')||isAdmin||isLeader) && disabled}}" />
    <Offers slot='报价单' id='Offers' disabled="{{(per.query(options,'offer')||isAdmin||isLeader)&& disabled}}" />
    <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}}' disabled="{{(per.query(options,'opposites')||isAdmin||isLeader) && disabled}}" />
    <Clue slot='关联线索' id="Clue" />
</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">
        {{language['查重']||'查重'}}
        <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"><text wx:for="{{item.projectname}}" wx:key="i" wx:for-item="it" wx:for-index="i" style="color: {{it.color}};">{{it.text}}</text></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>{{language[tag]||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>{{language[tag]||tag}}</van-tag>
        </view>
        <view class="exp" style="color: {{item.chars['status'] ? 'red' : '#666666'}}">{{language['项目状态']||'项目状态'}}:{{item.status ||' --'}}</view>
        <view class="exp" style="color: {{item.chars['projectnum'] ? 'red' : '#666666'}}">{{language['项目编号']||'项目编号'}}:{{item.projectnum ||' --'}}</view>
        <view class="exp" style="color: {{item.chars['address'] ? 'red' : '#666666'}}">{{language['项目地址']||'项目地址'}}:{{item.province+item.city+item.county+item.address}}</view>
        <view class="exp" style="color: {{item.chars['projecttype'] ? 'red' : '#666666'}}">{{language['项目类型']||'项目类型'}}:{{language[item.projecttype]||item.projecttype ||' --'}}</view>
        <view class="exp" style="color: {{item.chars['tradefield'] ? 'red' : '#666666'}}">{{language['领域']||'领域'}}:{{item.tradefield||' --'}}</view>
        <view class="exp" style="color: {{item.chars['brandName'] ? 'red' : '#666666'}}">{{language['品牌']||'品牌'}}:{{language[item.brandName]||item.brandName||' --'}}</view>
        <view class="exp" style="color: {{item.chars['leader'] ? 'red' : '#666666'}}">{{language['负责人']||'负责人'}}:{{item.leader[0].name||' --'}}</view>
        <view class="exp" style="color: {{item.chars['phonenumber'] ? 'red' : '#666666'}}">{{language['手机号']||'手机号'}}:{{item.phonenumber||" --"}}</view>
    </navigator>
</van-popup>
<!-- 结束 -->
<Dialog id='Dialog' />