<!--pages/Workorderdetails/index.wxml-->
<view class="process_bj1" wx:if="{{workorder.workorderType==1&&workorder.examineType==4}}">
<view class="process_name">待处理...</view>

<image class="process_tp" src="https://esos-iot.bjdexn.cn/myminio/project/b5f745598db6435aac98a4a2b31284d3.png" mode="aspectFit"/>
</view>
<view class="process_bj2" wx:if="{{workorder.workorderType==2&&workorder.examineType==4}}">
<view class="process_name">处理中...</view>
<image class="process_tp" src="https://esos-iot.bjdexn.cn/myminio/project/40dbc668f38a4208940e76a120477467.png" mode="aspectFit"/>
</view>
<view class="process_bj3" wx:if="{{workorder.workorderType==3&&workorder.examineType==5}}">
<view class="process_name">待审核...</view>
<image class="process_tp" src="https://esos-iot.bjdexn.cn/myminio/project/746fd45617b0466cbbe138d8e6dc0567.png" mode="aspectFit"/>
</view>
<view class="process_bj4" wx:if="{{workorder.examineType==6}}">
<view class="process_name">审核成功...</view>
<image class="process_tp" src="https://esos-iot.bjdexn.cn/myminio/project/a76948bfa5094d4c90e2a4c5514481e1.png" mode="aspectFit"/>
</view>
<view class="process_bj5" wx:if="{{workorder.examineType==7}}">
<view class="process_name">审核失败...</view>
<image class="process_tp" src="https://esos-iot.bjdexn.cn/myminio/project/8de18dd8fd204b2d95477a2f2f890ba8.png" mode="aspectFit"/>
</view>
<!-- <view class="flow_box">
  <view class="block">
  <view class="flowflow_name">工单流程</view>
  <t-steps layout="vertical" current="{{first}}" bind:change="onFirstChange">
    <t-step-item title="张三创建维修工单" content="2025-11-12 12:11:22"/>
    <t-step-item title="李四开始处理工单" content="2025-11-12 12:11:22"/>
    <t-step-item title="工单处理中" content="2025-11-12 12:11:22"/>
    <t-step-item title="工单处理完成" content="2025-11-12 12:11:22"/>
    <t-step-item title="工单待审核" content="2025-11-12 12:11:22"/>
    <t-step-item title="工单审核成功" content="2025-11-12 12:11:22"/>
    <t-step-item title="工单审核失败" content="2025-11-12 12:11:22"/>
  </t-steps>
</view>
</view> -->
<view class="flow_box">
  <view class="flowflow">
<!-- <view class="flowflow_name">工单信息</view> -->
<view class="flow_content"> 
<!--  -->
<view class="order" wx:if="{{workorder.workoderReason!=''&&workorder.workoderReason!=null}}"><view class="workorder">审核失败原因：</view><view>{{workorder.workoderReason||'--'}}</view> </view>


<view class="order"  wx:if="{{workorder.examineCount!=0&&workorder.examineCount!=null&&workorder.workoderReason==''&&workorder.workoderReason==null}}"><view class="workorder">退回工单原因：</view><view>{{workorder.lastfail||'--'}}</view> </view>
<view class="order" data-name="{{workorder.workorderName}}" bind:tap="onqrcode"><view class="workorder">工单名称：</view> {{workorder.workorderName}}</view>

