<wxs src="../../../utils/format.wxs" module="format" />

<view class="whole-page">
	<view class="search-result" wx:if="{{isSearchResult}}"> 
	  <view class="result-left">
		<image mode="aspectFit" src="https://jzmall.lifejingzhi.com/file/wx-servant/new/icon-cal-white.png"></image>
		<view wx:if="{{orderType!=2}}">{{futureThirtyDaysStr}}-{{futureThirtyDaysEnd}}</view>
		<view wx:else>{{currentMonth}} 共服务{{lastMonthCount}}单</view>
	</view>
	<view class="result-right">
		<image mode="aspectFit" src="https://jzmall.lifejingzhi.com/file/wx-servant/new/icon-close-white.png"></image>
		<view bindtap="backStart">返回</view>
	</view>
	</view>
	<view class="average-order" wx:if="{{isMonthCalender&&orderType!=2}}">
	  <view>日均 {{avgDay}} 单</view>
		<view class="order-suggest" wx:if="{{dayTeamName!=''&&dayTeamName!='全天班'}}">建议：切换全天班可以有更多收入</view>
	</view>
	<view class="average-order" wx:if="{{isSearchResult&&orderType==2}}">
	  <view>{{currentMonth}} 共服务 {{lastMonthCount}} 单</view>
		<view class="order-suggest" wx:if="{{dayTeamName!=''&&dayTeamName!='全天班'}}">建议：切换全天班可以有更多收入</view>
	</view>
	<view class="calendar-board" wx:if="{{isMonthCalender}}">
	  <view class="cal-week-line">
		  <view wx:for="{{['一','二','三','四','五','六','日']}}" wx:key="index" class="week-item">
			{{item}}
			</view>
		</view>
		<view class="cal-day-line">
		  <view wx:for="{{futureThirtyDays}}" wx:key="index"  class="day-item-wrapper {{item.orderCount>=3?'whole-day':''}} {{item.day==currentDay?'current-day':''}} {{item.day<todayTag?'past-day':''}} {{(item.orderCount=='请假'||item.orderCount=='本休')?'leave-day':''}}">
			<view  class="day-item" bindtap="switchDayItem" data-day="{{item.day}}" data-name="{{item.teamName}}" data-week="{{item.weekOfYear}}" >
				<view class="day-sche" wx:if="{{item.day<todayTag}}"></view>
			    <view class="day-sche" wx:else>{{item.teamName}}</view>
					<view class="day">{{format.substrText(item.day,8,10)}}</view>
					<view  wx:if="{{item.day<todayTag}}" style="height:44rpx;"></view>
					<view class="order-num" wx:elif="{{item.orderCount=='请假'}}">请假</view>
					<view class="order-num" wx:elif="{{item.orderCount=='休息'}}">休息</view>
					<view class="order-num" wx:else>共{{item.orderCount}}单</view>
				
			</view>
			<view class="today-badge" wx:if="{{item.day==todayTag}}">
			今
			</view>

			</view>

		</view>



		<view wx:if="{{calcendarFold&&isMonthCalender}}" class="fold-calcendar" bindtap="calcendarCollapse">
      <!-- <image mode="aspectFit" src="/static/images/upgrade/icon-fold.png"></image> -->
			<view>展开</view>
			<image mode="aspectFit" src="/static/images/upgrade/icon-fold.png"></image>
			<!-- <image mode="aspectFit" src="/static/images/upgrade/icon-arrow-right.png"></image> -->
       
    </view>


	</view>


   <!-- 搜索框 -->
	 <view class="search-block"  bindtap="showCalendarBoard" wx:if="{{!isSearchResult}}">
		<image mode="aspectFit" src="https://jzmall.lifejingzhi.com/file/wx-servant/new/icon-calendar.png"></image>
		<view class="search-text">查询我的服务单</view>
	 </view>
	 <!-- 天气 -->
	 <view class="weather-block" bindtap="showSchedueBoard" wx:if="{{!isSearchResult}}">
	    <view class="weather-left">
			    <view class="today-text">
					{{today}}
					</view>
					<view class="weather-line">
						<image mode="aspectFit" src="{{weather.icon}}"></image>
						<view>{{weather.temperature}}°C</view>
						<view>天气 {{weather.weather}}</view>
						<view style="margin-left:30rpx;">今日 {{weather.week}}</view>
					</view>
			</view>
			<view class="weather-right">
			  <view class="work-mode {{dayTeamName=='全天班'?'whole-mode':''}} {{dayTeamName=='请假'?'leave-mode':''}} {{dayTeamName=='其他班'?'other-mode':''}}">{{dayTeamName}}</view>
				<view class="mode-tips" wx:if="{{dayTeamName=='全天班'}}">勤奋耕耘，快乐挣钱</view>
				<view class="mode-tips" wx:if="{{dayTeamName=='白班'}}">多劳多得，一天可做3单哦</view>
			</view>  
	 </view>
	 	<!-- 请假记录 -->
	<view class="leave-record-board" wx:if="{{leaveList.length>0}}">
	  <view class="leave-record-item" wx:for="{{leaveList}}" wx:key="index">
		  <view class="leave-record-title">
			 <view>请假记录</view>
			 <view class="leave-status {{item.stateName=='已通过'?'':'leave-refuse'}}">{{item.stateName}}</view>
			</view>
			<view class="leave-info">
				起：{{item.leaveStartTime}}</view>
				<view class="leave-info">
					止：{{item.leaveEndTime}}</view>
				<view class="leave-info" wx:if="{{item.auditComment}}">
					备注：{{item.auditComment}}</view>
		</view>
	</view>
	 <!-- 服务单信息 -->
	 <view class="service-order-new {{item.statusName=='服务已完成'?'finished-order':''}}" wx:for="{{serviceOrderList}}" wx:key="index" bindtap="goDetail" data-id="{{item.detailId}}">
	    <view class="service-title">
			<view class="title-left">
				<image mode="aspectFit" src="/static/images/upgrade/order@selected.png">
				</image>
				<view  wx:if="{{showjz}}">{{item.channel}}</view>
			
			</view>
			<view class="order-status">
				{{item.statusName}}
			</view>
			</view>
			<view class="service-content">
			     <view>服务内容</view>
					 <view class="detail">{{item.goodsName}}</view>
			</view>
			<view class="service-content">
			     <view>服务时间</view>
					 <view class="detail">{{item.bookDate}} {{item.bookTimeRange}}</view>
			</view>
			<view class="service-content" wx:if="{{item.unitIncreaseNumber>=1}}" >
			     <view>加购内容</view>
					 <view class="detail">{{item.unitDescribe}} * {{item.unitIncreaseNumber}}</view>
			</view>
			<view class="service-address">
			  <view class="address-dot"></view>
				<view class="address-detail">
					{{item.statusName=='服务已完成'?'信息保护中':item.addr}}
				</view>
			</view>
			<view class="service-tips">
			 <view class="tips-title">注意事项：</view>
			 <view class="tips-detail">{{item.customerServiceSr}}</view>
			</view>
			<!-- <view class="service-provision"  wx:if="{{showjz}}">
			   <view>预计计提¥ </view>
				 <view class="provision-amount">{{item.income}}</view>
			</view> -->
			<view class="service-tag-line">
			  <view class="{{label.level==1?'tag-important':'tag-common'}}" wx:for="{{item.labelList}}" wx:for-index="labelindex"  wx:key="labelindex"
                wx:for-item="label" >{{label.resultName}}</view>
			
			</view>

	 </view>

  
   <!-- 请假 -->
   <view class="leave-fold" bindtap="leaveFold" wx:if="{{false}}">
       <view class="fold-left">请假记录</view>
       <view class="fold-right">
           <view class="leave-num">{{dayCalendar.leaveNum}}</view>
           <image mode="aspectFit" src="{{isLeaveFold?'/static/images/upgrade/icon-leave-right.png':'/static/images/upgrade/icon-leave-down.png'}}"></image>

       </view>
   </view>
   <view class="leave-block" wx:if="{{!isLeaveFold}}">
     <view class="leave-item" wx:for="{{dayCalendar.askForLeaveDTOS}}" wx:key="index">
         <view class="leave-title">
            <image mode="aspectFit" src="/static/images/upgrade/icon-qjsq.png">
            </image>
            <view>请假申请</view>

         </view>
         <view class="leave-content">
            <view class="leave-line">
                <view>请假时间：</view>
                <view>{{item.leaveStartTime}}-{{item.leaveEndTime}}</view>
            </view>
            <view class="leave-line">
                <view>申请状态：</view>
                <view>{{item.stateName}}</view>
            </view>
            <view class="leave-line">
                <view>申请时间：</view>
                <view>{{item.createTime}}</view>
            </view>
            <view class="leave-line">
                <view>请假类型：</view>
                <view>{{item.leaveTypeName}}</view>
            </view>
            <view class="leave-line">
                <view>请假理由：</view>
                <view>{{item.leaveReason}}</view>
            </view>
            <view class="leave-line">
                <view>审批备注：</view>
                <view>{{item.auditComment}}</view>
            </view>
         </view>
     </view>
   </view>


