Browse Source

格式化获取时间

luyanan 8 years ago
parent
commit
45306b8acd

+ 26 - 1
src/main/webapp/js/common.js

@ -49,4 +49,29 @@ function loginStatus(){
49 49
		$(".head-portrait").hide();
50 50
		$(".unlogin").show();
51 51
	}
52
}
52
}
53

54
//转换格式
55
function changeTime(time){
56
	   var s = time.toString();
57
	   if(s.length==8){
58
	   	var y = s.substr(0,4);
59
	   var m = s.substr(4,2);
60
	   var d = s.substr(6,2);			  
61
	   var formatTime = y+"-"+m+"-"+d;
62
		return formatTime;
63
	   }
64
	   else
65
	   {
66
	   	var y = s.substr(0,4);
67
	   var m = s.substr(4,2);
68
	   var d = s.substr(6,2);
69
	   var h = s.substr(8,2);
70
	   var minute = s.substr(10,2);
71
	   var formatTime = y+"-"+m+"-"+d+" "+h+":"+minute;
72
		return formatTime;
73
	   }
74
	   
75
	}
76

77


+ 16 - 1
src/main/webapp/js/information.brow.js

@ -456,7 +456,22 @@ $(".subsidebar").click(function(){
456 456
//资源申请入口
457 457
	$('.introduction').on("click",'.applicant',function(){
458 458
		ResourceApply();//调用资源申请HTML创建函数
459
		//当前时间并且格式化时间插件
459
		//获取当前时间并且格式化当前时间并且格式化时间
460
		var myDate = new Date();
461
		var nowYear = myDate.getFullYear();
462
		var nowMonth = myDate.getMonth()+1;
463
		var nowDate = myDate.getDate();
464
		if(nowMonth<10){
465
			nowMonth="0"+nowMonth.toString();
466
		}
467
		if(nowDate<10){
468
			nowDate="0"+nowDate.toString();
469
		}
470
		var now = nowYear + "-" + nowMonth + "-" + nowDate;
471
		$( "#datepicker").val(now);
472

473
		//console.log(now);
474
		
460 475
		$( "#datepicker" ).datepicker({ "dateFormat":" yy-mm-dd"});
461 476
		//console.log(name);
462 477
		$(".timelo").css("display","none");

+ 35 - 25
src/main/webapp/js/sciresource.js

@ -396,7 +396,7 @@ $(function(){
396 396
										"data":{"resourceId":$('.resoumag').eq(e+1).attr("resourceId"),"pageSize":pageSize,"pageNo":pageNo},						
397 397
										"success":function(data){			
398 398
											if(data.success)
399
												{												
399
												{			console.log(data);									
400 400
													for(var j=0;j<data.data.data.length;j++){
401 401
														if(data.data.data[j].dealPrice==undefined)
402 402
														{	
@ -406,22 +406,25 @@ $(function(){
406 406
														if(data.data.data[j].payMethod==undefined){												
407 407
															data.data.data[j].payMethod="";
408 408
														}
409
														
410
														data.data.data[j].deliverTime=changeTime(data.data.data[j].deliverTime);
411
														data.data.data[j].createTime=changeTime(data.data.data[j].createTime);
412
														
409 413
														var inquiry=inquiryGetPaidMoney(data.data.data[j].operationId);												
410 414
														var addString='<tr class="workitem">'
411
										                    addString+='<td>'+data.data.data[j].dealTime+'</td>'
415
										                    addString+='<td>'+data.data.data[j].createTime+'</td>'
412 416
										                     addString+='<td class="workitemsrc">'+data.data.data[j].applysquare+'</td>'
413 417
										                      addString+='<td> <a class="worktel" href="">'+data.data.data[j].professor.name+'<span class="worktelbtn"></span></a></td>'						                  
414 418
										                      addString+='<td>'+data.data.data[j].deliverTime+'</td>'
415
										                       addString+='<td class="price1">'+data.data.data[j].dealPrice+'</td>'
419
										                       addString+='<td class="price1'+e+'">'+data.data.data[j].dealPrice+'</td>'
416 420
										                        addString+='<td>'+data.data.data[j].payMethod+'</td>'
417 421
										                       addString+='<td><span>'+inquiry+'</span>/<span>'+data.data.data[j].dealPrice+'</span><br></td>'
418
										                        addString+='<td><div class="modification"></div></td> </tr>'						                      		
422
										                        addString+='<td><div class="modification'+e+'"></div></td> </tr>'						                      		
419 423
										                        	$(".tablecon").eq(e).append(addString);
420 424
																	//console.log($(".tablecon").eq(e));
421
																	if($(".price1").eq(t).text()==0){
422
																		$(".price1").eq(t).text("");
423
																	}	
424
																	console.log(f);
425
																	if($(".price1"+e+"").eq(j).text()==0){
426
																		$(".price1"+e+"").eq(j).text("");
427
																	}																		
425 428
																	switch(data.data.data[j].operationStatus)
426 429
																	{
427 430
																	case 1:
@ -429,14 +432,14 @@ $(function(){
429 432
																		string+='<a class="operatebtn">'
430 433
																		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 />'
431 434
																		string+='</a>'
432
																		$(".modification").eq(t).html(string);
435
																		$(".modification"+e+"").eq(j).html(string);
433 436
																	  break;
434 437
																	case 2:
435 438
																		var string='<span>发送报价待对方确认</span><br/>'
436 439
																		string+='<a class="operatebtn">'
437 440
																		string+='<span class="detailmess"resourId='+data.data.data[j].resource.resourceId+' operationStatus="2" operationId='+data.data.data[j].operationId+'>修改报价</span><br />'
438 441
																		string+='</a>'
439
																		$(".modification").eq(t).html(string);
442
																			$(".modification"+e+"").eq(j).html(string);
440 443
																	  break;
441 444
																	case 3:
442 445
																		var string='<span>对方发来报价合作进行中</span><br/>'
@ -445,21 +448,21 @@ $(function(){
445 448
																		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 />'
446 449
																		string+='<span resourId='+data.data.data[j].resource.resourceId+' operationStatus='+data.data.data[j].operationStatus+' operationId='+data.data.data[j].operationId+'>投诉</span>'
447 450
																		string+='</a>'
448
																		$(".modification").eq(t).html(string);
451
																			$(".modification"+e+"").eq(j).html(string);
449 452
																	  break;
450 453
																	case 4:
451 454
																		var string='<span>对方拒绝报价,合作结束</span><br/>'
452 455
																		string+='<a class="operatebtn">'
453 456
																		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 />'
454 457
																		string+='</a>'
455
																		$(".modification").eq(t).html(string);
458
																			$(".modification"+e+"").eq(j).html(string);
456 459
																	  break;
457 460
																	case 5:
458 461
																		var string='<span>本人拒绝合作</span><br/>'
459 462
																		string+='<a class="operatebtn">'
460 463
																		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 />'
461 464
																		string+='</a>'
462
																		$(".modification").eq(t).html(string);
465
																			$(".modification"+e+"").eq(j).html(string);
463 466
																	  break;
464 467
																	case 6:
465 468
																			var string='<span>对方中止合作合作结束</span><br/>'
@ -469,7 +472,7 @@ $(function(){
469 472
																			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 />'
470 473
																			string+='<span class="complain"resourId='+data.data.data[j].resource.resourceId+' operationStatus='+data.data.data[j].operationStatus+' operationId='+data.data.data[j].operationId+'>投诉</span>'
471 474
																			string+='</a>'
472
																			$(".modification").eq(t).html(string);	
475
																				$(".modification"+e+"").eq(j).html(string);	
473 476
																	  break;
474 477
																	case 7:
475 478
																		var string='<span>合作进行中</span><br/>'
@ -478,7 +481,7 @@ $(function(){
478 481
																		string+='<span class="acknowledgement"resourceId='+data.data.data[j].resource.resourceId+' operationStatus='+data.data.data[j].operationStatus+' operationId='+data.data.data[j].operationId+'>确认完成</span><br />'
479 482
																		string+='<span class="complain"resourId='+data.data.data[j].resource.resourceId+' operationStatus='+data.data.data[j].operationStatus+' operationId='+data.data.data[j].operationId+'>投诉</span>'
480 483
																		string+='</a>'
481
																		$(".modification").eq(t).html(string);
484
																			$(".modification"+e+"").eq(j).html(string);
482 485
																	  break;
483 486
																	case 8:
484 487
																		var string='<span>完成</span><br/>'
@ -487,12 +490,10 @@ $(function(){
487 490
																		//string+='<span class="discuss" dataStatus="1"resourceId='+data.data.data[j].resource.resourceId+' operationStatus='+data.data.data[j].operationStatus+' operationId='+data.data.data[j].operationId+'>评价</span><br />'
488 491
																		string+='<span class="complain"resourId='+data.data.data[j].resource.resourceId+' operationStatus='+data.data.data[j].operationStatus+' operationId='+data.data.data[j].operationId+'>投诉</span>'
489 492
																		string+='</a>'
490
																		$(".modification").eq(t).html(string);
493
																			$(".modification"+e+"").eq(j).html(string);
491 494
																	  break;
492
																	default:
493
																	  
494
																	}	
495
																	t++;
495
																	default:																	  
496
																	}																		
496 497
														addString="";
497 498
													}
498 499
													if(isbind == true)
@ -500,8 +501,7 @@ $(function(){
500 501
										$(".tcdPageCod"+e+"").createPage({
501 502
									        pageCount:Math.ceil(data.data.total/pageSize),
502 503
									        current:data.data.pageNo,
503
									        backFn:function(p){					        
504
									        	$(this).parent().parent().find(".workitem").remove();
504
									        backFn:function(p){					        							        	
505 505
									        	getPageResource(3,p,false,e,f);									        	
506 506
									        }									      
507 507
									    });
@ -694,6 +694,8 @@ if(flag==0&&operationStatus==8){
694 694

695 695

696 696

697

698

697 699
//我的需求查询
698 700
function getPageData(pageSize,pageNo,isbind){
699 701
	$.ajax({		
@ -705,7 +707,11 @@ function getPageData(pageSize,pageNo,isbind){
705 707
		if(data.success)
706 708
			{	
707 709
			$(".worktabb").html("");
708
			console.log(data);
710
			var stringTitle="";
711
			stringTitle +='<tr class="worktabtit"><th width="12%" height="40">申请时间</th><th width="12%">需求资源</th><th width="12%">资源发布者</th><th width="12%">交付时间</th><th width="12%">成交金额</th><th width="12%">付款方式</th><th width="12%">付款进程</th><th width="14%">状态/操作</th></tr>';
712
			$(".worktabb").append( stringTitle);
713
			
714
			//console.log(data);
709 715
			//alert(data.data.data.length);
710 716
				for(var i=0;i<data.data.data.length;i++)
711 717
					{	
@ -717,9 +723,13 @@ function getPageData(pageSize,pageNo,isbind){
717 723
					if(data.data.data[i].payMethod==undefined){
718 724
						data.data.data[i].payMethod="";
719 725
					}
726
					
727
					data.data.data[i].deliverTime=changeTime(data.data.data[i].deliverTime);
728
					data.data.data[i].createTime=changeTime(data.data.data[i].createTime);
729

720 730
					var stringContent="";
721 731
						stringContent +='<tr class="workitem">'
722
	                    stringContent +='<td>'+data.data.data[i].dealTime+'</td>'
732
	                    stringContent +='<td>'+data.data.data[i].createTime+'</td>'
723 733
	                    stringContent +='<td class="workitemsrc">'+data.data.data[i].resource.resourceName+'</td>'
724 734
	                    stringContent +='<td> <a class="worktel" href="">'+data.data.data[i].resource.professor.name+'<span class="worktelbtn"></span></a></td>'	                    
725 735
	                    stringContent +='<td>'+data.data.data[i].deliverTime+'</td>'      
@ -819,7 +829,7 @@ function getPageData(pageSize,pageNo,isbind){
819 829
	"error":function(){$.MsgBox.Alert('message','failddd')}
820 830
});
821 831
}
822
getPageData(4,1,true);
832
getPageData(6,1,true);
823 833
//确认完成
824 834
$(".workmysrc").on("click",".acknowledgement",function(){
825 835
	finish();

+ 1 - 11
src/main/webapp/sciresource.html

@ -15,17 +15,7 @@
15 15
        <div class="workmysrc workmysrc1">
16 16
            <div class="workmysrctit"></div>
17 17
            <table width="100%" height="60" class="worktab worktabb">
18
                <tr class="worktabtit">
19
                    <th width="12%" height="40">申请时间</th>
20
                    <th width="12%">需求资源</th>
21
                    <th width="12%">资源发布者</th>                                
22
                    <th width="12%">交付时间</th>
23
                    <th width="12%">成交金额</th>
24
                    <th width="12%">付款方式</th>
25
                    <th width="12%">付款进程</th>
26
                    <th width="14%">状态/操作</th>
27
                </tr>
28
  
18

29 19
            </table>
30 20
           <div class="tcdPageCode tcdPageCode1"></div>
31 21
        </div>