<view class="order"><view class="workorder">工单所属：</view> {{workorder.powerstationname}} > {{workorder.devicesname}}</view>
<view class="order"><view class="workorder">创建人：</view> {{workorder.promotername}}</view>
<view class="order"><view class="workorder">工单类型：</view> <text wx:if="{{workorder.type==1}}">日常</text><text wx:if="{{workorder.type==2}}">故障</text> <text wx:if="{{workorder.type==3}}">其他</text>  </view>
<view class="order"><view class="workorder">工单开始时间：</view> {{workorder.workorderStarttime}}</view>
<view class="order"><view class="workorder">工单结束时间：</view> {{workorder.workorderEndtime}}</view>
<view class="order"><view class="workorder">工单编号：</view> {{workorder.workorderId}}</view>
<view class="order"><view class="workorder">创建时间：</view>{{workorder.workorderTime}}</view>
<view class="order"><view class="workorder">位置：</view>{{workorder.workorderAddress}}</view>
<view class="order"><view class="workorder">问题描述：</view>{{workorder.workorderContent}}</view>
<view class="order"><view class="workorder">故障照片：</view><image wx:for="{{workorder.workorderImg}}" wx:key="index" class="workorderimg" src="{{item}}" mode="aspectFit" data-src="{{item}}" bindtap="previewImage"/></view>
</view>
</view>
<view class="block">
  <view class="order"><view class="workorder">处理人：</view>{{workorder.partnername}}</view>
<view class="order"><view class="workorder">当前状态：</view>
 <text wx:if="{{workorder.workorderType==1}}">待处理</text> 
 <text wx:if="{{workorder.workorderType==2}}">处理中</text> 
 <text wx:if="{{workorder.workorderType==3}}">工单完成</text> 
 
 </view>
 <view class="order"><view class="workorder">地点签到：</view>{{workorder.devicesRange||'--'}}</view>

 <view class="order" wx:if="{{workorder.workorderType==3}}"><view class="workorder">审核状态：</view>
 <text wx:if="{{workorder.examineType==5}}">待审核</text> 
 <text wx:if="{{workorder.examineType==6}}">审核完成</text> 
 <text wx:if="{{workorder.examineType==7}}">审核失败</text> 
 </view>
<view class="order"><view class="workorder">处理前照片：</view>
<view wx:if="{{workorder.workoderstationimg}}">
  <image wx:for="{{workorder.workoderstationimg}}" wx:key="index" class="workorderimg" src="{{item}}" mode="" data-src="{{item}}" bindtap="previewImage"/>
</view>
<text wx:else>--</text>
</view>
<view class="order"><view class="workorder">处理后照片：</view>
<view wx:if="{{workorder.workoderendimg}}">
<image wx:for="{{workorder.workoderendimg}}" wx:key="index" class="workorderimg" src="{{item}}" mode="" data-src="{{item}}" bindtap="previewImage"/>
</view>
<text wx:else>--</text>
</view>

<view class="order"><view class="workorder">处理开始时间：</view>{{workorder.workodersubmittime||'--'}}</view>
<view class="order"><view class="workorder">处理结束时间：</view>{{workorder.workoderResulttime||'--'}}</view>
<view class="order"><view class="workorder">反馈：</view>{{workorder.workoderendContent||'--'}}</view>

  </view>
</view>
<view style="height: 130rpx;" wx:if="{{workorder.examineType!=6&&workorder.examineType!=7}}"></view>
<view style="height: 60rpx;"></view>
<view class="step" wx:if="{{workorder.examineType!=6&&workorder.examineType!=7}}">
<view class="step_button" bind:tap="onstep" wx:if="{{workorder.workorderType==1&&partnerPosition.partnerId == workorder.workoderPartnerId&&partnerPosition.partnerId == workorder.workoderPartnerId}}">开始工单</view>
<view class="step_button" bind:tap="onstep" wx:if="{{workorder.workorderType==2&&partnerPosition.partnerId == workorder.workoderPartnerId}}">提交工单</view>
<!-- <view class="step_button" bind:tap="onstep" wx:if="{{workorder.workorderType==3}}">待审核</view> -->
<view class="onreview" wx:if="{{workorder.workorderType==3&&workorder.examineType==5&&workorder.permission==1&&partnerPosition.partnerId == workorder.workorderPromoterId}}">
  <view class="step_buttonfailure" data-type="不通过" bind:tap="bindreview">不通过</view>
  <view class="step_button" data-type="6" bind:tap="bindreview">通过</view>
</view>
</view>
<t-popup
  visible="{{visible}}"
  bind:visible-change="onVisibleChange"
  placement="bottom"
>
  <view class="popup_box">
    <view class="Scan_problem">
