<!--{include file="<!--{$oetplpath}-->block_head.tpl"}-->

<!--{if $a == "run"}-->
<div class="layui-fluid oe_fluid">
  <form class="layui-form" id="mysearch" action="<!--{$oefile}-->&c=<!--{$c}-->" method="post">
  <div class="oe_breadcrumb_box clearfix">
    <div class="layui-breadcrumb fl" lay-filter="breadcrumb" style="visibility: visible;">
      <a href="javascript:;">内容管理</a><span lay-separator="">/</span>
      <a href="javascript:;">委托服务</a><span lay-separator="">/</span>
      <a><cite>服务列表</cite></a>
    </div>   
  </div>
  <!--//top end -->
  
  <div class="oe_searchbar layui-form">
    <div class="more_search_open"></div>
    <div class="layui-form-item">
      
      <div class="layui-inline">
        <div class="layui-form-label">&nbsp;会员UID：</div>
        <div class="layui-input-inline input-150">
          <input type="text" name="suserid" id="suserid" class="layui-input" value="<!--{if $suserid > 0}--><!--{$suserid}--><!--{/if}-->" />
        </div>
      </div>
      <div class="layui-inline">
        <div class="layui-form-label">会员名：</div>
        <div class="layui-input-inline input-150">
          <input type="text" name="susername" id="susername" class="layui-input" value="<!--{$susername}-->" />
        </div>
      </div>
      <div class="layui-inline">
        <div class="layui-form-label">委托单号：</div>
        <div class="layui-input-inline input-150">
          <input type="text" name="sservno" id="sservno" class="layui-input" value="<!--{$sservno}-->" />
        </div>
      </div>
      <br />
      <div class="layui-inline">
        <div class="layui-form-label">委托类型：</div>
        <div class="layui-input-inline input-150">
          <!--{hook mod="var" item="entrust_linetype" type="select" name="slinetype" text="不限" value=$slinetype}-->
        </div>
      </div>
      <div class="layui-inline">
        <div class="layui-form-label">进&nbsp;&nbsp;&nbsp;度：</div>
        <div class="layui-input-inline input-150">
          <select name="sflag" id="sflag">
            <option value="">不限</option>
            <option value="1"<!--{if $sflag == '1'}--> selected<!--{/if}-->>已审核，待付款</option>
            <option value="2"<!--{if $sflag == '2'}--> selected<!--{/if}-->>服务中</option>
            <option value="3"<!--{if $sflag == '3'}--> selected<!--{/if}-->>服务完成</option>
            <option value="3"<!--{if $sflag == '4'}--> selected<!--{/if}-->>待审核</option>
          </select>
        </div>
      </div>
      <div class="layui-inline">
        <button class="layui-btn layui-btn-sm search" id="but_submit_search2" lay-submit lay-filter="searchform2">
          <i class="layui-icon layui-icon-search"></i>
          搜索
          <span class="oe_btn_loading layui-anim layui-icon layui-anim-rotate layui-anim-loop" style="display:none;">&#xe63d;</span>
        </button>
      </div>
    </div>
  </div>
  <!--//search End -->
  </form>

  <div class="oe_table_wrap layui-form">
    <div class="oe_tbl_tool clearfix">
      <div class="oe_gnbar clearfix">
        <div class="select btn fl">
          <input type="checkbox" id="id[]" name="allid[]" lay-skin="primary" title="全选" lay-filter="selectAll">
        </div>
        <div class="btn del fl del_line" f="handle-array" data-form="myform">
          <i class="layui-icon layui-icon-delete"></i>
          <span>删除</span>
        </div>
      </div>
      <div class="oe_tongji_bar clearfix current">
        <span><b><!--{$total}--></b> 条记录</span>
      </div>
    </div>
    <form class="layui-form" id="myform" action="<!--{$oefile}-->&c=<!--{$c}-->" method="post">
    <table class="layui-table">
      <thead>
        <tr>
          <th width="4%">选</th>
          <th width="15%">单号</th>
          <th width="4%">头像</th>
          <th width="8%">用户名</th>
          <th width="8%">姓名</th>
          <th width="9%">手机</th>
          <th width="8%">类型</th>
          <th width="9%">委托时间</th>
          <th width="8%">费用</th>
          <th width="9%">付款时间</th>
          <th width="9%">进度</th>
          <th>操作</th>
        </tr>
      </thead>
      <!--{if empty($lineserv)}-->
      <tr>
        <td class="text_center" colspan="12">没有符合条件的信息！</td>
      </tr>
      <!--{else}-->
      <!--{foreach $lineserv as $volist}-->
      <tr>
        <td class="text_center check">
          <input type="checkbox" name="id[]" id="id[]" lay-skin="primary" class="selall" value="<!--{$volist.servid}-->" />
        </td>
        <td class="text_center"><!--{$volist.servno}--></td>
        <td class="text_center"><img src="<!--{$volist.headimg}-->" width="20px" height="20px" f="viewimg" /></td>
        <td class="text_center">
          <a href="<!--{$oefile}-->&c=user&a=view&id=<!--{$volist.userid}-->"><!--{$volist.username}--></a>
        </td>
        <td class="text_center"><!--{$volist.truename}--></td>
        <td class="text_center"><!--{$volist.mobile}--></td>
        <td class="text_center">
          <!--{hook mod="var" item="entrust_linetype" type="text" value=$volist.linetype}-->
        </td>
        <td class="text_center">
          <!--{$volist.addtime|date_format:"%Y-%m-%d"}--><br />
          <!--{$volist.addtime|date_format:"%H:%M:%S"}-->
        </td>
        <td class="text_center">¥<!--{$volist.fee}--></td>
        <td class="text_center">
          <!--{if $volist.paytime > 0}-->
          <!--{$volist.paytime|date_format:"%Y-%m-%d"}-->
          <!--{else}-->
          --
          <!--{/if}-->
        </td>
        <td class="text_center">
          <!--{if $volist.flag == '1'}-->
          <font color="blue">已审核，待付款</font>
          <!--{elseif $volist.flag == '2'}-->
          <font color="orange">服务中</font>
          <!--{elseif $volist.flag == '3'}-->
          <font color="green">服务完成</font>
          <!--{else}-->
          <font color="gray">等待处理</font>
          <!--{/if}-->
        </td>
        <td class="text_center">
          <a href="<!--{$oefile}-->&c=<!--{$c}-->&a=view&id=<!--{$volist.servid}-->&<!--{$comeurl}-->" class="layui-btn layui-btn-xs">管理</a>
          <a href="javascript:;" data-url="<!--{$oefile}-->&c=<!--{$c}-->&a=del&id[]=<!--{$volist.servid}-->&<!--{$comeurl}-->" class="layui-btn layui-btn-xs layui-btn-danger">删除</a>
        </td>
      </tr>
      <!--{/foreach}-->
      <!--{/if}-->
    </table>
    </form>
    
    <div class="oe_page_box"><!--{$showpage}--></div>
    
  </div>