<!-- 面试邀请 -->
<view class="interview" wx:if="{{false}}">
  <view class="interview-title">
    <image mode="aspectFit" src="https://jzmall.lifejingzhi.com/file/wx-servant/icon-interview.png"></image>
    <view>面试邀请</view>
  </view>
  <view class="interview-date">
    面试时间：2022年12月12日 08:00 - 11:00
  </view>
  <view class="interview-location">
    面试地点：上海市浦东撒娇翻领宽松的九分裤辣
弃物啊大萨达风的f答复是…
  </view>
  <view class="interview-operate">
    已通过
  </view>
</view>
  


   <!-- 服务工单 -->
 <view class="service-order {{item.status=='已取消'||item.status=='已退款'?'cancel-order':''}}" wx:for="{{dayCalendar.workerOrderInfoDTOList}}" wx:key="index">
     <view class="service-title">
       <view class="ser-title-left">
          <image mode="aspectFit"  src="{{item.status=='已取消'?'/static/images/upgrade/order.png':'/static/images/upgrade/order@selected.png'}}"></image>
          <view>服务工单
            <text wx:if="{{item.discipleNo!=''&&item.isDisciple==0}}"> - 有徒弟跟单</text>
        <text wx:if="{{item.discipleNo!=''&&item.isDisciple==1}}"> - 徒弟跟单</text>
          </view>
       </view>
       <view class="ser-title-right" >
        <image mode="aspectFit" src="/static/images/upgrade/icon-hm.png" wx:if="{{!format.indexOf(item.bookTradeNo,'JZ')}}"></image>
          <view>{{item.channel}}</view>
       </view>
     </view>
     <view class="related-info" wx:if="{{item.status!='已取消'}}">
       <view class="column">
         <view class="title">相关信息</view>
         <view>客户剩余总服务次数：{{item.cusRemain}}次</view>
       </view>
       <!-- 消息 -->
       <view class="notice" wx:if="{{item.rebuySpeach!=''}}">
       <image mode="aspectFit" src="/static/images/upgrade/icon-alert.png"></image>
       <view>
       {{item.rebuySpeach}}
       </view>
       
       </view>
       <view class="row">服务内容：{{item.goodsName}} </view>
       <view class="row" wx:if="{{item.unitIncreaseNumber&&item.unitIncreaseNumber>0}}">加购内容：{{item.unitDescribe}}* {{item.unitIncreaseNumber}}</view>
       <view class="row">客户信息： {{item.syncTag}} {{item.cusStatus}}</view>
       <view class="column">
         <view>订单类型：{{item.itemType}}</view>
         <view>此次服务进度：{{item.serviceProcess}}</view>
       </view>
       <view class="row">预采需求：{{item.preCollectInfo}}</view> 
       <view class="row">客服备注：{{item.customerServiceSr?item.customerServiceSr:''}} {{item.special?item.special:''}}</view>  

     </view>
     <view class="service-info">
      <view class="order-num">
        <view>服务单号：{{item.bookTradeNo}}</view>
        <image src="/static/images/upgrade/icon-copy.png" mode="aspectFit" class="copy-img" bindtap="copyNum" data-bookno="{{item.bookTradeNo}}"></image>
				<view style="color:#09afff; margin:0 10rpx 0 40rpx; font-size:28rpx ;" bindtap="supplyCode" data-bookno="{{item.bookTradeNo}}">发起补差</view>
				<!-- <view style="color:#09afff; margin:0 10rpx 0 40rpx; font-size:28rpx ;" bindtap="supplyCode" data-bookno="{{item.bookTradeNo}}">补差二维码</view> -->
				<image src="/static/images/upgrade/qrcode.png" mode="aspectFit"  style="width:36rpx; height:36rpx;padding-top:6rpx;" bindtap="supplyCode" data-bookno="{{item.bookTradeNo}}"></image>
	
			
      </view>
      <view class="row service-status">
        <view>当前状态：{{item.status}}</view>
       


        <view class="invite-comment" wx:if="{{item.canEval}}">可邀评</view>
        <view class="hp-wrapper" wx:if="{{item.evalType=='好评'}}">
          <image src="/static/images/upgrade/icon-hp.png" mode="aspectFit" class="hp-img" ></image>
        <text>好评</text>
        </view>
       
        <view class="cp-wrapper" wx:if="{{item.evalType=='差评'}}">
          <image src="/static/images/upgrade/icon-cp.png" mode="aspectFit" class="cp-img"></image>
          <text>差评</text>
        </view>
      </view>

       <!-- 师父单子 -->
       <block wx:if="{{item.discipleNo!=''&&item.isDisciple==0}}">
          <view class="row">跟单徒弟：{{item.discipleName}}</view>
          <view class="column">
        <view>徒弟电话：{{item.disciplePhone}}</view>
        <image src="/static/images/upgrade/icon-phone1.png" mode="aspectFit" class="callup-img" bindtap="callUp" data-phone="{{item.disciplePhone}}"  wx:if="{{item.status=='待上门'||item.status=='待履约'||item.status=='已预约'}}" data-status="{{item.status}}"></image>
      </view>
      </block>
      <!-- 徒弟单子 -->
      <block  wx:if="{{item.discipleNo!=''&&item.isDisciple==1}}">
        <view class="row">跟单师傅：{{item.workerName}}</view>
          <view class="column">
        <view>师傅电话：{{item.workerTel}}</view>
        <image src="/static/images/upgrade/icon-phone1.png" mode="aspectFit" class="callup-img" bindtap="callUp" data-phone="{{item.workerTel}}"  wx:if="{{item.status=='待上门'||item.status=='待履约'||item.status=='已预约'}}" data-status="{{item.status}}"></image>
      </view>
      </block>

      <view class="row">服务时间：{{item.startTime}} - {{item.endTime}}</view>
      <view class="column">
        <view>客户手机：{{item.maskUserPhone}}</view>
        <image src="/static/images/upgrade/icon-phone1.png" mode="aspectFit" class="callup-img" bindtap="callUp" data-phone="{{item.userPhone}}"  wx:if="{{item.status=='待上门'||item.status=='待履约'||item.status=='已预约'}}" data-status="{{item.status}}"></image>
      </view>
      <view class="address">
        <view>服务地址：</view>
        <view class="detail">{{item.addr}}</view>
        <image src="/static/images/upgrade/icon-map1.png" bindtap="openMap" 
        
        data-status="{{item.status}}"  data-lnglat="{{item.addrDetail}}"  data-address="{{item.addr}}" wx:if="{{item.status=='待上门'||item.status=='待履约'||item.status=='已预约'}}"></image>
      </view>
      <view class="row">客户备注：{{item.cusRemark}}</view>
      
     </view>
     <view class="operate-block">
     
            <!-- 单据详情 跟单体会/评价徒弟 联系客户 立即导航  isDisciple 1是徒弟 0否-->
        <view class="operate-item" bindtap="goDetail" data-id="{{item.bookTradeNo}}">
            <image src="{{orderDisable1?'/static/images/upgrade/icon-detail2.png':'/static/images/upgrade/icon-detail.png'}}">
            </image>
            <view class="blue-font">单据详情</view>
        </view>
        <!-- wx:if="{{item.discipleNo!=''&&item.isDisciple==1&&!item.isDiscipleFeedback}}" -->
        <view class="operate-item" bindtap="evalMaster" data-id="{{item.bookTradeNo}}" data-workerno="{{item.workerNo}}" wx:if="{{item.discipleNo!=''&&item.isDisciple==1&&!item.isDiscipleFeedback&&item.status=='服务已完成'}}">
            <image src="https://jzmall.lifejingzhi.com/file/wx-servant/icon-gdth.png">
            </image>
            <view class="blue-font">跟单体会</view>
        </view>
        <!-- wx:if="{{item.discipleNo!=''&&item.isDisciple==0&&item.ojtState!=2}}" -->
        <view class="operate-item" bindtap="evalDisciple" data-id="{{item.bookTradeNo}}" data-workerno="{{item.workerNo}}"  wx:if="{{item.discipleNo!=''&&item.isDisciple==0&&item.ojtState!=2&&item.status=='服务已完成'}}" >
            <image src="https://jzmall.lifejingzhi.com/file/wx-servant/icon-pjtd.png">
            </image>
            <view class="blue-font">评价徒弟</view>
        </view>

        <view class="{{item.status!='待上门'&&item.status!='待履约'&&item.status!='已预约'?'disable':''}} operate-item" bindtap="callUp" data-status="{{item.status}}" data-phone="{{item.userPhone}}">
            <image src="{{item.status!='待上门'&&item.status!='待履约'&&item.status!='已预约'?'/static/images/upgrade/icon-phone4.png':'/static/images/upgrade/icon-phone3.png'}}">
            </image>
            <view>联系客户</view>
        </view>

        <view class="operate-item" data-channel="{{item.channel}}"  data-id="{{item.bookTradeNo}}" bindtap="getQrCode">
          <image src="/static/images/upgrade/qrcode.png">
          </image>
          <view>加企微</view>
        </view>

        <view class="{{item.status!='待上门'&&item.status!='待履约'&&item.status!='已预约'?'disable':''}} operate-item" bindtap="openMap" 
         data-status="{{item.status}}"  data-lnglat="{{item.addrDetail}}"  data-address="{{item.addr}}">
            <image src="{{item.status!='待上门'&&item.status!='待履约'&&item.status!='已预约'?'/static/images/upgrade/icon-map2.png':'/static/images/upgrade/icon-map1.png'}}">
            </image>
            <view>立即导航</view>
        </view>
				<view bindtap="supplyRecord"  data-status="{{item.status}}" class="operate-item"
          data-bookno="{{item.bookTradeNo}}" >
          <image style="width:24rpx;height:26rpx"
            src="/static/images/upgrade/icon-detail.png" >
          </image>
          <view>补差记录</view>
        </view>

      

     </view>

 </view>

   <!-- 档期计算器 -->
   <!-- <image mode="aspectFit" src="/static/images/upgrade/dqjsq.png"   class="dqjsq" bindtap="goSchedule"></image> -->