<view class="Scan_feedback1" wx:if="{{workorder.workorderType==1}}">
 <view class="Scan_width"><t-icon name="qrcode" size="40rpx" data-name="qrcode"/><view class="Scancode_left"><text style="color: red;">*</text>设备码</view> </view>
  <view class="Scancode_right1" wx:if="{{!switchtype}}" bind:tap="scancode"><view><t-icon name="scan" size="100rpx" data-name="scan"/></view> <view class="Scancode_lefticon1">
   点击扫码</view> </view>
   <view wx:else>{{result}}</view>
</view>
<!-- <view bind:tap="onqrcode">
{{scanCode.result}}|{{scanCode.rawData}}
</view> -->
<view class="Scan_feedback1" wx:if="{{workorder.workorderType==1}}">
 <view class="Scan_width"><t-icon name="map-information-2" size="40rpx" data-name="map-information-2"/><view class="Scancode_left"><text style="color: red;">*</text>设备范围</view> </view>
  <view class="Scancode_right1">
   <view class="Scancode_lefticon1" wx:if="{{canCheckin}}">
   <!-- {{distance}}米 -->
   <text class="position_left">到达范围</text></view>
   <view class="Scancode_lefticon1" wx:else>
   <!-- {{distance}}米 -->
   <text class="position_left">不在范围</text></view>
    </view> <view class="position" bind:tap="onposition"><t-icon name="refresh" size="40rpx" data-name="refresh"/> <text class="position_left">刷新</text> </view>
</view>
<view class="Scan_feedback" wx:if="{{workorder.examineType==4}}">
<view class="Scan_width"><t-icon name="image" size="40rpx" data-name="image"/>
<view class="Scancode_left" wx:if="{{workorder.workorderType==1}}">处理前图片</view> 
<view class="Scancode_left" wx:if="{{workorder.workorderType==2}}">处理后图片</view> 
</view>
<view class="calculation_imagebox" wx:if="{{partnerAvite}}" wx:for="{{partnerAvite}}" wx:key="index">
  <image class="Scan_image" wx:if="{{partnerAvite}}" src="{{item}}" mode="aspectFit" data-src="{{item}}" bindtap="previewImage"/>
              <t-icon class="calculation_imagex" data-index="{{index}}" bind:tap="bindCancel" name="close-circle" size="30rpx" data-name="close-circle"/>
              </view>

 <!-- <image class="Scan_image" src="https://esos-iot.bjdexn.cn/myminio/project/8c06ea7e8bfe4b49ab1e3a60132dda3a.jpg" mode=""/>
 <image class="Scan_image" src="https://esos-iot.bjdexn.cn/myminio/project/8c06ea7e8bfe4b49ab1e3a60132dda3a.jpg" mode=""/> -->
<view class="Scancode_lefticon" bind:tap="bindtoImage">
  <t-icon name="add" size="60rpx" data-name="add"/>
 </view>
</view>
<view class="Scan_feedback" wx:if="{{workorder.workorderType==2||bindreviewtype=='不通过'}}">
<view class="Scan_width"><t-icon name="chat-message" size="40rpx" data-name="chat-message"/>
<view class="Scancode_left">问题反馈</view>
 </view>
  <view class="Scancode_textarea"><t-textarea
  t-class="external-class"
  placeholder="请输入描述"
  maxlength="200"
  value="{{workorderContent}}"

  disableDefaultPadding="{{true}}"
  indicator
  bindchange="ontextarea"
/></view>
</view>
</view>
<view class="onstep">
<view class="onstepbutton" bind:tap="submit" wx:if="{{workorder.workorderType==1&&switchtype}}">开始处理</view>
<view class="onstepbuttonccc" wx:if="{{workorder.workorderType==1&&!switchtype}}">开始处理</view>
<view class="onstepbutton" bind:tap="submit" wx:if="{{workorder.workorderType==2}}">完成处理</view>
<view class="step_buttonfailure" wx:if="{{bindreviewtype=='不通过'}}" data-type="7" bind:tap="bindreview">不通过</view>
</view>
  </view>
</t-popup>
<!-- 
  
 -->