</div>
<script type="text/javascript">
$(function(){
    layui.use(['layer', 'element'], function(){

    });
});
</script>
<!--{/if}-->

<!--{if $a == 'view'}-->
<div class="layui-fluid oe_fluid">

  <div class="oe_breadcrumb_box clearfix">
    <div class="layui-breadcrumb fl" lay-filter="breadcrumb" style="visibility: visible;">
      <a href="javascript:;">内容管理</a><span lay-separator="">/</span>
      <a href="javascript:;">委托服务</a><span lay-separator="">/</span>
      <a><cite>委托内容</cite></a>
    </div>
    <div class="oe_tool_bar ft">
      <a href="<!--{$oefile}-->&c=<!--{$c}-->&<!--{$comeurl}-->" class="layui-btn layui-btn-sm layui-btn-primary layui-btn-radius">返回列表</a>
    </div> 
  </div>
  
  
  <div class="layui-card">
    <div class="layui-card-header">
      委托服务
      <span class="text_tip_inline">(<!--{$lineserv.servno}-->)</span>
    </div>
    
    <div class="layui-card-body">
      <table class="oe_tbl_form layui-form oe_edit_table">
        <tr>
          <th>委托单号：</th>
          <td><!--{$lineserv.servno}--></td>
        </tr>
        <tr>
          <th width="15%">委托人：<span class="f_red"></span> </th>
          <td colspan="85%">
            <img src="<!--{$lineserv.user.headimg}-->" width="25px" height="25px" f="viewimg" />uid:<!--{$lineserv.user.userid}-->/<!--{$lineserv.user.username}--> <!--{hook mod="var" item="gender" type="text" value=$lineserv.user.gender}--> <!--{$lineserv.user.age}-->岁 <!--{area type="text" value=$lineserv.user.dist1}--> <!--{area type="text" value=$lineserv.user.dist2}-->
          </td>
        </tr>
        <tr>
          <th>联系方式：</th>
          <td>
            姓名：<!--{$lineserv.user.truename}--> 
            手机：<!--{$lineserv.user.mobile}--> 
            邮箱：<!--{$lineserv.user.email}--> 
            QQ：<!--{$lineserv.user.qq}--> 
            微信：<!--{$lineserv.user.weixin}--> 
          </td>
        </tr>
        <tr>
          <th>委托时间：</th>
          <td><!--{$lineserv.addtime|date_format:"%Y-%m-%d %H:%M:%S"}--></td>
        </tr>
        <tr>
          <th>委托需求：</th>
          <td>
            <!--{$lineserv.demand}-->
          </td>
        </tr>
      </table>
    </div>
    
    <div class="layui-card-header">
      委托内容
    </div>
    <div class="layui-card-body">
      <table class="oe_tbl_form layui-form oe_edit_table">
        <tr>
          <th width="15%">服务类型：</th>
          <td width="85%">
            <!--{hook mod="var" item="entrust_linetype" type="text" value=$lineserv.linetype}-->
          </td>
        </tr>
        <!--{if $lineserv.linetype == "1"}-->
        <tr>
          <th>委托内容：<span class="f_red"></span> </th>
          <td>
            #ID：<!--{$lineserv.relid}-->
            征婚启事：<!--{$lineserv.entrust.title}--><br />
            已报名人数：<!--{$lineserv.entrust.bmnums}-->人&nbsp;&nbsp;&nbsp;可选人数：<!--{$lineserv.entrust.cansels}-->人
          </td>
        </tr>
        <!--{elseif $lineserv.linetype == "2"}-->
        <tr>
          <th>委托内容：<span class="f_red"></span> </th>
          <td>
            #ID：<!--{$lineserv.relid}-->
            征婚启事：<!--{$lineserv.entrust.title}--><br />
            已报名人数：<!--{$lineserv.entrust.bmnums}-->人
          </td>
        </tr>
        <tr>
          <th>征婚发布人：<span class="f_red"></span> </th>
          <td>
            <img src="<!--{$lineserv.entrust.headimg}-->" width="25px" height="25px" f="viewimg" />uid:<!--{$lineserv.entrust.userid}-->/<!--{$lineserv.entrust.username}--> <!--{hook mod="var" item="gender" type="text" value=$lineserv.entrust.gender}--> <!--{$lineserv.entrust.age}-->岁 <!--{area type="text" value=$lineserv.entrust.dist1}--> <!--{area type="text" value=$lineserv.entrust.dist2}-->
          </td>
        </tr>
        <tr>
          <th>联系方式：</th>
          <td>
            姓名：<!--{$lineserv.entrust.truename}--> 
            手机：<!--{$lineserv.entrust.mobile}--> 
            邮箱：<!--{$lineserv.entrust.email}--> 
            QQ：<!--{$lineserv.entrust.qq}--> 
            微信：<!--{$lineserv.entrust.weixin}--> 
          </td>
        </tr>
        <!--{elseif $lineserv.linetype == "3"}-->
        <tr>
          <th>牵线对象：<span class="f_red"></span> </th>
          <td>
            <img src="<!--{$lineserv.entrust.headimg}-->" width="25px" height="25px" f="viewimg" />uid:<!--{$lineserv.entrust.userid}-->/<!--{$lineserv.entrust.username}--> <!--{hook mod="var" item="gender" type="text" value=$lineserv.entrust.gender}--> <!--{$lineserv.entrust.age}-->岁 <!--{area type="text" value=$lineserv.entrust.dist1}--> <!--{area type="text" value=$lineserv.entrust.dist2}-->
          </td>
        </tr>
        <tr>
          <th>联系方式：</th>
          <td>
            姓名：<!--{$lineserv.entrust.truename}--> 
            手机：<!--{$lineserv.entrust.mobile}--> 
            邮箱：<!--{$lineserv.entrust.email}--> 
            QQ：<!--{$lineserv.entrust.qq}--> 
            微信：<!--{$lineserv.entrust.weixin}--> 
          </td>
        </tr>
        <!--{elseif $lineserv.linetype == "4"}-->
        <tr>
          <th>邀约信息：</th>
          <td>
            #ID：<!--{$lineserv.relid}--><br />
            邀约编号：<!--{$lineserv.entrust.yueno}-->
          </td>
        </tr>
        <tr>
          <th>邀约对象：<span class="f_red"></span> </th>
          <td>
            <img src="<!--{$lineserv.entrust.headimg}-->" width="25px" height="25px" f="viewimg" />uid:<!--{$lineserv.entrust.userid}-->/<!--{$lineserv.entrust.username}--> <!--{hook mod="var" item="gender" type="text" value=$lineserv.entrust.gender}--> <!--{$lineserv.entrust.age}-->岁 <!--{area type="text" value=$lineserv.entrust.dist1}--> <!--{area type="text" value=$lineserv.entrust.dist2}-->
          </td>
        </tr>
        <tr>
          <th>联系方式：</th>
          <td>
            姓名：<!--{$lineserv.entrust.truename}--> 
            手机：<!--{$lineserv.entrust.mobile}--> 
            邮箱：<!--{$lineserv.entrust.email}--> 
            QQ：<!--{$lineserv.entrust.qq}--> 
            微信：<!--{$lineserv.entrust.weixin}--> 
          </td>
        </tr>
        <!--{/if}-->
      </table>
    </div>
    
    <div class="layui-card-header">
      红娘服务
    </div>
    <div class="layui-card-body">
      <table class="oe_tbl_form layui-form oe_edit_table">
        <tr>
          <th width="15%">服务进度：</th>
          <td width="85%">
            <!--{if $lineserv.flag == '1'}-->
            <font color="blue">已审核，待付款</font>
            <!--{elseif $lineserv.flag == '2'}-->
            <font color="orange">服务中</font>&nbsp;&nbsp;&nbsp;
            <a href="javascript:;" class="oe_ico_green" data-text="确定要完成服务？一旦操作不可恢复。" f="handle-one" data-url="<!--{$oefile}-->&c=<!--{$c}-->&a=savefinish&id=<!--{$lineserv.servid}-->&<!--{$comeurl}-->">完成服务</a>
            <!--{elseif $lineserv.flag == '3'}-->
            <font color="green">服务完成</font>
            <!--{else}-->
            <font color="gray">待审核</font>&nbsp;&nbsp;&nbsp;
            <a href="javascript:;" f="pop_lineserv_audit" data-id="<!--{$lineserv.servid}-->" class="oe_deluploadimg">审核操作</a>
            <!--{/if}-->
          </td>
        </tr>
        <tr>
          <th>服务费用：<span class="f_red"></span> </th>
          <td >¥<!--{$lineserv.fee}--></td>
        </tr>
        <tr>
          <th>付款时间：<span class="f_red"></span> </th>
          <td >
          <!--{if $lineserv.paytime > 0}-->
          <!--{$lineserv.paytime|date_format:"%Y-%m-%d %H:%M:%S"}-->
          <!--{else}-->
          --
          <!--{/if}-->
          </td>
        </tr>
        <tr>
          <th>服务红娘：</th>
          <td>
            <!--{$lineserv.marker}-->&nbsp;&nbsp;&nbsp;
            手机：<!--{$lineserv.mkmobile}-->
            电话：<!--{$lineserv.mktel}-->
          </td>
        </tr>
        <tr>
          <th>服务开始时间：</th>
          <td>
          <!--{if $lineserv.begintime > 0}-->
          <!--{$lineserv.begintime|date_format:"%Y-%m-%d %H:%M:%S"}-->
          <!--{else}-->
          --
          <!--{/if}-->
          </td>
        </tr>
        <tr>
          <th>服务结束时间：</th>
          <td>
          <!--{if $lineserv.endtime > 0}-->
          <!--{$lineserv.endtime|date_format:"%Y-%m-%d %H:%M:%S"}-->
          <!--{else}-->
          --
          <!--{/if}-->
          </td>
        </tr>
        <tr>
          <th>备注说明：</th>
          <td>
          <!--{if !empty($lineserv.remark)}-->
          <!--{$lineserv.remark}-->
          <!--{else}-->
          --
          <!--{/if}-->
          </td>
        </tr>
      </table>
    </div>
    
    <!--//body End -->
  </div>