</view>


<!-- 跟单体会 -->
<van-overlay show="{{evalMasterShow}}"bind:click="onClickMsterOverlay" custom-style="z-index:9999;" >
  <view class="overlay-wrapper"  >
    <view class="star-wrapper" catchtap="stop"> 
       <view class="title">
        跟单体会
       </view>
       <view class="van-rate-wrapper">
       <van-rate value="{{ star }}" bind:change="onStarChange" size="{{ 36 }}"/>
      </view>
      <textarea class="comment-area" value="{{masterComment}}" bindinput="bindMasterComment" placeholder="请输入跟单体会" 
      placeholder-style="font-size:24rpx;color:#999;">
      </textarea>
    </view>
    <view class="submit-eval" catchtap="submitEvalMaster">立即提交</view>
  </view>
</van-overlay> 

<!-- 徒弟打分 -->
<van-overlay show="{{evalDiscipleShow}}"bind:click="onClickDiscipleOverlay" custom-style="z-index:9999;" >
  <view class="overlay-wrapper" >
    <view class="star-wrapper" catchtap="stop"> 
       <view class="title">
        徒弟打分
       
       </view>
       <view class="van-rate-wrapper">
        <van-radio-group value="{{ radioDisciple }}" bind:change="onRadioChange" direction="horizontal">
  <van-radio name="通过"  icon-size="26px">通过</van-radio>
  <van-radio name="不通过" icon-size="26px">不通过</van-radio>
