<!--pages/agent/serviceBillDetail/index.wxml-->
<view class="panel mt-5">
  <view class="flex-align-start">
    <view style="flex:1">
      <view class="mt-5">
        <text class="colorInfo small">服务单号:</text>
        <text class="billno">{{orderMainData.billno}}</text>
      </view>
      <view class="mt-5">
        <t-tag class="mr-5" variant="light" shape="round" theme="primary" size="small">{{orderMainData.servicetype}}</t-tag>
        <t-tag class="mr-5" variant="light" shape="round" theme="primary" size="small">{{orderMainData.class1}}</t-tag>
        <t-tag class="mr-5" variant="light" shape="round" theme="primary" size="small">{{orderMainData.class2}}</t-tag>
      </view>
    </view>
    <view class="flex-align-center" wx:if="{{orderMainData.status === '新建'}}" >
      <!-- <view class="mr-10">
        <t-icon name="root-list" size="36rpx" bind:click="onIconTap" />
        <text style="font-size: 20rpx;">转工单</text>
      </view> -->
      <view class="mr-10" bindtap="onSubmit">
        <t-icon name="root-list" size="36rpx" bind:click="onIconTap" />
        <text style="font-size: 20rpx;">提交</text>
      </view>
      <view class="mr-10" bindtap="onEdit">
        <t-icon name="edit" size="36rpx" bind:click="onIconTap" />
        <text style="font-size: 20rpx;">编辑</text>
      </view>
      <view bindtap="onDelete">
        <t-icon name="delete" size="36rpx" bind:click="onIconTap" />
        <text style="font-size: 20rpx;">删除</text>
      </view>
    </view>
  </view>
  <view class="small"><text class="label">服务单类型:</text>{{orderMainData.servicetype}}</view>
  <view class="small"><text class="label">服务单状态:</text>{{orderMainData.status}}</view>
  <view class="small"><text class="label">开始日期:</text>{{orderMainData.begdate}}</view>
  <view class="small"><text class="label">结束日期:</text>{{orderMainData.enddate}}</view>
</view>
<!-- <view style="padding:5px" class="small"><text class="label">现场联系人</text></view> -->

<view class="panel mt-5">
  <view>
    <view class="small"><text class="label">姓名:</text>{{orderMainData.scenecontact}}</view>
    <view class="small flex-align-center">
      <text class="label">电话:</text>
      <t-call phone="{{orderMainData.scenecontactphonenumber}}"></t-call>
    </view>
    <view class="small"><text class="label">岗位:</text>{{orderMainData.scenecontactrole}}</view>
  </view>
</view>
<!-- <view style="padding:5px" class="small"><text class="label">关联订单</text></view> -->
<view class="panel mt-5" wx:if="{{orderMainData.sonum}}">
  <text class="label">关联订单:</text>{{orderMainData.sonum}}
</view>

<view class="panel mt-5">
  <view class="small">
    <text class="label">问题描述:</text>{{orderMainData.reason}}
  </view>

</view>
<view class="panel mt-5">
  <view class="small"><text class="label">附件信息:</text></view>
  <imageview wx:if="{{filelist.length > 0}}" list="{{filelist}}"></imageview>
</view>
<view>
  <t-tabs defaultValue="{{0}}" bind:change="onTabsChange" bind:click="onTabsClick" t-class="custom-tabs">
    <t-tab-panel label="关联工单" value="0">
      <t-cell wx:for="{{linkWorkOrders}}" wx:key="sa_serviceorderid" title="工单编号" bind:click="tolinkWorkOrder" note="{{item.billno}}" hover arrow />
    </t-tab-panel>
    <t-tab-panel wx:if="{{orderMainData.servicetype !== '售前' && orderMainData.servicetype !== '历史售后'}}" label="售后商品" value="1">
      <view style="padding:10px" wx:if="{{list.length === 0}}">
        <t-empty icon="cart" description="暂未添加商品">
          <t-button slot="action" theme="primary" size="extra-small" bindtap="addProduct">前往添加</t-button>
        </t-empty>
      </view>
      <view wx:else>
        <view style="text-align: right;border:1px solid #f1f2f3">
          <t-button theme="primary" size="small" icon="add" variant="text"  bindtap="addProduct">
          继续添加
          </t-button>
        </view>
        <view wx:for="{{list}}" wx:key="{{itemid}}">
          <product-card data="{{item}}" isdelete="{{true}}" bind:delete="onDelete"></product-card>
        </view>
        
      </view>
    </t-tab-panel>
  </t-tabs>
</view>
<t-dialog id="t-dialog" />