</div>
<!--{/if}-->

<!--{if $a == "audit"}-->
<div class="layui-fluid oe_fluid" style="padding-top:15px;">
  <div class="layui-card oe_table_edit">
    <table class="oe_tbl_form layui-form">
      <tr>
        <th>委托单号：<span class="f_red"></span></th>
        <td colspan="3">
          <!--{$lineserv.servno}-->
        </td>
      </tr>
      <tr>
        <th>委托人：</th>
        <td colspan="3">
          <img src="<!--{$lineserv.user.headimg}-->" width="25px" height="25px" f="viewimg" />uid:<!--{$lineserv.user.userid}-->/<!--{$lineserv.user.username}--> <!--{hook mod="var" item="gender" type="text" value=$lineserv.user.gender}--> <!--{$lineserv.user.age}-->岁 <!--{area type="text" value=$lineserv.user.dist1}--> <!--{area type="text" value=$lineserv.user.dist2}-->
        </td>
      </tr>
      <tr>
        <th width="15%">服务费用：<span class="f_red"></span> </th>
        <td width="35%">
          <input type="text" name="fee" id="fee" class="layui-input input-150" /> 元
        </td>
        <th width="15%"><font color="red">*</font>服务红娘：</th>
        <td width="35%">
          <input type="text" name="marker" id="marker" class="layui-input input-150" />
        </td>
      </tr>
      <tr>
        <th>红娘手机：<span class="f_red"></span> </th>
        <td>
          <input type="text" name="mkmobile" id="mkmobile" class="layui-input input-150" />
        </td>
        <th><font color="red">*</font>红娘电话：</th>
        <td>
          <input type="text" name="mktel" id="mktel" class="layui-input input-150" />
        </td>
      </tr>
      <tr>
        <th>备注说明：<span class="f_red"></span></th>
        <td colspan="3">
          <textarea class="layui-textarea" name="remark" id="remark" style="width:80%;height:60px;"><!--{$lineserv.remark}--></textarea>
        </td>
      </tr>
      
      <tr>
        <td colspan="4" style="line-height:35px;">
          <span class="text_tip_inline">(如果有服务费，会员付款成功之后服务生效)</span>
        </td>
      </tr>
      
    </table>
  </div>
  
  <div class="oe_tbl_form_btn current">
    <button class="layui-btn" f="btn_save" id="btn_save">
      审核通过
      <span class="oe_btn_loading layui-anim layui-icon layui-anim-rotate layui-anim-loop" style="display:none;">&#xe63d;</span>
    </button>
  </div>
  