</van-radio-group>

      </view>
      <textarea class="comment-area" value="{{discipleComment}}" bindinput="bindDiscipleComment" placeholder="请输入跟单体会" 
      placeholder-style="font-size:24rpx;color:#999;">
      </textarea>
    </view>
    <view class="submit-eval" catchtap="submitEvalDisciple">立即提交</view>
  </view>
</van-overlay> 

<!-- 日历弹框 -->
<van-overlay show="{{calendarBoardShow}}"bind:click="onCalendarOverlay" custom-style="z-index:9999;" >
  <view class="overlay-wrapper cal-overlay-wrapper" >
    <view class="cal-overlay-board" catchtap="preventClick">
		  <view class="board-title">
			  <view>未来 1 个月</view>
				<view>{{futureOrderCount}} 单</view>
			</view>
			<view class="month-btn" bindtap="showFuture">点击查看详情</view>
			<view class="history-title">历史服务单</view>
			<view class="month-list">
			   <view class="month-item" wx:for="{{monthOrderCount}}" wx:key="index" data-month="{{item.month}}" data-count="{{item.count}}" bindtap="switchMonthItem">
				    <view class="month-title">{{item.month}}</view>
						<view class="month-num">{{item.count}} 单</view>
				 </view>
			</view>
			<view class="history-tips">
				可查看过去 6 个月数据</view>
		</view>

	</view>
