function btnWriteyx(n,t,i){HLYApp.checkIsLogin(0,function(){var r;HLYApp.curStaff!=null?(evt.toVipMID=t,r=$("#pdv_sfwsv").dialog({modal:!0,resizable:!1,dialogClass:"u_dialog",width:550,title:"对"+i+"记服务",closeText:"",close:function(){$(this).dialog("destroy")}}),evt.act({StoreID:$("#ddlStore").val(),HDate:$("#findyuan").val()}),$("#btnsec9").unbind("click").click(function(){var w=$("#dvsvsec1").find("input:radio[name^=rdbtn]:checked").val(),o,s,h,c,l,a,u,v,y,f,p,k;if(!w){alert("请选择第一项服务内容!");return}if(o=$("#dvsvsec2").find("input:radio[name^=rdbtn]:checked").val(),!o){alert("请选择第二项服务内容!");return}if(s=$("#dvsvsec3").find("input:radio[name^=rdbtn]:checked").val(),!s){alert("请选择第三项服务内容!");return}if(h=$("#dvsvsec4").find("input:radio[name^=rdbtn]:checked").val(),!h){alert("请选择第四项服务内容!");return}if(c=$("#dvsvsec5").find("input:radio[name^=rdbtn]:checked").val(),!c){alert("请选择第五项服务内容!");return}if(l=$("#dvsvsec6").find("input:radio[name^=rdbtn]:checked").val(),!l){alert("请选择第六项服务内容!");return}if(a=$("#dvsvsec7").find("input:radio[name^=rdbtn]:checked").val(),!a){alert("请选择第七项服务内容!");return}if(u=$("#dvsvsec8").find("input:radio[name^=rdbtn]:checked"),v=u.val(),v){if(y=u.attr("id"),f=$.trim($("#txt_sec8").val()),y=="rdbtn8a"&&(f==""||f==0)){alert("请输入约见了几位异性会员!");return}}else{alert("请选择第七项服务内容!");return}if(p=$("#dvsvsec9").find("input:radio[name^=rdbtn]:checked").val(),!p){alert("请选择第八项服务内容!");return}var e="",r=0,b=$("#pdv_sec_all").find("input:radio[name^=rdbtn]:checked");b.each(function(){var t=parseInt($(this).val()),n;r+=parseInt($(this).val());this.id=="rdbtn8a"?(n=$.trim($("#txt_sec8").val()),n!=""&&n!=0&&(e+="我帮助你在现场成功约见了"+n+"位异性会员。")):t!=0&&(e+=$.trim($(this).next("label").text()))});$("#secalltxt").html(e);k=$("#pdv_secall").dialog({modal:!0,resizable:!1,dialogClass:"u_dialog",width:550,title:i+"服务内容",closeText:"",close:function(){$(this).dialog("destroy");$("#pdv_sfwsv").dialog("destroy");$("#pdv_sec_all").find("input:radio[name^=rdbtn]").prop("checked",!1)}});$("#pdv_s_un").text(i);$("#pdv_s_fen").text(r);$("#pdv_s_sf").text(HLYApp.curUser.UserName);$("#btn_s_close").unbind("click").click(function(){$("#pdv_secall").dialog("destroy");$("#pdv_sfwsv").dialog("destroy");$("#pdv_sec_all").find("input:radio[name^=rdbtn]").prop("checked",!1)});$("#btn_s_sub").unbind("click").click(function(){if(r>0){var i={AttendID:n,ToVipMID:t,MsgTag:2,MsgTxt:$.trim($("#pdv_s_c").text()),JiFen:r};toStoreRec.actSrvSub(i,$("#pdv_sfwsv"))}else alert("总分为0无法提交!")})})):(r=$("#pdv_writeyx").dialog({modal:!0,resizable:!1,dialogClass:"u_dialog",width:470,height:260,title:"有话说",closeText:"",close:function(){$(this).dialog("destroy")}}),$("#p_wxn").text(i),$("#btnWYX").unbind("click").click(function(){var i=$("#txtYX").val(),r={AttendID:n,ToVipMID:t,MsgTag:2,MsgTxt:i};toStoreRec.actSub(r,$("#pdv_writeyx"));$("#txtYX").val("")}))})}function actReplay(n,t,i){HLYApp.checkIsLogin(0,function(){var r=$("#pdv_replay").dialog({modal:!0,resizable:!1,dialogClass:"u_dialog",width:470,height:260,title:"回复"+i,closeText:"",close:function(){$(this).dialog("destroy")}});$("#btnReplay").unbind("click").click(function(){var i=$("#txtRC").val(),r={AttendID:n,ToVipMID:t,MsgTag:4,MsgTxt:i};toStoreRec.actSub(r,$("#pdv_replay"));$("#txtRC").val("")})})}function actReplayBBS(n,t){HLYApp.checkIsLogin(0,function(){var i=$("#pdv_replayBBS").dialog({modal:!0,resizable:!1,dialogClass:"u_dialog",width:470,height:260,title:"回复"+t,closeText:"",close:function(){$(this).dialog("destroy")}});$("#btnChatReplay").unbind("click").click(function(){var t=$("#txtRChat").val();toStoreRec.chatSub(n,t,0,function(){$("#pdv_replayBBS").dialog("destroy");$("#txtRChat").val("")})})})}function notuse(){alert("此功能正在开发中!")}function btnpingjia(n,t){HLYApp.checkIsLogin(0,function(){var i=$("#pdv_pingjia").dialog({modal:!0,resizable:!1,dialogClass:"u_dialog",width:470,height:260,title:"评价",closeText:"",close:function(){$(this).dialog("destroy")}});$("#btnWPJ").unbind("click").click(function(){var i=$.trim($("#pjneirong").val());i!=""?$.ajax({url:"/Service/SayToDutyStaffAdd?t="+new Date,data:{DayDutyStaffID:n,MsgTag:0,ToVipMID:t,MsgTxt:i},type:"post",cache:!1,beforeSend:function(){},success:function(t){t.Code=="A00004"?($("#pjneirong").val(""),$("#pdv_pingjia").dialog("destroy"),$.ajax({url:"/Service/SayToDutyStaffByDutyID?t="+new Date,data:{DutyID:n,PageNo:1},type:"post",cache:!1,beforeSend:function(){},success:function(t){t.Code=="A00005"?$("#"+n+"_SayTo").html($("#SayToT").render(t.Data.Entity,{tof:function(n){return JsonDateFormat(n,"yyyy-MM-dd HH:mm:ss")}})):t.Code=="A00031"&&alert("只有到现场参加活动的会员才可以进行操作!")},dataType:"json",error:function(){alert("读取数据出错!")}})):t.Code=="A00031"&&alert("只有到现场参加活动的会员才可以进行操作!")},dataType:"json",error:function(){}}):alert("请填写评价内容!")})})}function btnblogs(n){HLYApp.checkIsLogin(0,function(){var t=$("#pdv_writeblog").dialog({modal:!0,resizable:!1,dialogClass:"u_dialog",width:470,height:260,title:"写日志",closeText:"",close:function(){$(this).dialog("destroy")}});$("#btnWLog").unbind("click").click(function(){var t=$.trim($("#xierizhi").val());t!=""?$.ajax({url:"/Service/StaffServiceAdd?t="+new Date,data:{DutyID:n,MsgTxt:t},type:"post",cache:!1,beforeSend:function(){$("#prgLoading").dialog({modal:!0,resizable:!1,dialogClass:"u_dialog",width:300,height:120,title:"写日志",closeText:"",close:function(){$(this).dialog("destroy")}});$(".ui-dialog-titlebar").hide();HLYApp.disableAtag($("#btnWLog"),null,null)},success:function(t){HLYApp.enableAtag($("#btnWLog"));$("#prgLoading").dialog("destroy");t.Code=="A00004"?($("#xierizhi").val(""),$("#pdv_writeblog").dialog("destroy"),$.ajax({url:"/Service/DutyStaffServiceByDutyID?t="+new Date,data:{DutyID:n},type:"post",cache:!1,beforeSend:function(){},success:function(t){t.Code=="A00005"&&$("#"+n+"_LogC").html($("#LogT").render(t.Data,{tof:function(n){return JsonDateFormat(n,"yyyy-MM-dd HH:mm:ss")}}))},dataType:"json",error:function(){alert("读取数据出错!")}})):t.Code=="A00024"?(alert("你不是工作人员,只有工作人员才可写日志。"),$("#pdv_writeblog").dialog("destroy"),HLYApp.showIDAffirm()):t.Code=="A00033"?(alert("只能点击自己头像下的写日志按钮!"),$("#pdv_writeblog").dialog("destroy")):t.Code=="A00001"&&HLYApp.showLogin(0)},dataType:"json",error:function(){HLYApp.enableAtag($("#btnWLog"));$("#prgLoading").dialog("destroy")}}):alert("请填写内容!")})})}function setDutyStaff(n,t){HLYApp.checkIsLogin(0,function(){var i=$("#pdv_setStaff").dialog({modal:!0,resizable:!1,dialogClass:"u_dialog",width:300,height:160,title:"设置现场服务主管",closeText:"",close:function(){$(this).dialog("destroy")}});$("#btnsetstaff").unbind("click").click(function(){var i=$("#ddlstaff").val(),r=$("#ddlstaff option:selected").text();$.ajax({url:"/Service/CameAddStaff?t="+new Date,data:{VipMID:n,AttendID:t,StaffID:i,StoreID:pID},type:"Post",cache:!1,beforeSend:function(){},success:function(u){if(u.Code=="A00004"){$("#pdv_setStaff").dialog("destroy");var f='
';f+='';f+='';f+="<\/a>";f+="<\/div>";f+='

现场服务<\/span><\/p>';f+='

'+r+"<\/span><\/a><\/p>";f+="

";f+='';f+="<\/p>";f+="

";f+='';f+="<\/p>";$("#"+t+"_staff").html(f)}else u.Code=="A00031"?alert("只有前台才可以进行指定主管操作!"):d.Code=="A00026"?alert("该会员没有刷身份证,现场主管不可分配!"):u.Code=="A00024"?(alert("只有工作人员才可以进行指定主管操作!"),HLYApp.showIDAffirm()):u.Code=="A00001"&&HLYApp.showLogin(0)},dataType:"json",error:function(){}})})})}function a(n,t){l=$(".sayp_main").offset().left;w=$(".sayp_main").width();$("#tbox").css("left",l+w+n+"px");$("#tbox").css("bottom",t+"px")}function b(){h=$(window).height();t=$(document).scrollTop();t>h?$("#gotop").fadeIn("slow"):$("#gotop").fadeOut("slow")}var toStoreRec,toStHead,evt;$(function(){$("#findyuan").datepicker({dateFormat:"yy-mm-dd",duration:"fast",showMonthAfterYear:!0,changeMonth:!0,changeYear:!0,showButtonPanel:!0,showClearButton:!0});toStoreRec.init();$("#lbStore").text($("#ddlStore").find("option:selected").text());$("#btnSee").click(function(){toStoreRec.init(!1)});$("#btnSeeYday").click(function(){toStoreRec.init(!0)})});toStoreRec={pager:{pageNo:1,pageCount:1},paging:function(){toStoreRec.pager.pageCount==0?$(".inc_pg").hide():$(".inc_pg").show();$(".inc_pg").incPager({pagenumber:toStoreRec.pager.pageNo,pagecount:toStoreRec.pager.pageCount,buttonClickCallback:function(n){toStoreRec.getData({PageNo:n,storeID:$("#ddlStore").val(),sDT:$("#findyuan").val()});HLYApp.ScrollTo($("#ShowMain"),100)}})},init:function(n){var t={PageNo:1,storeID:$("#ddlStore").val(),sDT:$("#findyuan").val(),yestoday:n};toStoreRec.getData(t);toStoreRec.dutyStaff();$("#lbStore").text($("#ddlStore").find("option:selected").text())},getData:function(n){$.ajax({url:"/club/ToStoreRecDataByParty?t="+new Date,data:n,type:"post",cache:!1,beforeSend:function(){$("#ShowMain").html("");$("#ShowMain").html('

<\/div>')},success:function(n){toStoreRec.showData(n)},dataType:"json",error:function(){}})},showData:function(n){n.Code=="A00005"?(toStoreRec.pager.pageNo=parseInt(n.Data.PageNo)+1,toStoreRec.pager.pageCount=n.Data.PageCount,$("#ShowMain").html(""),$("#ShowMain").html($("#cameT").render(n.Data.Entity,{gotime:function(n){return JsonDateFormat(n,"yyyy年MM月dd日")},vIdx:function(t){return n.Data.Amount-t},myNeed:function(n){var t="",i;if(n!=null&&n.length>0){for(t+=n.length>5?'
':'
',t+='