</div>
<script type="text/javascript">
$(function(){
    
    $(document).on("click", "[f='btn_save']", function(){
        $obj_id = $(this).attr("id");
        
        
        $fee = $("#fee").val();
        $marker = $("#marker").val();
        $mkmobile = $("#mkmobile").val();
        $mktel = $("#mktel").val();
        $remark = $("#remark").val();

        if ($marker.length == 0) {
            layer.msg("服务红娘不能为空");
            return false;
        }
        if ($mkmobile.length == 0 && $mktel.length == 0) {
            layer.msg("红娘手机或者电话至少填写一项");
            return false;
        }
        
        $("#"+$obj_id).find("span").show();
        
        $.ajax({
            type: "POST",
            url: _OECPFILE+"&c=<!--{$c}-->",
            cache: false,
            data: {
                a:"saveaudit", id:"<!--{$lineserv.servid}-->", fee:$fee, marker:$marker, 
                mkmobile:$mkmobile, mktel:$mktel, remark:$remark, r:get_rndnum(8)
            },
            dataType: "json",
            success: function($data) {
                $json = eval($data);
                $response = $json.response;
                $result = $json.result;
                if ($response == "1") {
                    layer.msg("操作成功");
                    setTimeout(function(){
                      window.parent.location.reload();
                    }, 300);
                }
                else {
                    if ($result.length > 0) {
                        layer.msg($result);
                    }
                    else {
                        layer.msg("操作失败");
                    }
                    $("#"+$obj_id).find("span").hide();
                }
            },
            error: function() {
                layer.msg("系统繁忙，请稍后再试");
                $("#"+$obj_id).find("span").hide();
            }
        }); 
    });
});
</script>
<!--{/if}-->
</body>
</html>