</van-overlay>


<!-- 排班弹框 -->
<van-overlay show="{{schedueBoardShow}}"bind:click="onSchedueOverlay" custom-style="z-index:9999;" >
  <view class="overlay-wrapper sche-overlay-wrapper" >
		<view class="weather-block" catchtap="preventClick">
	    <view class="weather-left">
			    <view class="today-text">
					{{today}}
					</view>
					<view class="weather-line">
						<image mode="aspectFit" src="{{weather.icon}}"></image>
						<view>{{weather.temperature}}°C</view>
						<view>天气 {{weather.weather}}</view>
						<view style="margin-left:30rpx;">今日 {{weather.week}}</view>
					</view>
			</view>
			<view class="weather-right">
			  <view class="work-mode {{dayTeamName=='全天班'?'whole-mode':''}} {{(dayTeamName=='请假'||dayTeamName=='本休')?'leave-mode':''}} {{dayTeamName=='其他班'?'other-mode':''}}">{{dayTeamName}}</view>
				<view class="mode-tips" wx:if="{{dayTeamName=='全天班'}}">勤奋耕耘，快乐挣钱</view>
				<view class="mode-tips" wx:if="{{dayTeamName=='白班'}}">多劳多得，一天可做3单哦</view>
			</view>
	 </view>
    <view class="sche-overlay-board" catchtap="preventClick">
		<view class="schedue-list">
		   <view class="schedue-item" wx:for="{{dayTeam}}" wx:key="index">
			   <view class="dot"></view>
				 <view class="schedue-date">{{item.startDate}}-{{item.endDate}}</view>
				 <view>{{item.teamName}}
				 </view>

			 </view>
		</view>
    <view class="schedue-apply-title">
			我要申请换排班
		</view>
		<view class="schedue-apply-btn" bindtap="goApplySche">
		  <view>申请更换班组</view>
			<view class="tips">档期全开挣钱越多</view>
		</view>
		<view class="schedue-apply-title">
			我要请假
		</view>
		<view class="schedue-apply-btn" bindtap="goLeavepost">
		  <view>请假</view>
			<view class="tips">申请必须得到批准通知</view>
		</view>
		<view class="leave-history" bindtap="goLeaveHistory">历史请假记录</view>
		 
		<view  bindtap="addpreview"  
		style="font-size: 36rpx; margin-top:20rpx;  color:red; text-align: center;">
			添加预检单 
			</view>


		</view>

</view>
</van-overlay>
<contact-mov pageX="500" pageY="1000"></contact-mov>
<!-- 
<issue-mov pageX="500" pageY="1000" issue="rr"></issue-mov> -->