<!--pages/workorder/index.wxml-->
<view class="setup">

<view class="workorder_list">
  <view class="owner_type1">
					<view class="calculation_strategy">
						<text style="color: red;margin-right: 8rpx;">*</text>工单标题
					</view>
					<view class="event">
						<view class="switch-container">
							<view class="owner_easyinput1">
								<view class="calculation_use">
									<input class="uni-mt-5" trim="all" value="{{workorderName}}" clearSize="0"
										placeholder="请输入工单标题" 	bindinput="onPeakprice"></input>
								</view>
							</view>
 
						</view>
					</view>
				</view>
        <view class="owner_type1">
    <picker bindchange="bindeventChange" value="{{index}}" range="{{array}}">
					<view class="calculation_top">
						<view class="calculation_left">
              <text style="color: red;margin-right: 8rpx;">*</text>事件
						</view>
            <view class="event">
						<view class="uni-input">{{array[index]}}</view>
							<t-icon name="chevron-right" size="40rpx" data-name="chevron-right"/>
            </view>
					</view>
				</picker>
				
				</view>
        <view class="owner_type1">
          <picker mode="date" value="{{datestart}}" start="2000-01-01" end="2060-09-01" bindchange="bindstartChange">
					<view class="calculation_top">
						<view class="calculation_left">
              <text style="color: red;margin-right: 8rpx;">*</text>
              开始时间
						</view>
            <view class="event">
						<view class="uni-inputcolor" wx:if="{{datestart==''}}">请选择开始时间</view>
						<view class="uni-input" wx:else>{{datestart}}</view>
							<t-icon name="chevron-right" size="40rpx" data-name="chevron-right"/>
            </view>
					</view>
				</picker>
        </view>
        <view class="owner_type1">
          <picker mode="date" value="{{dateend}}" start="2000-01-01" end="2060-09-01" bindchange="bindendChange">
					<view class="calculation_top">
						<view class="calculation_left">
              <text style="color: red;margin-right: 8rpx;">*</text>
              结束时间
						</view>
            <view class="event">
						<view class="uni-inputcolor" wx:if="{{dateend==''}}">请选择结束时间</view>
						<view class="uni-input" wx:else>{{dateend}}</view>
							<t-icon name="chevron-right" size="40rpx" data-name="chevron-right"/>
            </view>
					</view>
				</picker>
        </view>

    
        <!-- <view class="owner_type1">
          <picker bindchange="bindPickerChange" value="{{typeindex}}" range="{{typelist}}">
					<view class="calculation_top">
						<view class="calculation_left">
              <text style="color: red;margin-right: 8rpx;">*</text>类型
						</view>
            <view class="event">
						<view class="uni-input">{{typelist[typeindex]}}</view>
							<t-icon name="chevron-right" size="40rpx" data-name="chevron-right"/>
            </view>
					</view>
				</picker>
        </view> -->
        <view class="owner_type1">
          <picker bindchange="bindpowerChange" value="{{powerindex}}" range="{{powerdata}}" range-key="powerstationName">
					<view class="calculation_top">
						<view class="calculation_left">
              <text style="color: red;margin-right: 8rpx;">*</text>电站
						</view>
            <view class="event">
						<view class="uni-input" wx:if="{{powerdata[powerindex].powerstationName}}">{{powerdata[powerindex].powerstationName}}</view>
						<view class="uni-inputcolor" wx:else>请选择电站</view>
							<t-icon name="chevron-right" size="40rpx" data-name="chevron-right"/>
            </view>
					</view>
				</picker>
        </view>
        <view class="owner_type1">
        <!-- <view class="owner_type1" > -->
          <!-- <picker disabled="{{namelist.length == 0}}" value="{{nameindex}}" range="{{namelist}}" range-key="partnerName" bindchange="bindPickerChange"> -->
					<view class="calculation_top" bind:tap="{{namelist.length > 0 ? 'bindPickerChange' : 'showEmptyTip'}}">
						<view class="calculation_left">
              <text style="color: red;margin-right: 8rpx;">*</text>处理人
						</view>
            <view class="event">
            <view class="events">
            	<view class="inputpartnerName" wx:for="{{checkedItems}}" wx:key="index">{{item.partnerName}}</view>
						<view class="uni-inputcolor"  wx:if="{{checkedItems.length==0}}">请选择处理人</view>
            </view>
					
							<t-icon name="chevron-right" size="40rpx" data-name="chevron-right"/>
            </view>
					</view>
				<!-- </picker> -->
      
        </view>
        <view class="owner_type1">
          <!-- <picker disabled="{{namelist.length == 0}}" bindchange="binddeviceChange" value="{{deviceindex}}" range="{{devicedata}}" range-key="devicesName"> -->
					<view class="calculation_top" bind:tap="{{namelist.length > 0 ? 'binddeviceChange' : 'showEmptyTip'}}">
						<view class="calculation_left">
              <text style="color: red;margin-right: 8rpx;">*</text>设备/巡检
						</view>
            <view class="event">
              <view class="events">
            	<view class="inputpartnerName" wx:for="{{equipmentItems}}" wx:key="index">{{item.devicesName}}</view>
						<view class="uni-inputcolor"  wx:if="{{equipmentItems.length==0}}">请选择设备/巡检</view>
            </view>
							<t-icon name="chevron-right" size="40rpx" data-name="chevron-right"/>
            </view>
					</view>
				<!-- </picker> -->
      
        </view>
       
        <view class="owner_type1">
        	<view class="calculation_strategy">
					<text style="color: red;margin-right: 8rpx;">*</text>工单优先级
					</view>
					<view class="calculation_capsule">
            <t-radio-group default-value="{{priority}}" borderless t-class="box" bindchange="onradio">
  <t-radio block="{{false}}" label="低" value="1" />
  <t-radio block="{{false}}" label="中" value="2" />
  <t-radio block="{{false}}" label="高" value="3" />
