123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659 |
- $(function(){
-
- loginStatus();
- var userid = $.cookie("userid");
- var name = $.cookie("userName");
- var flag;
-
- var resourceNamePass = true;
-
- var supportedServicesPass=true;
-
- function resourceName()
- {
- var code = $("#resourceName").val();
- if(code.length==0||code==" ")
- {
- $(".workmsg1").text("发布资源名称不能为空");
- resourceNamePass = false;
- }
- else
- {
- $(".workmsg1").text("");
- resourceNamePass= true;
- }
- }
- $("#resourceName").blur(function(){
- resourceName();
- });
- function supportedServices()
- {
- var code = $("#supportedServices").val();
- if(code.length==0||code==" ")
- {
- $(".workmsg3").text("可提供服务不能为空");
- supportedServicesPass= false;
- }
- else
- {
- $(".workmsg3").text("");
- supportedServicesPass= true;
- }
- }
- $("#supportedServices").blur(function(){
- supportedServices();
- });
- function industryShow(data,industryList,deleteIndustry)
- {
- if(data != undefined && data.length != 0 )
- {
- var subs = new Array();
- if(data.indexOf(','))
- {
- subs = data.split(',');
- }
- else
- {
- subs[0] = data;
- }
- if(subs.length>0)
- {
- for (var i = 0; i < subs.length; i++)
- {
- $("#"+industryList+"").append("<div class='"+deleteIndustry+"'>"+ subs[i] +"<span class='removeNu'><img src='images/move.png'></span></div>");
- };
- }
- }
- }
-
- function addDele(){
- $("#industryList").on("click",".removeNu",function(){
- $(this).parent().remove();
- });
- $("#industryAdd").click(function(){
- var val=$("#industry").val();
- $("#industryList").append("<div class='deleteIndustry'>"+ val +"<span class='removeNu'><img src='images/move.png'></span></div>")
- });
- $("#SubjectList").on("click",".removeNu",function(){
- $(this).parent().remove();
- });
- $("#subjectAdd").click(function(){
- var val=$("#subject").val();
- $("#SubjectList").append("<div class='deleteSubject'>"+ val +"<span class='removeNu'><img src='images/move.png'></span></div>")
- });
- }
- $("#workmysrc").on("click",".resoumag",function()
- {
- ResourceInfo();
- addDele()
- $(".limitBox").removeClass("limitBox");
- $(".limitwords").removeClass("limitwords");
- $(".limitwordbox").removeClass("limitwordbox");
-
- $(".respublisher").css("display","none");
- $(".stateinfor span").text("资源发布中");
- var resourceID=$(this).attr("resourceId");
- function delet(){
- $.ajax({
- "url" : "/ajax/resource/"+resourceID,
- "type" : "DELETE",
- "success" : function($data) {
- if ($data.success) {
- $(".blackcover").remove();
- $("body").css("position","");
- getDataResource();
- } else {
- $.MsgBox.Alert('message',$data.msg);
- }
- }
- })
- }
- if(resourceID){
- $("#deletedResource").on("click",function(){
- $(".blackcover").remove();
- $("body").css("position","");
- $.MsgBox.Confirm("消息", "执行删除后资源信息将无法恢复,确定继续吗?",delet)
- })
- $.ajax({
- "url":"/ajax/resource/"+resourceID,
- "type":"get",
- "async": true,
- "success":function(info){
- if(info.success)
- {
-
- $("#resourceName").val(info.data.resourceName);
- $("#supportedServices").val(info.data.supportedServices);
- $("#hopePayMethod").val(info.data.hopePayMethod) ;
- $("#cooperationNotes").val(info.data.cooperationNotes) ;
- industryShow(info.data.subject,"SubjectList","deleteSubject");
- industryShow(info.data.industry,"industryList","deleteIndustry");
- $("#descp").val(info.data.descp);
- $("#professor").text(name);
- if(info.data.images.length) {
- var $liMages = $(
- '<div id="WU_FILE" class="file-item thumbnail">'+
- '<img src="/images/resource/'+resourceID+'.jpg">'+
- '</div>'
- )
- }
- else
- {
- var $liMages = $(
- '<div id="WU_FILE" class="file-item thumbnail">'+
- '<img src="/images/default-resource.jpg">'+
- '</div>'
- )
- }
-
- $("#fileList").append($liMages);
-
- }
- else
- {
- $.MsgBox.Alert('message',"系统异常!");
- }
- },
- "error":function(){$.MsgBox.Alert('message','failed')}
- });
- }
-
- function captiureSubInd(subIndu)
- {
- var industrys = $("#"+subIndu+"");
- var industryAll = "";
- if(industrys.size()>0){
- for (var i = 0; i <industrys.size(); i++) {
- industryAll += industrys[i].innerText;
- industryAll += ',';
- };
- industryAll = industryAll.substring(0, industryAll.length-1);
- }
- return industryAll;
- }
- $("#inputb").on("click",function()
- {
- var $data = {};
- $data.resourceName = $("#resourceName").val();
- $data.supportedServices = $("#supportedServices").val();
- $data.professorId = userid;
- $data.hopePayMethod = $("#hopePayMethod").val();
- $data.cooperationNotes = $("#cooperationNotes").val();
- $data.subject=captiureSubInd("SubjectList .deleteSubject");
- $data.industry=captiureSubInd("industryList .deleteIndustry");
- $data.descp=$("#descp").val();
- if(cacheImageKey){
-
- $data.fn=cacheImageKey;
- }
- if (resourceID) {
-
- $data.resourceId = resourceID;
-
- }
- function getDataput(){
- $.ajax({"url" : "ajax/resource/updateResource",
- "type" : "post" ,
- "success" : function(rdata) {
- if (rdata.success){
- getDataResource();
- } else {
- $.MsgBox.Alert("消息","资源发布失败");
- }
- },
- "data" :$data,
- "beforeSend":function(){ },
- "contentType" : "application/x-www-form-urlencoded",
- dataType : "json"
- });
- }
-
- resourceName();
- supportedServices();
- if(resourceNamePass && supportedServicesPass)
- {
- if(resourceID){
- $(".blackcover").remove();
- $("body").css("position","");
- $.MsgBox.Confirm("消息", "确定修改资源信息吗?", getDataput)
- $data.fn=cacheImageKey;
- }else{
-
- $.ajax({"url" : "/ajax/resource",
- "type" : "POST",
- "success" : function(rdata) {
- if (rdata.success)
- {
- $(".blackcover").remove();
- $("body").css("position","");
- getDataResource();
- $.MsgBox.Alert("消息","资源发布成功");
- $("#mb_msgicon").css("background", 'url("images/sign_icon_chenggong_nor.png") 0% 0% / contain');
- }
- else
- {
- $.MsgBox.Alert("消息","资源发布失败");
- }
- },
- "data" : $data,
- "beforeSend":function(){ },
- "contentType" : "application/x-www-form-urlencoded",
- dataType : "json"
- });
- }
-
- }
- });
- });
- getDataResource();
- function getDataResource(){
- $.ajax({
- "url":"/ajax/resource/qapro",
- "type":"get",
- "async": true,
- "data":{"professorId":userid},
- "success":function(data){
- if(data.success)
- {
- var add='';
- var k=0;
- $("#consd").html("");
- for(var i=0;i<data.data.length;i++)
- {
- var add='<div class="maintab"><div class="lefttab fl"><table class="resoubrief"><tr><td><div class="resoimgbox"><div class="ResImgBox" style="max-width:160px;width:160px;height: 160px;"><img class="resImg headRadius resourceImg" src="" /></div></div></td>'
- add+='</tr><tr><td><ul><li>'+data.data[i].resourceName+'</li><li>'+data.data[i].supportedServices+'</li> '
-
- add+='</ul></td></tr><tr>'
- add+='<td><span class="managebtn resoumag"">资源管理</span></td></tr></table></div>'
- add+='<div class="righttab fr"><table width="100%" class="worktab tablecon">'
- add+='<tr class="worktabtit"><th width="20%" height="40">申请时间</th><th width="20%">需求方</th>'
- add+='<th width="12%">联系人</th><th width="14%">交付时间</th>'
- add+='<th width="20%">付款进程</th><th width="12%">状态/操作</th></tr></table><div class="tcdPageCode tcdPageCod'+i+'"></div></div>';
- $add = $(add);
-
- $("#consd").append($add);
- if(data.data[i].subject==undefined){
- $(".li1").eq(i).css({"display":"none"});
- }
-
- $add.find('.resoumag').attr("resourceId",data.data[i].resourceId);
-
-
-
- if(data.data[i].images.length){
- $add.find(".resourceImg").attr("src","/images/resource/"+data.data[i].resourceId+".jpg");
- }
- else
- {
- $add.find(".resourceImg").attr("src","/images/default-resource.jpg");
- }
-
-
-
-
-
-
-
-
- (function(i){
- getPageResource(3,1,true,i,k)
- k++;
- })(i);
-
- add="";
- }
-
- }
- else
- {
- $.MsgBox.Alert('message',"系统异常!");
- }
- },
- "error":function(){$.MsgBox.Alert('message','failed')}
- });
- }
- function getPageResource(pageSize,pageNo,isbind,e,f)
- {
-
- $.ajax({
- "url":"/ajax/operation/pqres",
- "type":"get",
- "async": false,
- "data":{"resourceId":$('.resoumag').eq(e+1).attr("resourceId"),"pageSize":pageSize,"pageNo":pageNo},
- "success":function(data){
- if(data.success)
- {
- $(".maintab").eq(f).find(".workitem").remove();
-
- for(var j=0;j<data.data.data.length;j++)
- {
- if(data.data.data[j].dealPrice==undefined)
- {
- data.data.data[j].dealPrice=0;
- }
-
- if(data.data.data[j].payMethod==undefined){
- data.data.data[j].payMethod="";
- }
-
- data.data.data[j].deliverTime=changeTime(data.data.data[j].deliverTime);
- data.data.data[j].createTime=changeTime(data.data.data[j].createTime);
-
- var inquiry=inquiryGetPaidMoney(data.data.data[j].operationId);
- var addString='<tr class="workitem">'
- addString+='<td>'+data.data.data[j].createTime+'</td>'
- addString+='<td class="workitemsrc">'+data.data.data[j].applysquare+'</td>'
- addString+='<td> <span class="worktel">'+data.data.data[j].professor.name+'<!--<span class="worktelbtn"></span>--></span></td>'
- addString+='<td>'+data.data.data[j].deliverTime+'</td>'
-
-
- addString+='<td><span>'+inquiry+'</span>/<span>'+data.data.data[j].dealPrice+'</span><br></td>'
- addString+='<td><div class="modification'+e+'"></div></td> </tr>'
- $(".tablecon").eq(e).append(addString);
-
- if($(".price1"+e+"").eq(j).text()==0){
- $(".price1"+e+"").eq(j).text("");
- }
- switch(data.data.data[j].operationStatus)
- {
- case 1:
- var string='<span>新的申请</span><br/>'
- string+='<a class="operatebtn">'
- string+='<span class="detailmess"resourId='+data.data.data[j].resource.resourceId+' operationStatus='+data.data.data[j].operationStatus+' operationId='+data.data.data[j].operationId+'>回复申请</span><br />'
- string+='</a>'
- $(".modification"+e+"").eq(j).html(string);
- break;
- case 2:
- var string='<span>已发送报价待对方确认</span><br/>'
- string+='<a class="operatebtn">'
- string+='<span class="detailmess"resourId='+data.data.data[j].resource.resourceId+' operationStatus="2" operationId='+data.data.data[j].operationId+'>修改报价</span><br />'
- string+='</a>'
- $(".modification"+e+"").eq(j).html(string);
- break;
- case 3:
- var string='<span>对方发来报价合作进行中</span><br/>'
- string+='<a class="operatebtn">'
- string+='<span class="detailmess"resourId='+data.data.data[j].resource.resourceId+' operationStatus='+data.data.data[j].operationStatus+' operationId='+data.data.data[j].operationId+' dealPrice='+data.data.data[j].dealPrice+'>查看详情</span><br />'
- string+='<span class="drawback"resourId='+data.data.data[j].resource.resourceId+' operationStatus='+data.data.data[j].operationStatus+' operationId='+data.data.data[j].operationId+' dealPrice='+data.data.data[j].dealPrice+'>退款</span><br />'
- string+='<span resourId='+data.data.data[j].resource.resourceId+' operationStatus='+data.data.data[j].operationStatus+' operationId='+data.data.data[j].operationId+'>投诉</span>'
- string+='</a>'
- $(".modification"+e+"").eq(j).html(string);
- break;
- case 4:
- var string='<span>对方拒绝报价合作结束</span><br/>'
- string+='<a class="operatebtn">'
- string+='<span class="detailmess"resourId='+data.data.data[j].resource.resourceId+' operationStatus='+data.data.data[j].operationStatus+' operationId='+data.data.data[j].operationId+'>查看详情</span><br />'
- string+='</a>'
- $(".modification"+e+"").eq(j).html(string);
- break;
- case 5:
- var string='<span>本人拒绝合作</span><br/>'
- string+='<a class="operatebtn">'
- string+='<span class="detailmess"resourId='+data.data.data[j].resource.resourceId+' operationStatus='+data.data.data[j].operationStatus+' operationId='+data.data.data[j].operationId+'>查看详情</span><br />'
- string+='</a>'
- $(".modification"+e+"").eq(j).html(string);
- break;
- case 6:
- var string='<span>对方中止合作合作结束</span><br/>'
- string+='<a class="operatebtn">'
- string+='<span class="detailmess"resourId='+data.data.data[j].resource.resourceId+' operationStatus='+data.data.data[j].operationStatus+' operationId='+data.data.data[j].operationId+' dealPrice='+data.data.data[j].dealPrice+'>查看详情</span><br />'
-
- string+='<span class="drawback"resourId='+data.data.data[j].resource.resourceId+' operationStatus='+data.data.data[j].operationStatus+' operationId='+data.data.data[j].operationId+' dealPrice='+data.data.data[j].dealPrice+'>退款</span><br />'
- string+='<span class="complain"resourId='+data.data.data[j].resource.resourceId+' operationStatus='+data.data.data[j].operationStatus+' operationId='+data.data.data[j].operationId+'>投诉</span>'
- string+='</a>'
- $(".modification"+e+"").eq(j).html(string);
- break;
- case 7:
- var string='<span>合作进行中</span><br/>'
- string+='<a class="operatebtn">'
- string+='<span class="detailmess"resourId='+data.data.data[j].resource.resourceId+' operationStatus='+data.data.data[j].operationStatus+' operationId='+data.data.data[j].operationId+' dealPrice='+data.data.data[j].dealPrice+'>查看详情</span><br />'
-
- string+='<span class="complain"resourId='+data.data.data[j].resource.resourceId+' operationStatus='+data.data.data[j].operationStatus+' operationId='+data.data.data[j].operationId+'>投诉</span>'
- string+='</a>'
- $(".modification"+e+"").eq(j).html(string);
- break;
- case 8:
- var string='<span>完成</span><br/>'
- string+='<a class="operatebtn">'
- string+='<span class="detailmess"resourId='+data.data.data[j].resource.resourceId+' operationStatus='+data.data.data[j].operationStatus+' operationId='+data.data.data[j].operationId+' dealPrice='+data.data.data[j].dealPrice+'>查看详情</span><br />'
-
- string+='<span class="complain"resourId='+data.data.data[j].resource.resourceId+' operationStatus='+data.data.data[j].operationStatus+' operationId='+data.data.data[j].operationId+'>投诉</span>'
- string+='</a>'
- $(".modification"+e+"").eq(j).html(string);
- break;
- default:
- }
- addString="";
- }
-
- if(data.data.total == 0){
-
- }else{
- if(isbind == true)
- {
- $(".tcdPageCod"+e+"").createPage({
- pageCount:Math.ceil(data.data.total/pageSize),
- current:data.data.pageNo,
- backFn:function(p){
- getPageResource(3,p,false,e,f);
- }
- });
- }
- }
- }
- else
- {
- $.MsgBox.Alert("消息","系统异常!");
- }
- },
- "error":function(){$.MsgBox.Alert('message','failed')}
- });
- }
- $("#consd").on("click",".detailmess",function(){
- $(".stateinfor span").text("回复申请");
- var operationId=$(this).attr("operationId");
- var operationStatus=$(this).attr("operationStatus");
- var priceDifference=$(this).attr("dealPrice");
- opo=operationId;
- flag=0;
-
- if(flag==0&&operationStatus==1)
- { ResourceApply();
-
- $(".limitBox").eq(1).removeClass("limitBox");
- $(".limitwords").eq(1).removeClass("limitwords");
- $(".limitwordbox").eq(1).removeClass("limitwordbox");
-
- ajaxGet(operationId);
- $(".dealTime").replaceWith("<span class='dealTime'></span>");
- $(".detail").replaceWith("<span class='detail'></span>");
- $("select").replaceWith("<span class='sname'></span>")
- $(".btnboxdown").css({"display":"none"});
- $(".applysure").css({"display":"none"});
- $("#nextStep").click(function(){
- $(".stateinfor span").text("报价中");
- $(".btnboxup").css({"display":"none"});
- $(".btnboxdown").css({"display":"block"});
- $(".applysure").css({"display":"block"});
- $(".bag").css("display","none");
- $("#reject").hide();
-
- $(".frm").click(function(){
- var $date = {};
- $date.detailDemand=$(".detail").text();
- $date.deliverTime=replaceStr($.trim($(".dealTime").text()));
- $date.dealPrice =$.trim($("#dealPrice").val());
- $date.payMethod = $.trim($("#payMethod").val());
- $date.replyNotes = $("#consultContent").val();
- $date.applysquare = $(".sname").text();
- $date.operationId=operationId;
- $date.operationStatus=2;
- $.ajax({
- "url" : "/ajax/operation",
- "type" : "put",
- "data" :JSON.stringify($date),
- "contentType" :"application/json",
- "success" : function(data) {
- if (data.success) {
- $(".blackcover").remove();
- $("body").css("position","");
- getDataResource();
- $.MsgBox.Alert('message',"报价成功");
- $("#mb_msgicon").css("background", 'url("images/sign_icon_chenggong_nor.png") 0% 0% / contain');
- } else {
- $.MsgBox.Alert('message',data.msg);
- }
- },
- "beforeSend":function(){
-
- },
- });
- })
-
- })
- $("#refuses").click(function(){
- ResourceApply();
- ajaxGet(operationId);
- n=5;
- $(".blackcover").remove();
- $("body").css("position","");
- $.MsgBox.Confirm("消息", "确定拒绝吗?",upStatus1);
- });
- }
- if(flag==0&&operationStatus==2){
- ResourceApply();
-
- $(".limitBox").eq(1).removeClass("limitBox");
- $(".limitwords").eq(1).removeClass("limitwords");
- $(".limitwordbox").eq(1).removeClass("limitwordbox");
-
- ajaxGet(operationId);
-
- $(".dealTime").replaceWith("<span class='dealTime'></span>");
- $(".detail").replaceWith("<span class='detail'></span>");
- $("select").replaceWith("<span class='sname'></span>")
- $(".btnboxdown").css({"display":"none"});
- $(".applysure").css({"display":"none"});
- $(".stateinfor span").text("修改报价中");
- $(".btnboxup").css({"display":"none"});
- $(".btnboxdown").css({"display":"block"});
- $(".applysure").css({"display":"block"});
- $(".bag").css("display","none");
- $(".frm").click(function(){
- var $date = {};
- $date.detailDemand=$(".detail").text();
- $date.deliverTime=replaceStr($.trim($(".dealTime").text()));
- $date.dealPrice = $("#dealPrice").val();
- $date.payMethod = $("#payMethod").val();
- $date.replyNotes = $("#consultContent").val();
- $date.applysquare = $(".sname").text();
- $date.operationId=operationId;
- $date.operationStatus=2;
- $.ajax({
- "url" : "/ajax/operation",
- "type" : "put",
- "data" :JSON.stringify($date),
- "contentType" :"application/json",
- "success" : function(data) {
- if (data.success) {
- $(".blackcover").remove();
- $("body").css("position","");
- getDataResource();
- $.MsgBox.Alert('message',"报价成功");
- $("#mb_msgicon").css("background", 'url("images/sign_icon_chenggong_nor.png") 0% 0% / contain');
- } else {
- $.MsgBox.Alert('message',data.msg);
- }
- },
- "beforeSend":function(){
-
- },
- });
- })
- }
- if(flag==0&&operationStatus==3){
-
- DetailInfo();
-
- $("#totalPrice").text(priceDifference);
- $(".liuyaninfo").css("display","none");
- $(".pingjiainfo").css("display","none");
- $(".filebox").css("display","none");
- ajaxGet1(operationId);
- $(".payaddbox1").css("display","none");
- discussGetPaidMoney(operationId,priceDifference)
- }
- if(flag==0&&operationStatus==5){
- ResourceApply();
- ajaxGet(operationId);
- $(".dealTime").replaceWith("<span class='dealTime'></span>");
- $(".detail").replaceWith("<span class='detail'></span>");
- $("select").replaceWith("<span class='sname'></span>")
- $(".btnboxdown").css({"display":"none"});
- $(".applysure").css({"display":"none"});
- $(".addrebtn").css("display","none");
- }
- if(flag==0&&operationStatus==4){
- ResourceApply();
- ajaxGet1(operationId);
- $(".dealTime").replaceWith("<span class='dealTime'></span>");
- $(".detail").replaceWith("<span class='detail'></span>");
- $("select").replaceWith("<span class='sname'></span>")
- $(".btnboxdown").css({"display":"none"});
- $(".applysure").css({"display":"none"});
- $(".stateinfor span").text("详情");
- $(".btnboxup").css({"display":"none"});
- $(".btnboxdown").css({"display":"block"});
- $(".applysure").css({"display":"block"});
- $(".bag").css("display","none");
- $(".addrebtn").css("display","none");
- $("#payMethod").replaceWith("<span id='payMethod'><span>");
- $("#dealPrice").replaceWith("<span id='dealPrice'><span>");
- $("#consultContent").replaceWith("<span id='consultContent'><span>");
- }
- if(flag==0&&operationStatus==6){
-
- DetailInfo();
- $("#totalPrice").text(priceDifference);
- $(".liuyaninfo").css("display","none");
- $(".pingjiainfo").css("display","none");
- $(".filebox").css("display","none");
- ajaxGet1(operationId);
- $(".payaddbox1").css("display","none");
- discussGetPaidMoney(operationId,priceDifference)
- }
- if(flag==0&&operationStatus==7){
-
- DetailInfo();
- $("#totalPrice").text(priceDifference);
- $(".liuyaninfo").css("display","none");
- $(".pingjiainfo").css("display","none");
- $(".filebox").css("display","none");
- ajaxGet1(operationId);
- $(".payaddbox1").css("display","none");
-
- limitHeight();
- discussGetPaidMoney(operationId,priceDifference)
- }
- if(flag==0&&operationStatus==8){
-
- DetailInfo();
- $("#totalPrice").text(priceDifference);
- $(".liuyaninfo").css("display","none");
- $(".pingjiainfo").css("display","none");
- $(".filebox").css("display","none");
- ajaxGet1(operationId);
- $(".payaddbox1").css("display","none");
-
- limitHeight();
- discussGetPaidMoney(operationId,priceDifference)
- }
- })
- function getPageData(pageSize,pageNo,isbind){
- $.ajax({
- "url":"/ajax/operation/pqdem",
- "type":"get",
- "async": true,
- "data":{"demandId":userid,"pageSize":pageSize,"pageNo":pageNo},
- "success":function(data){
- if(data.success)
- {
- $(".worktabb").html("");
- var stringTitle="";
- stringTitle +='<tr class="worktabtit"><th width="20%" height="40">申请时间</th><th width="22%">需求资源</th><th width="12%">发布者</th><th width="14%">交付时间</th><th width="22%">付款进程</th><th width="10%">状态/操作</th></tr>';
- $(".worktabb").append( stringTitle);
-
-
-
- for(var i=0;i<data.data.data.length;i++)
- {
-
- var inq=inquiryGetPaidMoney(data.data.data[i].operationId);
- if(data.data.data[i].dealPrice==undefined){
- data.data.data[i].dealPrice=0;
- }
- if(data.data.data[i].payMethod==undefined){
- data.data.data[i].payMethod="";
- }
-
- data.data.data[i].deliverTime=changeTime(data.data.data[i].deliverTime);
- data.data.data[i].createTime=changeTime(data.data.data[i].createTime);
- var stringContent="";
- stringContent +='<tr class="workitem">'
- stringContent +='<td>'+data.data.data[i].createTime+'</td>'
- stringContent +='<td class="workitemsrc">'+data.data.data[i].resource.resourceName+'</td>'
- stringContent +='<td> <span class="worktel">'+data.data.data[i].resource.professor.name+'<!--<span class="worktelbtn"></span>--></span></td>'
- stringContent +='<td>'+data.data.data[i].deliverTime+'</td>'
-
-
- stringContent +='<td><span>'+inq+'</span>/<span>'+data.data.data[i].dealPrice+'</span><br></td>'
- stringContent +='<td><div class="loginStatus"></div></td></tr>'
- $(".worktabb").append( stringContent);
- if($(".price2").eq(i).text()==0){
- $(".price2").eq(i).text("");
- }
- switch(data.data.data[i].operationStatus)
- {
- case 1:
- var string='<span>申请已发送待对方确认</span><br/>'
- string+='<a class="opbtn">'
- string+='<span class="detailm"resourId='+data.data.data[i].resource.resourceId+' operationStatus='+data.data.data[i].operationStatus+' operationId='+data.data.data[i].operationId+'>修改申请</span><br />'
- string+='</a>'
- $(".loginStatus").eq(i).html(string);
- break;
- case 2:
- var string='<span>对方发来报价</span><br/>'
- string+='<a class="opbtn">'
- string+='<span class="detailm"resourId='+data.data.data[i].resource.resourceId+' operationStatus='+data.data.data[i].operationStatus+' operationId='+data.data.data[i].operationId+'>回复报价</span><br />'
- string+='</a>'
- $(".loginStatus").eq(i).html(string);
- break;
- case 3:
- var string='<span>合作进行中</span><br/>'
- string+='<a class="opbtn">'
- string+='<span class="detailm"resourId='+data.data.data[i].resource.resourceId+' operationStatus='+data.data.data[i].operationStatus+' operationId='+data.data.data[i].operationId+' dealPrice='+data.data.data[i].dealPrice+'>查看详情</span><br />'
- string+='<span class="payMonety"resourId='+data.data.data[i].resource.resourceId+' operationStatus='+data.data.data[i].operationStatus+' operationId='+data.data.data[i].operationId+' dealPrice='+data.data.data[i].dealPrice+'>付款</span><br />'
- string+='<span class="stopcoo"resourId='+data.data.data[i].resource.resourceId+' operationStatus='+data.data.data[i].operationStatus+' operationId='+data.data.data[i].operationId+'>中止合作</span>'
- string+='</a>'
- $(".loginStatus").eq(i).html(string);
- break;
- case 4:
- var string='<span>本人拒绝合作</span><br/>'
- string+='<a class="opbtn">'
- string+='<span class="detailm"resourId='+data.data.data[i].resource.resourceId+' operationStatus='+data.data.data[i].operationStatus+' operationId='+data.data.data[i].operationId+'>查看详情</span><br />'
- string+='</a>'
- $(".loginStatus").eq(i).html(string);
- break;
- case 5:
- var string='<span>对方拒绝合作合作结束</span><br/>'
- string+='<a class="opbtn">'
- string+='<span class="detailm"resourId='+data.data.data[i].resource.resourceId+' operationStatus='+data.data.data[i].operationStatus+' operationId='+data.data.data[i].operationId+'>查看详情</span><br />'
- string+='</a>'
- $(".loginStatus").eq(i).html(string);
- break;
- case 6:
- var string='<span>本人中止合作</span><br/>'
- string+='<a class="opbtn">'
- string+='<span class="detailm"resourId='+data.data.data[i].resource.resourceId+' operationStatus='+data.data.data[i].operationStatus+' operationId='+data.data.data[i].operationId+' dealPrice='+data.data.data[i].dealPrice+'>查看详情</span><br />'
-
- string+='<span class="complain"resourId='+data.data.data[i].resource.resourceId+' operationStatus='+data.data.data[i].operationStatus+' operationId='+data.data.data[i].operationId+'>投诉</span>'
- string+='</a>'
- $(".loginStatus").eq(i).html(string);
- break;
- case 7:
- var string='<span>合作进行中</span><br/>'
- string+='<a class="opbtn">'
- string+='<span class="detailm"resourId='+data.data.data[i].resource.resourceId+' operationStatus='+data.data.data[i].operationStatus+' operationId='+data.data.data[i].operationId+' dealPrice='+data.data.data[i].dealPrice+'>查看详情</span><br />'
- string+='<span class="acknowledgement"resourceId='+data.data.data[i].resource.resourceId+' operationStatus='+data.data.data[i].operationStatus+' operationId='+data.data.data[i].operationId+'>确认完成</span><br />'
- string+='<span class="complain"resourId='+data.data.data[i].resource.resourceId+' operationStatus='+data.data.data[i].operationStatus+' operationId='+data.data.data[i].operationId+'>投诉</span>'
- string+='</a>'
- $(".loginStatus").eq(i).html(string);
- break;
- case 8:
- var string='<span>完成</span><br/>'
- string+='<a class="opbtn">'
- string+='<span class="detailm"resourId='+data.data.data[i].resource.resourceId+' operationStatus='+data.data.data[i].operationStatus+' operationId='+data.data.data[i].operationId+' dealPrice='+data.data.data[i].dealPrice+'>查看详情</span><br />'
-
- string+='<span class="complain"resourId='+data.data.data[i].resource.resourceId+' operationStatus='+data.data.data[i].operationStatus+' operationId='+data.data.data[i].operationId+'>投诉</span>'
- string+='</a>'
- $(".loginStatus").eq(i).html(string);
- break;
- default:
- }
- }
- if(data.data.total == 0){
-
- }else{
- if(isbind == true)
- {
- $(".tcdPageCode1").createPage({
- pageCount:Math.ceil(data.data.total/pageSize),
- current:data.data.pageNo,
- backFn:function(p){
- getPageData(pageSize,p,false);
- },
- });
- }
- }
-
- }
- else
- {
- $.MsgBox.Alert('message',"系统异常!");
- }
- },
- "error":function(){$.MsgBox.Alert('message','failddd')}
- });
- }
- getPageData(6,1,true);
- $("#workmysrc2").on("click",".acknowledgement",function(){
- opo=$(this).attr("operationId");
- n=8;
- $.MsgBox.Confirm("消息", "确认合作完成?",upStatus);
- })
- $(".workmysrc").on("click",".drawback",function(){
- DetailInfo();
- $(".resoubox").css("display","none");
- $(".liuyaninfo").css("display","none");
- $(".pingjiainfo").css("display","none");
- var op=$(this).attr("operationId");
- opo=op;
- var $price=$(this).attr("dealPrice");
- $("#totalPrice").text($price);
- discussGetPaidMoney(opo,$price);
-
- $("#paytit").on("click",".ret",function(){
- var payStatus=$(this).attr("payStatus");
-
- if(payStatus==0){
- payHistoryId=$(this).attr("payhistoryid");
- getPayhistoryData();
- }
- });
- function getPayhistoryData(){
- $.ajax({
- "url":"/ajax/payhistory/status",
- "type":"post",
- "async": true,
- "data":{"payHistoryId":payHistoryId,"payStatus":"1"},
- "success":function(data)
- {
- if(data.success)
- {
- $("#paytit").find(".payitem").remove();
- discussGetPaidMoney(opo,$price);
- }
- else
- {
- $.MsgBox.Alert('message',"系统异常!");
- }
- },
- "error":function(){$.MsgBox.Alert('message','failddd')}
- });
- }
- $(".panbtn").click(function(){
- var payed= Number($("#realCharge").text());
- var paying= Number($("#payMoney").val());
-
-
- if(paying <= payed)
- {
- $.MsgBox.Confirm("消息", "确定退款吗?",getPay1)
- }
- if(paying > payed){
- $.MsgBox.Alert('消息',"您所退的款项有误,请核对您已经收到的款项");
- }
- });
-
- });
- function getPay(){
- $.ajax({"url" : "/ajax/payhistory",
- "type" : "POST",
- "success" : function(rdata)
- {
- if (rdata.success)
- {
-
- $(".blackcover").remove();
- $("body").css("position","");
- getPageData(6,1,false);
- }
- else
- {
- $.MsgBox.Alert('消息',"付款失败!");
- }
- },
- "data" :{"operationId":opo,"paidMoney":$("#payMoney").val(),
- "remark":$("#payRemark").val(),"payStatus":$("#payStatus").val(),"professorId":userid,
- "isonline":$("#isOnline").find("option:selected").val()},
- "contentType" :"application/x-www-form-urlencoded",
- "beforeSend":function(){},
- dataType : "json"
- });
- }
- function getPay1(){
- $.ajax({"url" : "/ajax/payhistory",
- "type" : "POST",
- "success" : function(rdata)
- {
- if (rdata.success)
- {
- $(".blackcover").remove();
- $("body").css("position","");
- getDataResource();
- }
- else
- {
- $.MsgBox.Alert('消息',"付款失败!");
- }
- },
- "data" :{"operationId":opo,"returnMoney":$("#payMoney").val(),
- "remark":$("#payRemark").val(),"payStatus":$("#payStatus").val(),"professorId":userid,
- "isonline":$("#isOnline").find("option:selected").val()},
- "contentType" :"application/x-www-form-urlencoded",
- "beforeSend":function(){},
- dataType : "json"
- });
- }
- $(".workmysrc").on("click",".payMonety",function(){
- DetailInfo();
- $(".resoubox").css("display","none");
- $(".liuyaninfo").css("display","none");
- $(".pingjiainfo").css("display","none");
- opo=$(this).attr("operationId");
- var $price=$(this).attr("dealPrice");
- $("#totalPrice").text($price);
- discussGetPaidMoney(opo,$price);
- $("#paytit").on("click",".ret",function(){
- var payStatus=$(this).attr("payStatus");
-
- if(payStatus==0){
- payHistoryId=$(this).attr("payhistoryid");
- getPayhistoryData();
- }
- });
- function getPayhistoryData(){
- $.ajax({
- "url":"/ajax/payhistory/status",
- "type":"post",
- "async": true,
- "data":{"payHistoryId":payHistoryId,"payStatus":"1"},
- "success":function(data)
- {
- if(data.success)
- {
- $("#paytit").find(".payitem").remove();
- discussGetPaidMoney(opo,$price);
- }
- else
- {
- $.MsgBox.Alert('message',"系统异常!");
- }
- },
- "error":function(){$.MsgBox.Alert('message','failddd')}
- });
- }
- $("#panaddbtn").click(function(){
- var aa= Number($("#payMoney").val());
- var bb=Number($("#balance").text());
- if(aa<bb){
-
- $.MsgBox.Confirm("消息", "确定支付吗?",getPay);
- $.MsgBox.Alert('消息',"此次付款成功!");
- $("#mb_msgicon").css("background", 'url("images/sign_icon_chenggong_nor.png") 0% 0% / contain');
-
- }
- if(aa>bb){
- $.MsgBox.Alert('消息',"所付款项已经超出预计款项!");
- }
- if(aa==bb){
-
- $.MsgBox.Confirm("消息", "确定支付吗?",getPay);
- n=7;
- upStatus();
- $.MsgBox.Alert('消息',"款项已经全部付清!");
- }
- });
-
-
- });
- function inquiryGetPaidMoney(operationId){
- var realCharge=0,balance=0;
- $.ajax({
- "url":"/ajax/payhistory/qadetail",
- "type":"get",
- "async": false,
- "data":{"operationId":operationId},
- "success":function(data){
- if(data.success)
- {
- var $data=data.data;
- var m;
- for(var i=0;i<$data.length;i++)
- {
- if($data[i].paidMoney==undefined)
- {
- $data[i].paidMoney=0;
- }
- if($data[i].returnMoney==undefined)
- {
- $data[i].returnMoney=0;
- }
- m=$data[i].paidMoney-$data[i].returnMoney;
- realCharge+=m;
- }
-
- }
- else
- {
-
- }
- },
- "error":function(){$.MsgBox.Alert('message','failddd')}
- });
- return realCharge;
- }
- function discussGetPaidMoney(operationId,priceDifference){
- var realCharge=0,balance=0;
- $.ajax({
- "url":"/ajax/payhistory/qadetail",
- "type":"get",
- "async": true,
- "data":{"operationId":operationId},
- "success":function(data){
- if(data.success){
-
- var popHtml="";
- var $data=data.data;
- var m;
- for(var i=0;i<$data.length;i++){
- if($data[i].paidMoney==undefined)
- {
- $data[i].paidMoney=0;
- }
- if($data[i].returnMoney==undefined)
- {
- $data[i].returnMoney=0;
- }
- if($data[i].remark==undefined)
- {
- $data[i].remark="--";
- }
-
- PopHtml = '<tr class="payitem">';
- PopHtml += '<td><div class="resouinforcon">'+changeTime($data[i].createTime)+'</div></td>';
- PopHtml += '<td><div class="resouinforcon">'+$data[i].professor.name+'</div></td>';
- PopHtml += '<td><div class="resouinforcon resou"></div></td>';
- PopHtml += '<td><div class="resouinforcon to"></div></td>';
- if(userid==$data[i].professor.id){
- PopHtml += '<td><div class="resouinforcon resta"></div></td>';
- }else{
- PopHtml += '<td><div class="resouinforcon resta ret"payHistoryId='+$data[i].payHistoryId+' payStatus='+$data[i].payStatus+'></div></td>';
- }
- PopHtml += '<td><div class="resouinforcon">'+$data[i].remark+'</div></td>';
- PopHtml += '</tr>';
- $("#paytit").append(PopHtml);
-
-
- m=$data[i].paidMoney-$data[i].returnMoney;
- $(".to").eq(i).text(m);
-
- if($data[i].isonline==0){
- $(".resou").eq(i).text("线上支付");
- }else{
- $(".resou").eq(i).text("线下支付");
- }
- if($data[i].payStatus==0){
- $(".resta").eq(i).text("未确认");
- }else{
- $(".resta").eq(i).text("确认收款");
- }
- popHtml="";
- realCharge+=m;
- }
- balance=priceDifference-realCharge;
- $("#balance").text(balance);
- $("#realCharge").text(realCharge);
- }
- else
- {
-
- }
- },
- "error":function(){$.MsgBox.Alert('message','failddd')}
- });
- }
- $(".workmysrc").on("click",".stopcoo",function(){
- opo=$(this).attr("operationId");
- n=6;
- $.MsgBox.Confirm("消息", "你确定要中止吗?",upStatus);
- });
- var start;
- $(".workmysrc").on("click",".discuss",function(){
- var resourceId=$(this).attr("resourceId");
- var operationId=$(this).attr("operationId");
- var dataStatus=$(this).attr("dataStatus");
- getAssess1(operationId);
- CommentInfo();
- if(lengths==0&&dataStatus==0){
- $(".sqlcomment").css("display","none");
- $(".evastar2").click(function(){
- $(".evastar2").removeClass('span');
- start=$(this).index()+1;
- for(var i=0;i<start;i++){
- if(i<start){
- $(".evastar2").eq(i).addClass("span");
- }
- else{
- $(".evastar2").eq(i).removeClass('span');
- }
- }
- });
- $("#discuss").click(function(){
-
- $.ajax({
- "url":"/ajax/assess",
- "type":"post",
- "async": true,
- "data":{"operationId":operationId,"professorId":userid,"resourceId":resourceId,"starLevel":start,"descp":$("#discussContent").val()},
- "success":function(data){
- if(data.success)
- {
- location.reload(true);
- }
- else
- {
-
- }
- },
- "beforeSend":function(){},
- "error":function(){$.MsgBox.Alert('message','failddd')}
- });
- })
- }else if(lengths==0&&dataStatus==1){
- $(".addcomment").css("display","none");
- var string='<tr><td><div class="righteva"><div class="noconmment">对方还未评价</div></div></div></td></tr>';
- $("#commbox").append(string);
- }else if(lengths==1&&dataStatus==0){
- $(".addcomment").css("display","none");
- getAssess(operationId,1);
- }else if(lengths==1&&dataStatus==1){
- getAssess(operationId,1);
- $(".evastar2").click(function(){
- $(".evastar2").removeClass('span');
- start=$(this).index()+1;
- for(var i=0;i<start;i++){
- if(i<start){
- $(".evastar2").eq(i).addClass("span");
- }
- else{
- $(".evastar2").eq(i).removeClass('span');
- }
- }
- });
- $("#discuss").click(function(){
-
- $.ajax({
- "url":"/ajax/assess",
- "type":"post",
- "async": true,
- "data":{"operationId":operationId,"professorId":userid,"resourceId":resourceId,"starLevel":start,"descp":$("#discussContent").val()},
- "success":function(data){
- if(data.success)
- {
- }
- else
- {
-
- }
- },
- "beforeSend":function(){},
- "error":function(){$.MsgBox.Alert('message','failddd')}
- });
- })
- }else if(lengths==2){
- $(".addcomment").css("display","none");
- getAssess(operationId,2);
- }
-
-
-
- })
- var lengths;
- function getAssess1(operationId){
- $.ajax({"url" : "/ajax/assess/qaoper",
- "type" : "get",
- "async":false,
- "success" : function(rdata)
- {
- if (rdata.success)
- {
-
- lengths=rdata.data.length;
- }
- else
- {
-
- }
- },
- "data" :{"operationId":operationId},
- "contentType" :"application/x-www-form-urlencoded",
- dataType : "json"
- });
- }
- function getAssess(operationId,le){
- $.ajax({"url" : "/ajax/assess/qaoper",
- "type" : "get",
- "async":true,
- "success" : function(rdata)
- {
- if (rdata.success)
- {
- $data=rdata.data;
- if(le==1){
- var string="";
- string+='<div class="ass"><tr><td><div class="teamwork"><div class="lefteva"><a href="" class="evaimg"><img src="images/default-photo.jpg" width="100%" height="100%"></a>'
- string+='<p>'+ $data[0].professor.name +'</p></div>'
- string+='<div class="righteva"><ul class="evasort">'
- string+='<li class="teamname"><span>'+$data[0].resource.resourceName+'资源的合作</span><span class="teamtime">2016-09-06</span></li></ul>'
- string+='<div class="evastarbox"><span class="evastar evastar1"></span><span class="evastar evastar1"></span><span class="evastar evastar1"></span><span class="evastar evastar1"></span><span class="evastar evastar1"></span></div>'
- string+='<p class="evabrief">'+$data[0].descp+'</p>'
- string+='</div></div></td></tr>'
- string+='<tr><td><div class="righteva"><div class="noconmment">对方还未评价</div></div></div></td></tr></div>'
- $("#commbox").append(string);
-
- for(var i=0;i<$data[0].starLevel;i++)
- {
-
- $(".evastar1").eq(i).addClass('span');
- }
- }else if(le==2){
- for(var j=0;j<2;j++){
- var string="";
- string+='<div class="ass"><tr><td><div class="teamwork"><div class="lefteva"><a href="" class="evaimg"><img src="images/default-photo.jpg" width="100%" height="100%"></a>'
- string+='<p>'+ $data[j].professor.name +'</p></div>'
- string+='<div class="righteva"><ul class="evasort">'
- string+='<li class="teamname"><span>'+$data[j].resource.resourceName+'资源的合作</span><span class="teamtime">2016-09-06</span></li></ul>'
- string+='<div class="evastarbox"><span class="evastar evastar1"></span><span class="evastar evastar1"></span><span class="evastar evastar1"></span><span class="evastar evastar1"></span><span class="evastar evastar1"></span></div>'
- string+='<p class="evabrief">'+$data[j].descp+'</p>'
- string+='</div></div></td></tr></div>'
- $("#commbox").append(string);
- if(j==0)
- {
- for(var i=0;i<$data[j].starLevel;i++)
- {
-
- $(".evastar1").eq(i).addClass('span');
- }
- }
- else{
- for(var i=0;i<$data[j].starLevel;i++)
- {
-
- $(".evastar1").eq(i+5).addClass('span');
- }
- }
- string="";
- }
- }
- }
- else
- {
-
- }
- },
- "data" :{"operationId":operationId},
- "contentType" :"application/x-www-form-urlencoded",
- dataType : "json"
- });
- }
- function discussContent(){
- $.ajax({
- "url":"/ajax/assess",
- "type":"post",
- "async": true,
- "data":{"operationId":operationId,"professorId":userid,"resourceId":resourceId,"starLeval":start,"descp":$("#discussContent").val()},
- "success":function(data){
- if(data.success)
- {
- location.reload(true);
- }
- else
- {
-
- }
- },
- "error":function(){$.MsgBox.Alert('message','failddd')}
- });
- }
- function getIdentity(professorId){
- $.ajax({
- "url":"ajax/professor/"+professorId,
- "type":"get",
- "async": false,
- "success":function(data){
- if(data.success)
- {
- $("option")[0].value=data.data.name;
- $("option")[1].value=data.data.organization.name;
- }
- else
- {
- $.MsgBox.Alert("消息","系统异常!");
- }
- },
- "error":function(){$.MsgBox.Alert('message','failddd')}
- })
- }
- $(".workmysrc").on("click",".detailm",function(){
- var resourceId=$(this).attr("resourId");
- var operationStatus=$(this).attr("operationStatus");
- var operationId=$(this).attr("operationId");
- var priceDifference=$(this).attr("dealPrice");
-
- flag=1;
- opo=operationId;
- if(flag==1&&operationStatus==1)
- {
- ResourceApply();
- $(".limitBox").removeClass("limitBox");
- $(".limitwords").removeClass("limitwords");
- $(".limitwordbox").removeClass("limitwordbox");
-
- $( "#datepicker" ).datepicker({ "dateFormat":" yy-mm-dd"});
- $(".stateinfor span").text("修改申请中");
- $(".btnboxup").css({"display":"none"});
- $(".applysure").css({"display":"none"});
- ajaxGet(operationId,1,1);
- getIdentity(userid);
-
-
- $("#deliver").on("click",function()
- {
- var $data = {};
- $data.demandId = userid;
- $data.resourceId = resourceId;
- $data.operationId=operationId;
- $data.detailDemand=$(".detail").val();
- $data.deliverTime=replaceStr($.trim($("#datepicker").val()));
- $data.applysquare=$("select option:selected").val();
- $data.operationStatus=1;
- $.ajax({
- "url" : "/ajax/operation",
- "type" : "put",
- "success" : function(rdata) {
- if (rdata.success){
- getPageData(6,1,false);
- $(".blackcover").remove();
- $("body").css("position","");
- $.MsgBox.Alert('消息',"资源申请信息修改成功");
- $("#mb_msgicon").css("background", 'url("images/sign_icon_chenggong_nor.png") 0% 0% / contain');
- } else {
- $.MsgBox.Alert('消息',"资源申请信息修改失败");
- }
- },
- "data" : JSON.stringify($data) ,
- "contentType" :"application/json",
- dataType : "json"
- });
- });
-
-
- }
- if(flag==1&&operationStatus==2)
- {
- ResourceApply();
- ajaxGet1(operationId);
-
- $(".dealTime").replaceWith("<span class='dealTime'></span>");
- $(".detail").replaceWith("<span class='detail'></span>");
- $("select").replaceWith("<span class='sname'></span>")
- $(".btnboxdown").css({"display":"none"});
- $(".applysure").css({"display":"none"});
- $(".stateinfor span").text("回复报价中");
- $(".btnboxup").css({"display":"none"});
- $(".btnboxdown").css({"display":"block"});
- $(".applysure").css({"display":"block"});
- $(".bag").css("display","none");
- $(".sendpri").text("");
- $("#payMethod").replaceWith("<span id='payMethod'><span>");
- $("#dealPrice").replaceWith("<span id='dealPrice'><span>");
- $("#consultContent").replaceWith("<span id='consultContent'><span>");
- $("#del")[0].value="合作";
- $("#reject")[0].value="直接拒绝";
- $("#reject").click(function(){
- n=4;
- $(".blackcover").remove();
- $("body").css("position","");
- $.MsgBox.Confirm("消息", "确定继续吗?",upStatus);
- })
- $("#del").click(function(){
- n=3;
- $(".blackcover").remove();
- $("body").css("position","");
- upStatus();
- })
- }
- if(flag==1&&operationStatus==3){
- DetailInfo();
- $("#totalPrice").text(priceDifference);
- $(".liuyaninfo").css("display","none");
- $(".pingjiainfo").css("display","none");
- $(".filebox").css("display","none");
- ajaxGet1(operationId);
- $(".payaddbox1").css("display","none");
- discussGetPaidMoney(operationId,priceDifference);
- }
- if(flag==1&&operationStatus==4){
- ResourceApply();
- ajaxGet1(operationId);
- $(".dealTime").replaceWith("<span class='dealTime'></span>");
- $(".detail").replaceWith("<span class='detail'></span>");
- $("select").replaceWith("<span class='sname'></span>")
- $(".btnboxdown").css({"display":"none"});
- $(".applysure").css({"display":"none"});
- $(".sendpri").text("");
- $(".stateinfor span").text("详情");
- $(".resde").text("详情页面");
- $(".btnboxup").css({"display":"none"});
- $(".btnboxdown").css({"display":"block"});
- $(".applysure").css({"display":"block"});
- $(".bag").css("display","none");
- $(".addrebtn").css("display","none");
- $("#payMethod").replaceWith("<span id='payMethod'><span>");
- $("#dealPrice").replaceWith("<span id='dealPrice'><span>");
- $("#consultContent").replaceWith("<span id='consultContent'><span>");
- }
- if(flag==1&&operationStatus==5){
- ResourceApply();
- ajaxGet(operationId);
- $(".stateinfor").find("span").text("合作结束");
- $(".dealTime").replaceWith("<span class='dealTime'></span>");
- $(".detail").replaceWith("<span class='detail'></span>");
- $("select").replaceWith("<span class='sname'></span>")
- $(".btnboxdown").css({"display":"none"});
- $(".applysure").css({"display":"none"});
-
- $(".addrebtn").css("display","none");
- }
- if(flag==1&&operationStatus==6){
- DetailInfo();
- $("#totalPrice").text(priceDifference);
- $(".filebox").css("display","none");
- $(".liuyaninfo").css("display","none");
- $(".pingjiainfo").css("display","none");
- $(".filebox").css("display","none");
- ajaxGet1(operationId);
- $(".payaddbox1").css("display","none");
- discussGetPaidMoney(operationId,priceDifference)
- }
- if(flag==1&&operationStatus==7){
- DetailInfo();
- $("#totalPrice").text(priceDifference);
- $(".liuyaninfo").css("display","none");
- $(".pingjiainfo").css("display","none");
- $(".filebox").css("display","none");
- ajaxGet1(operationId);
- $(".payaddbox1").css("display","none");
- discussGetPaidMoney(operationId,priceDifference)
- }
- if(flag==1&&operationStatus==8){
- DetailInfo();
- $("#totalPrice").text(priceDifference);
- $(".liuyaninfo").css("display","none");
- $(".pingjiainfo").css("display","none");
- $(".filebox").css("display","none");
- ajaxGet1(operationId);
- $(".payaddbox1").css("display","none");
- discussGetPaidMoney(operationId,priceDifference)
- }
- })
- function discussGetContent(operationId){
- $.ajax({
- "url":"/ajax/assess/qaoper",
- "type":"get",
- "async": true,
- "data":{"operationId":operationId},
- "success":function(data){
- if(data.success){
-
- }
- else
- {
-
- }
- },
- "error":function(){$.MsgBox.Alert('message','failddd')}
- });
- }
- function upStatus(){
- $.ajax({"url" : "/ajax/operation/operationStatus",
- "type" : "POST",
- "success" : function(rdata)
- {
- if (rdata.success)
- {
- getPageData(6,1,false);
- }
- else
- {
- $.MsgBox.Alert('message','状态更新失败');
- }
- },
- "data" :{"operationId":opo,"operationStatus":n},
- "beforeSend":function(){},
- "contentType" :"application/x-www-form-urlencoded",
- dataType : "json"
- });
- }
- function upStatus1(){
- $.ajax({"url" : "/ajax/operation/operationStatus",
- "type" : "POST",
- "success" : function(rdata)
- {
- if (rdata.success)
- {
- getDataResource();
- }
- else
- {
- $.MsgBox.Alert('message','状态更新失败');
- }
- },
- "data" :{"operationId":opo,"operationStatus":n},
- "beforeSend":function(){},
- "contentType" :"application/x-www-form-urlencoded",
- dataType : "json"
- });
- }
- function ajaxGet(operationId,o,p){
- $.ajax({
- "url":"/ajax/operation/"+operationId,
- "type":"get",
- "async": true,
- "success":function(data){
- if(data.success)
- {
-
- $(".log").text(data.data.resource.resourceName);
- $(".timelog").text(changeTime(data.data.createTime));
- $(".contration").text(data.data.operationId);
- $(".detail").text(data.data.detailDemand);
- if(o==1&&p==1){
- $(".dealTime").val(changeTime(data.data.deliverTime));
- }else{
- $(".dealTime").text(changeTime(data.data.deliverTime));
- }
- if(data.data.professor.name==data.data.applysquare){
- $("select").find("option[title=个人]").attr("selected",true);
- }else{
- $("select").find("option[title=所属机构]").attr("selected",true);
- }
- $(".sname").text(data.data.applysquare);
- $(".namecon").text(data.data.resource.professor.name);
- $(".resouImage").attr("src","/images/resource/"+data.data.resource.resourceId+".jpg");
- $(".resouImage").load(function(){})
- .error(function(){
- $(this).attr("src","/images/default-resource.jpg");
- });
-
- if(data.data.payMethod){
- $("#payMethod").val(data.data.payMethod);
- }
- if(data.data.dealPrice){
- $("#dealPrice").val(data.data.dealPrice);
- }
- if(data.data.replyNotes){
- $("#consultContent").val(data.data.replyNotes);
- }
-
- limitHeight();
- }
- else
- {
-
- }
- },
- "error":function(){$.MsgBox.Alert('message','failddd')}
- });
- }
- function ajaxGet1(operationId){
- $.ajax({
- "url":"/ajax/operation/"+operationId,
- "type":"get",
- "async": true,
- "success":function(data){
- if(data.success)
- {
- $(".log").text(data.data.resource.resourceName);
- $(".timelog").text(changeTime(data.data.createTime));
- $(".contration").text(data.data.operationId);
- $(".detail").text(data.data.detailDemand);
- $(".dealTime").text(changeTime(data.data.deliverTime));
- $(".namecon").text(data.data.resource.professor.name);
- $(".sname").text(data.data.applysquare);
- $(".resouImage").attr("src","/images/resource/"+data.data.resource.resourceId+".jpg");
- $(".resouImage").load(function(){})
- .error(function(){
- $(this).attr("src","/images/default-resource.jpg");
- });
- if(data.data.payMethod){
- $("#payMethod").text(data.data.payMethod);
- }
- if(data.data.dealPrice){
- $("#dealPrice").text(data.data.dealPrice);
- }
- if(data.data.replyNotes){
- $("#consultContent").text(data.data.replyNotes);
- }
-
- limitHeight();
- }
- else
- {
-
- }
- },
- "error":function(){$.MsgBox.Alert('message','failddd')}
- });
- }
-
- $(".worksamlltit1").click(function(){
- var index = $(this).index();
- $(this).addClass("worksamlltitnow").siblings().removeClass("worksamlltitnow");
- $(".workmysrc1").eq(index).show().siblings().hide();
- });
- });
|