</t-radio-group>
					</view>
        </view>
        <view class="owner_type1" wx:if="{{index==1}}">
					<view class="calculation_strategy">
						<text style="color: red;margin-right: 8rpx;">*</text>报修地点
					</view>
					<view class="event">
						<view class="switch-container">
							<view class="owner_easyinput1">
								<view class="calculation_usebox">
									<input class="uni-mt-5" trim="all" value="{{workorderAddress}}" clearSize="0"
										placeholder="请输入报修地点"	bindinput="onaddress"></input>
               
								</view>
							</view>

						</view>
					</view>
				</view>
     
        <view class="owner_type1x">
					<view class="calculation_strategy">
						附件上传
					</view>
					<view class="event">
						<view class="switch-container">
							<view class="owner_easyinput1">
              <view class="calculation_imagebox" wx:if="{{partnerAvite}}" wx:for="{{partnerAvite}}" wx:key="index">
							 <image class="calculation_image" 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>
								<view class="calculation_usebox1" bind:tap="bindtoImage">
                    <t-icon name="add" size="100rpx" data-name="add"/>
								</view>
							</view>
              
						</view>
					</view>
				</view>
        <view class="owner_type2">
        	<view class="calculation_strategy">
            <text style="color: red;margin-right: 20rpx;"></text>描述
					</view>
					<view class="calculation_capsule1">
            <t-textarea
  t-class="external-class"
  placeholder="请输入描述"
  maxlength="200"
  value="{{workorderContent}}"
  disableDefaultPadding="{{true}}"
  indicator
  bindchange="ontextarea"
/>
					</view>
        </view>
</view>

<view style="height: 200rpx;"></view>
</view>

<view class="workorder_box">

<view class="workorder" bind:tap="onworkorder">提交</view>
</view>
<t-popup visible="{{equipment}}" bind:visible-change="onVisibleChange" placement="bottom">
  <view class="block">
    <view class="header">
      <view class="btn btn--cancel" aria-role="button" bind:tap="onVisibleChange">取消</view>
      <view class="title">设备/巡检</view>
      <view class="btn btn--confirm" aria-role="button" bind:tap="Indeedbutton2">确定</view>
    </view>
    <scroll-view scroll-y="true" class="checkbox">
    <view wx:for="{{devicedata}}" wx:key="index" data-index="{{index}}" bind:tap="togequipment">
    <view class="weui-cell">
   <view>{{item.devicesName}}</view> 
   <view class="weui-cell__bd" wx:if="{{item.isChecked}}">✔</view>
    </view>
    </view>
    </scroll-view>
  </view>
</t-popup>
<t-popup visible="{{visible}}" bind:visible-change="onVisibleChange" placement="bottom">
  <view class="block">
    <view class="header">
      <view class="btn btn--cancel" aria-role="button" bind:tap="onVisibleChange">取消</view>
      <view class="title">处理人</view>
      <view class="btn btn--confirm" aria-role="button" bind:tap="Indeedbutton1">确定</view>
    </view>
    <scroll-view scroll-y="true" class="checkbox">
    <view wx:for="{{namelist}}" wx:key="index" data-index="{{index}}" bind:tap="toggleCheck">
    <view class="weui-cell" style="background-color: {{item.isChecked?'rgba(60, 158, 250, 0.1)':''}};">
   <view>{{item.partnerName}}</view> 
   <view class="weui-cell__bd" wx:if="{{item.isChecked}}">✔</view>
    </view>
    </view>
    </scroll-view>
  </view>
</t-popup>