|
@ -1,973 +1,973 @@
|
1
|
|
$(function(){
|
2
|
|
var userid = $.cookie("userid");
|
3
|
|
var lookall;
|
4
|
|
|
5
|
|
//获取专家的数据
|
6
|
|
function getProfessorData(professorId){
|
7
|
|
$.ajax({
|
8
|
|
"url":"/ajax/professor/editBaseInfo/"+professorId,
|
9
|
|
"type":"get",
|
10
|
|
"async": true,
|
11
|
|
"success":function(data) {
|
12
|
|
if(data.success)
|
13
|
|
{
|
14
|
|
$("#nameS").text(data.data.name);
|
15
|
|
$("#allConsultCount").text(data.data.consultCount);
|
16
|
|
if(data.data.authentication){
|
17
|
|
$(".modifyicon")[0].src="/images/onauth.png"
|
18
|
|
}
|
19
|
|
else{
|
20
|
|
$(".modifyicon")[0].src="/images/icon-unauth.png";
|
21
|
|
|
22
|
|
}
|
23
|
|
if(data.data.office) {
|
24
|
|
$("#office").text(data.data.office+",");
|
25
|
|
}
|
26
|
|
if(data.data.title) {
|
27
|
|
$("#title").text(data.data.title);
|
28
|
|
}
|
29
|
|
if(data.data.department) {
|
30
|
|
$("#department").text(data.data.department+",");
|
31
|
|
}
|
32
|
|
if(data.data.orgName) {
|
33
|
|
$("#organization").text(data.data.orgName);
|
34
|
|
}
|
35
|
|
if(data.data.address) {
|
36
|
|
$("#address").text(data.data.address);
|
37
|
|
}
|
38
|
|
if(data.data.hasHeadImage) {
|
39
|
|
$(".imgProfess").attr("src","/images/head/"+userid+"_l.jpg");
|
40
|
|
}
|
41
|
|
else
|
42
|
|
{
|
43
|
|
$(".imgProfess").attr("src","/images/default-photo.jpg");
|
44
|
|
}
|
45
|
|
var startLeval=parseInt(data.data.starLevel);
|
46
|
|
for(var i=0;i<startLeval;i++) {
|
47
|
|
$(".evastar2").eq(i).addClass("startStyle");
|
48
|
|
}
|
49
|
|
}
|
50
|
|
else
|
51
|
|
{
|
52
|
|
$.MsgBox.Alert("消息","获取专家数据失败!");
|
53
|
|
}
|
54
|
|
},
|
55
|
|
"error":function(){$.MsgBox.Alert('message','获取专家数据失败')}
|
56
|
|
})
|
57
|
|
}
|
58
|
|
getProfessorData(userid);
|
59
|
|
getRecentlyData();
|
60
|
|
$("#allResource,#worklinkre").on("click",function(){
|
61
|
|
$(".worksubmenu").eq(1).addClass("subcolor").siblings().removeClass("subcolor");
|
62
|
|
$.ajax({
|
63
|
|
"url":"newsciresource.html",
|
64
|
|
"dataType":"html",
|
65
|
|
"success":function(result){
|
66
|
|
$(".workcon").html(result);
|
67
|
|
if(reNO==false&&opNO)
|
68
|
|
{
|
69
|
|
$(".workmysrc1").eq(1).show().siblings().hide();
|
70
|
|
$(".worksamlltit").eq(1).addClass("worksamlltitnow").siblings().removeClass("worksamlltitnow");
|
71
|
|
}
|
72
|
|
}
|
73
|
|
})
|
74
|
|
})
|
75
|
|
//获取最近3次的申请
|
76
|
|
function getRecentlyData(){
|
77
|
|
$.ajax({
|
78
|
|
"url":"/ajax/operation/pqpro",
|
79
|
|
"type":"get",
|
80
|
|
"data":{"id":userid,"pageSize":4},
|
81
|
|
"async": false,
|
82
|
|
"success":function(data)
|
83
|
|
{
|
84
|
|
if(data.success)
|
85
|
|
{
|
86
|
|
$(".sharesrcbox11").html("");
|
87
|
|
|
88
|
|
for(var i=0;i<data.data.data.length;i++)
|
89
|
|
{
|
90
|
|
data.data.data[i].createTime=changeTime(data.data.data[i].createTime);
|
91
|
|
var stringContent="";
|
92
|
|
if(userid==data.data.data[i].professor.id)
|
93
|
|
{
|
94
|
|
stringContent +='<div class="sharesrc replySide" 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+' flag=1>'
|
95
|
|
}
|
96
|
|
else
|
97
|
|
{
|
98
|
|
stringContent +='<div class="sharesrc replySide" 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+' flag=0>'
|
99
|
|
}
|
100
|
|
stringContent +='<div class="shareshow"><img src="" width="186" height="186"class="resourceImage"></div>'
|
101
|
|
stringContent +='<div class="shareshow"><p>资源名称:'+data.data.data[i].resource.resourceName+'</p>'
|
102
|
|
if(userid==data.data.data[i].professor.id)
|
103
|
|
{
|
104
|
|
stringContent +='<p>合作对象:'+data.data.data[i].resource.professor.name+'</p>'
|
105
|
|
}
|
106
|
|
else{
|
107
|
|
stringContent +='<p>合作对象:'+data.data.data[i].professor.name+'</p>'
|
108
|
|
}
|
109
|
|
stringContent +='<p>最新动态:</p>'
|
110
|
|
stringContent +='<p class="statuswork"></p></div>'
|
111
|
|
stringContent +='</div>'
|
112
|
|
var $stringContent=$(stringContent)
|
113
|
|
$(".sharesrcbox11").append($stringContent);
|
114
|
|
if(data.data.data[i].resource.images.length){
|
115
|
|
$stringContent.find(".resourceImage").attr("src","/images/resource/"+data.data.data[i].resource.resourceId+".jpg");
|
116
|
|
}
|
117
|
|
else{
|
118
|
|
$stringContent.find(".resourceImage").attr("src","/images/default-resource.jpg");
|
119
|
|
}
|
120
|
|
|
121
|
|
//console.log(data.data.data[i].resource.supportedServices);
|
122
|
|
if(userid==data.data.data[i].professor.id)
|
123
|
|
{
|
124
|
|
switch(data.data.data[i].operationStatus)
|
125
|
|
{
|
126
|
|
case 1:
|
127
|
|
var string='<span title="修改申请">申请已发送,待'+data.data.data[i].resource.professor.name+'确认</span><br/>'
|
128
|
|
$(".statuswork").eq(i).html(string);
|
129
|
|
break;
|
130
|
|
case 2:
|
131
|
|
var string='<span>'+data.data.data[i].resource.professor.name+'发来报价,回复报价</span><br/>'
|
132
|
|
$(".statuswork").eq(i).html(string);
|
133
|
|
break;
|
134
|
|
case 3:
|
135
|
|
var string='<span>合作进行中,查看详情</span><br/>'
|
136
|
|
$(".statuswork").eq(i).html(string);
|
137
|
|
break;
|
138
|
|
case 4:
|
139
|
|
var string='<span>中止合作,查看详情</span><br/>'
|
140
|
|
$(".statuswork").eq(i).html(string);
|
141
|
|
break;
|
142
|
|
case 5:
|
143
|
|
var string='<span>'+data.data.data[i].resource.professor.name+'拒绝合作,合作结束,查看详情</span><br/>'
|
144
|
|
$(".statuswork").eq(i).html(string);
|
145
|
|
break;
|
146
|
|
case 6:
|
147
|
|
var string='<span>本人中止合作,查看详情</span><br/>'
|
148
|
|
$(".statuswork").eq(i).html(string);
|
149
|
|
break;
|
150
|
|
case 7:
|
151
|
|
var string='<span>合作进行中,查看详情</span><br/>'
|
152
|
|
$(".statuswork").eq(i).html(string);
|
153
|
|
break;
|
154
|
|
case 8:
|
155
|
|
var string='<span>完成,查看详情</span><br/>'
|
156
|
|
$(".statuswork").eq(i).html(string);
|
157
|
|
break;
|
158
|
|
default:
|
159
|
|
}
|
160
|
|
}
|
161
|
|
else
|
162
|
|
{
|
163
|
|
switch(data.data.data[i].operationStatus)
|
164
|
|
{
|
165
|
|
case 1:
|
166
|
|
var string='<span>'+data.data.data[i].professor.name+'</span> <span>发来了</span><span>新的申请</span>'
|
167
|
|
$(".statuswork").eq(i).html(string);
|
168
|
|
break;
|
169
|
|
case 2:
|
170
|
|
var string='<span>发送报价待'+data.data.data[i].professor.name+'确认,修改报价</span><br/>';
|
171
|
|
$(".statuswork").eq(i).html(string);
|
172
|
|
break;
|
173
|
|
case 3:
|
174
|
|
var string='<span>'+data.data.data[i].professor.name+'发来报价,合作进行中,查看详情</span><br/>'
|
175
|
|
$(".statuswork").eq(i).html(string);
|
176
|
|
break;
|
177
|
|
case 4:
|
178
|
|
var string='<span>'+data.data.data[i].professor.name+'拒绝报价,合作结束,查看详情</span><br/>'
|
179
|
|
$(".statuswork").eq(i).html(string);
|
180
|
|
break;
|
181
|
|
case 5:
|
182
|
|
var string='<span>本人拒绝合作,查看详情</span><br/>'
|
183
|
|
$(".statuswork").eq(i).html(string);
|
184
|
|
break;
|
185
|
|
case 6:
|
186
|
|
var string='<span>'+data.data.data[i].professor.name+'中止合作合作结束,查看详情</span><br/>'
|
187
|
|
$(".statuswork").eq(i).html(string);
|
188
|
|
break;
|
189
|
|
case 7:
|
190
|
|
var string='<span>合作进行中,查看详情</span><br/>'
|
191
|
|
$(".statuswork").eq(i).html(string);
|
192
|
|
break;
|
193
|
|
case 8:
|
194
|
|
var string='<span>完成,查看详情</span><br/>'
|
195
|
|
$(".statuswork").eq(i).html(string);
|
196
|
|
break;
|
197
|
|
default:
|
198
|
|
}
|
199
|
|
}
|
200
|
|
|
201
|
|
}
|
202
|
|
}
|
203
|
|
else
|
204
|
|
{
|
205
|
|
alert("系统异常!");
|
206
|
|
}
|
207
|
|
},
|
208
|
|
"error":function(){$.MsgBox.Alert('message','fail111')}
|
209
|
|
});
|
210
|
|
}
|
211
|
|
//根据不同的状态进行操作回复或者查看详情
|
212
|
|
$(".sharesrcbox11").on("click",".replySide",function(){
|
213
|
|
var operationId=$(this).attr("operationId");
|
214
|
|
var operationStatus=$(this).attr("operationStatus");
|
215
|
|
var priceDifference=$(this).attr("dealPrice");
|
216
|
|
var flag=$(this).attr("flag");
|
217
|
|
var resourceId=$(this).attr("resourId");
|
218
|
|
opo=operationId;
|
219
|
|
if(flag==0&&operationStatus==1)
|
220
|
|
{ ResourceApply();
|
221
|
|
ajaxGet(operationId);
|
222
|
|
$(".dealTime").replaceWith("<span class='dealTime'></span>");
|
223
|
|
$(".detail").replaceWith("<span class='detail'></span>");
|
224
|
|
$("select").replaceWith("<span class='sname'></span>")
|
225
|
|
$(".btnboxdown").css({"display":"none"});
|
226
|
|
$(".applysure").css({"display":"none"});
|
227
|
|
$("#nextStep").click(function(){
|
228
|
|
$(".stateinfor span").text("报价中");
|
229
|
|
$(".btnboxup").css({"display":"none"});
|
230
|
|
$(".btnboxdown").css({"display":"block"});
|
231
|
|
$(".applysure").css({"display":"block"});
|
232
|
|
$(".bag").css("display","none");
|
233
|
|
$(".frm").click(function(){
|
234
|
|
var $date = {};
|
235
|
|
$date.detailDemand=$(".detail").text();
|
236
|
|
$date.deliverTime=replaceStr($.trim($(".dealTime").text()));
|
237
|
|
$date.dealPrice =$("#dealPrice").val();
|
238
|
|
$date.payMethod = $("#payMethod").val();
|
239
|
|
$date.replyNotes = $("#consultContent").val();
|
240
|
|
$date.applysquare = $(".sname").text();
|
241
|
|
$date.operationId=operationId;
|
242
|
|
$date.operationStatus=2;
|
243
|
|
$.ajax({
|
244
|
|
"url" : "/ajax/operation",
|
245
|
|
"type" : "put",
|
246
|
|
"data" :JSON.stringify($date),
|
247
|
|
"contentType" :"application/json",
|
248
|
|
"success" : function(data) {
|
249
|
|
if (data.success) {
|
250
|
|
$(".blackcover").remove();
|
251
|
|
$("body").css("position","static");
|
252
|
|
getRecentlyData();
|
253
|
|
$.MsgBox.Alert('message',"报价成功");
|
254
|
|
} else {
|
255
|
|
$.MsgBox.Alert('message',data.msg);
|
256
|
|
}
|
257
|
|
},
|
258
|
|
"beforeSend":function(){
|
259
|
|
//console.log(this.data);
|
260
|
|
},
|
261
|
|
});
|
262
|
|
})
|
263
|
|
|
264
|
|
})
|
265
|
|
$("#refuses").click(function(){
|
266
|
|
ResourceApply();
|
267
|
|
ajaxGet(operationId);
|
268
|
|
n=5;
|
269
|
|
$(".blackcover").remove();
|
270
|
|
$("body").css("position","static");
|
271
|
|
$.MsgBox.Confirm("消息", "确定拒绝吗?",upStatus1);
|
272
|
|
});
|
273
|
|
}
|
274
|
|
if(flag==0&&operationStatus==2){
|
275
|
|
ResourceApply();
|
276
|
|
ajaxGet(operationId);
|
277
|
|
$(".dealTime").replaceWith("<span class='dealTime'></span>");
|
278
|
|
$(".detail").replaceWith("<span class='detail'></span>");
|
279
|
|
$("select").replaceWith("<span class='sname'></span>")
|
280
|
|
$(".btnboxdown").css({"display":"none"});
|
281
|
|
$(".applysure").css({"display":"none"});
|
282
|
|
$(".stateinfor span").text("修改报价中");
|
283
|
|
$(".btnboxup").css({"display":"none"});
|
284
|
|
$(".btnboxdown").css({"display":"block"});
|
285
|
|
$(".applysure").css({"display":"block"});
|
286
|
|
$(".bag").css("display","none");
|
287
|
|
$(".frm").click(function(){
|
288
|
|
var $date = {};
|
289
|
|
$date.detailDemand=$(".detail").text();
|
290
|
|
$date.deliverTime=replaceStr($.trim($(".dealTime").text()));
|
291
|
|
$date.dealPrice = $("#dealPrice").val();
|
292
|
|
$date.payMethod = $("#payMethod").val();
|
293
|
|
$date.replyNotes = $("#consultContent").val();
|
294
|
|
$date.applysquare = $(".sname").text();
|
295
|
|
$date.operationId=operationId;
|
296
|
|
$date.operationStatus=2;
|
297
|
|
$.ajax({
|
298
|
|
"url" : "/ajax/operation",
|
299
|
|
"type" : "put",
|
300
|
|
"data" :JSON.stringify($date),
|
301
|
|
"contentType" :"application/json",
|
302
|
|
"success" : function(data) {
|
303
|
|
if (data.success) {
|
304
|
|
$(".blackcover").remove();
|
305
|
|
$("body").css("position","static");
|
306
|
|
getRecentlyData();
|
307
|
|
$.MsgBox.Alert('message',"报价成功");
|
308
|
|
} else {
|
309
|
|
$.MsgBox.Alert('message',data.msg);
|
310
|
|
}
|
311
|
|
},
|
312
|
|
"beforeSend":function(){
|
313
|
|
//console.log(this.data);
|
314
|
|
},
|
315
|
|
});
|
316
|
|
})
|
317
|
|
}
|
318
|
|
if(flag==0&&operationStatus==3){
|
319
|
|
|
320
|
|
DetailInfo();
|
321
|
|
$("#totalPrice").text(priceDifference);
|
322
|
|
$(".liuyaninfo").css("display","none");
|
323
|
|
$(".pingjiainfo").css("display","none");
|
324
|
|
$(".filebox").css("display","none");
|
325
|
|
ajaxGet1(operationId);
|
326
|
|
$(".payaddbox1").css("display","none");
|
327
|
|
|
328
|
|
discussGetPaidMoney(operationId,priceDifference)
|
329
|
|
}
|
330
|
|
if(flag==0&&operationStatus==4){
|
331
|
|
ResourceApply();
|
332
|
|
ajaxGet1(operationId);
|
333
|
|
$(".dealTime").replaceWith("<span class='dealTime'></span>");
|
334
|
|
$(".detail").replaceWith("<span class='detail'></span>");
|
335
|
|
$("select").replaceWith("<span class='sname'></span>")
|
336
|
|
$(".btnboxdown").css({"display":"none"});
|
337
|
|
$(".applysure").css({"display":"none"});
|
338
|
|
$(".stateinfor span").text("详情");
|
339
|
|
$(".btnboxup").css({"display":"none"});
|
340
|
|
$(".btnboxdown").css({"display":"block"});
|
341
|
|
$(".applysure").css({"display":"block"});
|
342
|
|
$(".bag").css("display","none");
|
343
|
|
$(".addrebtn").css("display","none");
|
344
|
|
$("#payMethod").replaceWith("<span id='payMethod'><span>");
|
345
|
|
$("#dealPrice").replaceWith("<span id='dealPrice'><span>");
|
346
|
|
$("#consultContent").replaceWith("<span id='consultContent'><span>");
|
347
|
|
}
|
348
|
|
if(flag==0&&operationStatus==5){
|
349
|
|
ResourceApply();
|
350
|
|
ajaxGet(operationId);
|
351
|
|
$(".dealTime").replaceWith("<span class='dealTime'></span>");
|
352
|
|
$(".detail").replaceWith("<span class='detail'></span>");
|
353
|
|
$("select").replaceWith("<span class='sname'></span>")
|
354
|
|
$(".btnboxdown").css({"display":"none"});
|
355
|
|
$(".applysure").css({"display":"none"});
|
356
|
|
$(".addrebtn").css("display","none");
|
357
|
|
}
|
358
|
|
if(flag==0&&operationStatus==6){
|
359
|
|
|
360
|
|
DetailInfo();
|
361
|
|
$("#totalPrice").text(priceDifference);
|
362
|
|
$(".liuyaninfo").css("display","none");
|
363
|
|
$(".pingjiainfo").css("display","none");
|
364
|
|
$(".filebox").css("display","none");
|
365
|
|
ajaxGet1(operationId);
|
366
|
|
$(".payaddbox1").css("display","none");
|
367
|
|
discussGetPaidMoney(operationId,priceDifference)
|
368
|
|
}
|
369
|
|
if(flag==0&&operationStatus==7){
|
370
|
|
|
371
|
|
DetailInfo();
|
372
|
|
$("#totalPrice").text(priceDifference);
|
373
|
|
$(".liuyaninfo").css("display","none");
|
374
|
|
$(".pingjiainfo").css("display","none");
|
375
|
|
$(".filebox").css("display","none");
|
376
|
|
ajaxGet1(operationId);
|
377
|
|
$(".payaddbox1").css("display","none");
|
378
|
|
discussGetPaidMoney(operationId,priceDifference)
|
379
|
|
}
|
380
|
|
if(flag==0&&operationStatus==8){
|
381
|
|
|
382
|
|
DetailInfo();
|
383
|
|
$("#totalPrice").text(priceDifference);
|
384
|
|
$(".liuyaninfo").css("display","none");
|
385
|
|
$(".pingjiainfo").css("display","none");
|
386
|
|
$(".filebox").css("display","none");
|
387
|
|
ajaxGet1(operationId);
|
388
|
|
$(".payaddbox1").css("display","none");
|
389
|
|
discussGetPaidMoney(operationId,priceDifference)
|
390
|
|
}
|
391
|
|
if(flag==1&&operationStatus==1)
|
392
|
|
{
|
393
|
|
ResourceApply();
|
394
|
|
$(".limitBox").removeClass("limitBox");
|
395
|
|
$(".limitwords").removeClass("limitwords");
|
396
|
|
$(".limitwordbox").removeClass("limitwordbox");
|
397
|
|
|
398
|
|
$( "#datepicker" ).datepicker({ "dateFormat":" yy-mm-dd"});
|
399
|
|
|
400
|
|
$(".stateinfor span").text("修改申请中");
|
401
|
|
$(".btnboxup").css({"display":"none"});
|
402
|
|
$(".applysure").css({"display":"none"});
|
403
|
|
ajaxGet(operationId,1,1);
|
404
|
|
getIdentity(userid);
|
405
|
|
//if($(".dealTime").val()!=""&&$(".detail").val()!="")
|
406
|
|
//{
|
407
|
|
$("#deliver").on("click",function()
|
408
|
|
{
|
409
|
|
var $data = {};
|
410
|
|
$data.demandId = userid;
|
411
|
|
$data.resourceId = resourceId;
|
412
|
|
$data.operationId=operationId;
|
413
|
|
$data.detailDemand=$(".detail").val();
|
414
|
|
$data.deliverTime=replaceStr($.trim($("#datepicker").val()));
|
415
|
|
$data.applysquare=$("select option:selected").val();
|
416
|
|
$data.operationStatus=1;
|
417
|
|
$.ajax({
|
418
|
|
"url" : "/ajax/operation",
|
419
|
|
"type" : "put",
|
420
|
|
"success" : function(rdata){
|
421
|
|
if (rdata.success){
|
422
|
|
getRecentlyData();
|
423
|
|
$(".blackcover").remove();
|
424
|
|
$("body").css("position","static");
|
425
|
|
$.MsgBox.Alert('消息',"资源申请信息修改成功");
|
426
|
|
} else {
|
427
|
|
$.MsgBox.Alert('消息',"资源申请信息修改失败");
|
428
|
|
}
|
429
|
|
},
|
430
|
|
"data" : JSON.stringify($data) ,
|
431
|
|
"contentType" :"application/json",
|
432
|
|
dataType : "json"
|
433
|
|
});
|
434
|
|
});
|
435
|
|
//}
|
436
|
|
|
437
|
|
}
|
438
|
|
if(flag==1&&operationStatus==2)
|
439
|
|
{
|
440
|
|
ResourceApply();
|
441
|
|
ajaxGet1(operationId);
|
442
|
|
$(".dealTime").replaceWith("<span class='dealTime'></span>");
|
443
|
|
$(".detail").replaceWith("<span class='detail'></span>");
|
444
|
|
$("select").replaceWith("<span class='sname'></span>")
|
445
|
|
$(".btnboxdown").css({"display":"none"});
|
446
|
|
$(".applysure").css({"display":"none"});
|
447
|
|
$(".stateinfor span").text("回复报价中");
|
448
|
|
$(".btnboxup").css({"display":"none"});
|
449
|
|
$(".btnboxdown").css({"display":"block"});
|
450
|
|
$(".applysure").css({"display":"block"});
|
451
|
|
$(".bag").css("display","none");
|
452
|
|
$(".sendpri").text("");
|
453
|
|
$("#payMethod").replaceWith("<span id='payMethod'><span>");
|
454
|
|
$("#dealPrice").replaceWith("<span id='dealPrice'><span>");
|
455
|
|
$("#consultContent").replaceWith("<span id='consultContent'><span>");
|
456
|
|
$(".frm")[0].value="直接拒绝";
|
457
|
|
$("#cooperation")[0].value="合作";
|
458
|
|
$(".frm").click(function(){
|
459
|
|
n=4;
|
460
|
|
$(".blackcover").remove();
|
461
|
|
$("body").css("position","static");
|
462
|
|
$.MsgBox.Confirm("消息", "确定继续吗?",upStatus1);
|
463
|
|
})
|
464
|
|
$("#cooperation").click(function(){
|
465
|
|
n=3;
|
466
|
|
$(".blackcover").remove();
|
467
|
|
$("body").css("position","static");
|
468
|
|
upStatus1();
|
469
|
|
})
|
470
|
|
}
|
471
|
|
if(flag==1&&operationStatus==3){
|
472
|
|
DetailInfo();
|
473
|
|
//console.log(priceDifference);
|
474
|
|
$("#totalPrice").text(priceDifference);
|
475
|
|
$(".liuyaninfo").css("display","none");
|
476
|
|
$(".pingjiainfo").css("display","none");
|
477
|
|
$(".filebox").css("display","none");
|
478
|
|
ajaxGet1(operationId);
|
479
|
|
$(".payaddbox1").css("display","none");
|
480
|
|
discussGetPaidMoney(operationId,priceDifference);
|
481
|
|
}
|
482
|
|
if(flag==1&&operationStatus==4){
|
483
|
|
ResourceApply();
|
484
|
|
ajaxGet1(operationId);
|
485
|
|
$(".dealTime").replaceWith("<span class='dealTime'></span>");
|
486
|
|
$(".detail").replaceWith("<span class='detail'></span>");
|
487
|
|
$("select").replaceWith("<span class='sname'></span>")
|
488
|
|
$(".btnboxdown").css({"display":"none"});
|
489
|
|
$(".applysure").css({"display":"none"});
|
490
|
|
$(".sendpri").text("");
|
491
|
|
$(".stateinfor span").text("详情");
|
492
|
|
$(".resde").text("详情页面");
|
493
|
|
$(".btnboxup").css({"display":"none"});
|
494
|
|
$(".btnboxdown").css({"display":"block"});
|
495
|
|
$(".applysure").css({"display":"block"});
|
496
|
|
$(".bag").css("display","none");
|
497
|
|
$(".addrebtn").css("display","none");
|
498
|
|
$("#payMethod").replaceWith("<span id='payMethod'><span>");
|
499
|
|
$("#dealPrice").replaceWith("<span id='dealPrice'><span>");
|
500
|
|
$("#consultContent").replaceWith("<span id='consultContent'><span>");
|
501
|
|
}
|
502
|
|
if(flag==1&&operationStatus==5){
|
503
|
|
ResourceApply();
|
504
|
|
ajaxGet(operationId);
|
505
|
|
$(".stateinfor").find("span").text("合作结束");
|
506
|
|
$(".dealTime").replaceWith("<span class='dealTime'></span>");
|
507
|
|
$(".detail").replaceWith("<span class='detail'></span>");
|
508
|
|
$("select").replaceWith("<span class='sname'></span>")
|
509
|
|
$(".btnboxdown").css({"display":"none"});
|
510
|
|
$(".applysure").css({"display":"none"});
|
511
|
|
//$(".resouinfotype2").text("");
|
512
|
|
$(".addrebtn").css("display","none");
|
513
|
|
}
|
514
|
|
if(flag==1&&operationStatus==6){
|
515
|
|
DetailInfo();
|
516
|
|
$("#totalPrice").text(priceDifference);
|
517
|
|
$(".filebox").css("display","none");
|
518
|
|
$(".liuyaninfo").css("display","none");
|
519
|
|
$(".pingjiainfo").css("display","none");
|
520
|
|
$(".filebox").css("display","none");
|
521
|
|
ajaxGet1(operationId);
|
522
|
|
$(".payaddbox1").css("display","none");
|
523
|
|
discussGetPaidMoney(operationId,priceDifference)
|
524
|
|
}
|
525
|
|
if(flag==1&&operationStatus==7){
|
526
|
|
DetailInfo();
|
527
|
|
$("#totalPrice").text(priceDifference);
|
528
|
|
$(".liuyaninfo").css("display","none");
|
529
|
|
$(".pingjiainfo").css("display","none");
|
530
|
|
$(".filebox").css("display","none");
|
531
|
|
ajaxGet1(operationId);
|
532
|
|
$(".payaddbox1").css("display","none");
|
533
|
|
discussGetPaidMoney(operationId,priceDifference)
|
534
|
|
}
|
535
|
|
if(flag==1&&operationStatus==8){
|
536
|
|
DetailInfo();
|
537
|
|
$("#totalPrice").text(priceDifference);
|
538
|
|
$(".liuyaninfo").css("display","none");
|
539
|
|
$(".pingjiainfo").css("display","none");
|
540
|
|
$(".filebox").css("display","none");
|
541
|
|
ajaxGet1(operationId);
|
542
|
|
$(".payaddbox1").css("display","none");
|
543
|
|
discussGetPaidMoney(operationId,priceDifference)
|
544
|
|
}
|
545
|
|
})
|
546
|
|
|
547
|
|
function ajaxGet(operationId,o,p){
|
548
|
|
$.ajax({
|
549
|
|
"url":"/ajax/operation/"+operationId,
|
550
|
|
"type":"get",
|
551
|
|
"async": true,
|
552
|
|
"success":function(data){
|
553
|
|
if(data.success)
|
554
|
|
{
|
555
|
|
$(".log").text(data.data.resource.resourceName);
|
556
|
|
$(".timelog").text(changeTime(data.data.createTime));
|
557
|
|
$(".contration").text(data.data.operationId);
|
558
|
|
$(".detail").text(data.data.detailDemand);
|
559
|
|
if(o==1&&p==1){
|
560
|
|
$(".dealTime").val(changeTime(data.data.deliverTime));
|
561
|
|
}else{
|
562
|
|
$(".dealTime").text(changeTime(data.data.deliverTime));
|
563
|
|
}
|
564
|
|
if(data.data.professor.name==data.data.applysquare){
|
565
|
|
$("select").find("option[title=个人]").attr("selected",true);
|
566
|
|
}else{
|
567
|
|
$("select").find("option[title=所属机构]").attr("selected",true);
|
568
|
|
}
|
569
|
|
$(".sname").text(data.data.applysquare);
|
570
|
|
$(".namecon").text(data.data.resource.professor.name);
|
571
|
|
$(".resouImage").attr("src","/images/resource/"+data.data.resource.resourceId+".jpg");
|
572
|
|
$(".resouImage").load(function(){})
|
573
|
|
.error(function(){
|
574
|
|
$(this).attr("src","/images/default-resource.jpg");
|
575
|
|
});
|
576
|
|
|
577
|
|
if(data.data.payMethod){
|
578
|
|
$("#payMethod").val(data.data.payMethod);
|
579
|
|
}
|
580
|
|
if(data.data.dealPrice){
|
581
|
|
$("#dealPrice").val(data.data.dealPrice);
|
582
|
|
}
|
583
|
|
if(data.data.replyNotes){
|
584
|
|
$("#consultContent").val(data.data.replyNotes);
|
585
|
|
}
|
586
|
|
}
|
587
|
|
else
|
588
|
|
{
|
589
|
|
//console.log("系统异常!");
|
590
|
|
}
|
591
|
|
},
|
592
|
|
"error":function(){$.MsgBox.Alert('message','failddd')}
|
593
|
|
});
|
594
|
|
}
|
595
|
|
function upStatus1(){
|
596
|
|
$.ajax({"url" : "/ajax/operation/operationStatus",
|
597
|
|
"type" : "POST",
|
598
|
|
"success" : function(rdata)
|
599
|
|
{
|
600
|
|
if (rdata.success)
|
601
|
|
{
|
602
|
|
getRecentlyData();
|
603
|
|
}
|
604
|
|
else
|
605
|
|
{
|
606
|
|
$.MsgBox.Alert('message','状态更新失败');
|
607
|
|
}
|
608
|
|
},
|
609
|
|
"data" :{"operationId":opo,"operationStatus":n},
|
610
|
|
"beforeSend":function(){/*console.log(this.data)*/},
|
611
|
|
"contentType" :"application/x-www-form-urlencoded",
|
612
|
|
dataType : "json"
|
613
|
|
});
|
614
|
|
}
|
615
|
|
function ajaxGet1(operationId){
|
616
|
|
$.ajax({
|
617
|
|
"url":"/ajax/operation/"+operationId,
|
618
|
|
"type":"get",
|
619
|
|
"async": true,
|
620
|
|
"success":function(data){
|
621
|
|
if(data.success)
|
622
|
|
{
|
623
|
|
$(".log").text(data.data.resource.resourceName);
|
624
|
|
$(".timelog").text(changeTime(data.data.createTime));
|
625
|
|
$(".contration").text(data.data.operationId);
|
626
|
|
$(".detail").text(data.data.detailDemand);
|
627
|
|
$(".dealTime").text(changeTime(data.data.deliverTime));
|
628
|
|
$(".namecon").text(data.data.resource.professor.name);
|
629
|
|
$(".sname").text(data.data.applysquare);
|
630
|
|
$(".resouImage").attr("src","/images/resource/"+data.data.resource.resourceId+".jpg");
|
631
|
|
$(".resouImage").load(function(){})
|
632
|
|
.error(function(){
|
633
|
|
$(this).attr("src","/images/default-resource.jpg");
|
634
|
|
});
|
635
|
|
if(data.data.payMethod){
|
636
|
|
$("#payMethod").text(data.data.payMethod);
|
637
|
|
}
|
638
|
|
if(data.data.dealPrice){
|
639
|
|
$("#dealPrice").text(data.data.dealPrice);
|
640
|
|
}
|
641
|
|
if(data.data.replyNotes){
|
642
|
|
$("#consultContent").text(data.data.replyNotes);
|
643
|
|
}
|
644
|
|
}
|
645
|
|
else
|
646
|
|
{
|
647
|
|
//console.log("系统异常!");
|
648
|
|
}
|
649
|
|
},
|
650
|
|
"error":function(){$.MsgBox.Alert('message','failddd')}
|
651
|
|
});
|
652
|
|
}
|
653
|
|
function discussGetPaidMoney(operationId,priceDifference){
|
654
|
|
var realCharge=0,balance=0;
|
655
|
|
$.ajax({
|
656
|
|
"url":"/ajax/payhistory/qadetail",
|
657
|
|
"type":"get",
|
658
|
|
"async": true,
|
659
|
|
"data":{"operationId":operationId},
|
660
|
|
"success":function(data){
|
661
|
|
if(data.success){
|
662
|
|
var popHtml="";
|
663
|
|
var $data=data.data;
|
664
|
|
var m;
|
665
|
|
for(var i=0;i<$data.length;i++){
|
666
|
|
|
667
|
|
PopHtml = '<tr class="payitem">';
|
668
|
|
PopHtml += '<td><div class="resouinforcon">'+changeTime($data[i].createTime)+'</div></td>';
|
669
|
|
PopHtml += '<td><div class="resouinforcon">'+$data[i].professor.name+'</div></td>';
|
670
|
|
PopHtml += '<td><div class="resouinforcon resou"></div></td>';
|
671
|
|
PopHtml += '<td><div class="resouinforcon to"></div></td>';
|
672
|
|
PopHtml += '<td><div class="resouinforcon resta"></div></td>';
|
673
|
|
PopHtml += '<td><div class="resouinforcon">'+$data[i].remark+'</div></td>';
|
674
|
|
PopHtml += '</tr>';
|
675
|
|
$("#paytit").append(PopHtml);
|
676
|
|
if($data[i].paidMoney==undefined)
|
677
|
|
{
|
678
|
|
$data[i].paidMoney=0;
|
679
|
|
}
|
680
|
|
if($data[i].returnMoney==undefined)
|
681
|
|
{
|
682
|
|
$data[i].returnMoney=0;
|
683
|
|
}
|
684
|
|
m=$data[i].paidMoney-$data[i].returnMoney;
|
685
|
|
$(".to").eq(i).text(m);
|
686
|
|
if($data[i].payType==0){
|
687
|
|
$(".resou").eq(i).text("线下支付");
|
688
|
|
}else{
|
689
|
|
$(".resou").eq(i).text("线上支付");
|
690
|
|
}
|
691
|
|
if($data[i].payStatus==0){
|
692
|
|
$(".resta").eq(i).text("未确认");
|
693
|
|
}else{
|
694
|
|
$(".resta").eq(i).text("确认收款");
|
695
|
|
}
|
696
|
|
popHtml="";
|
697
|
|
realCharge+=m;
|
698
|
|
}
|
699
|
|
balance=priceDifference-realCharge;
|
700
|
|
$("#balance").text(balance);
|
701
|
|
$("#realCharge").text(realCharge);
|
702
|
|
}
|
703
|
|
else
|
704
|
|
{
|
705
|
|
//console.log("系统异常!");
|
706
|
|
}
|
707
|
|
},
|
708
|
|
"error":function(){$.MsgBox.Alert('message','failddd')}
|
709
|
|
});
|
710
|
|
}
|
711
|
|
function getIdentity(professorId){
|
712
|
|
$.ajax({
|
713
|
|
"url":"ajax/professor/"+professorId,
|
714
|
|
"type":"get",
|
715
|
|
"async": false,
|
716
|
|
"success":function(data){
|
717
|
|
if(data.success)
|
718
|
|
{
|
719
|
|
$("option")[0].value=data.data.name;
|
720
|
|
$("option")[1].value=data.data.organization.name;
|
721
|
|
}
|
722
|
|
else
|
723
|
|
{
|
724
|
|
$.MsgBox.Alert("消息","系统异常!");
|
725
|
|
}
|
726
|
|
},
|
727
|
|
"error":function(){$.MsgBox.Alert('message','failddd')}
|
728
|
|
})
|
729
|
|
}
|
730
|
|
|
731
|
|
//正在合作的数量
|
732
|
|
$.ajax({
|
733
|
|
"url":"/ajax/operation/qaOnGoingOper",
|
734
|
|
"type":"get",
|
735
|
|
"data":{"professorId":userid},
|
736
|
|
"async": true,
|
737
|
|
"success":function(data)
|
738
|
|
{
|
739
|
|
if(data.success)
|
740
|
|
{
|
741
|
|
$("#workcontain").text(data.data);
|
742
|
|
}
|
743
|
|
}
|
744
|
|
});
|
745
|
|
|
746
|
|
|
747
|
|
|
748
|
|
|
749
|
|
//最新咨询中的发送
|
750
|
|
$("#myFlatSendConsultBtn").bind("click",newConsultSendFn);
|
751
|
|
//最新回复中的发送
|
752
|
|
$("#myFlatSendReplyBtn").bind("click",newReplySendFn);
|
753
|
|
//点击最新咨询查看全部
|
754
|
|
$("#lookAllConsult,#lookMyConsult").click(function(){
|
755
|
|
$("#consultbtn").css({
|
756
|
|
color:"#fff",
|
757
|
|
background:"#f99550"
|
758
|
|
});
|
759
|
|
lookall = 1;
|
760
|
|
clickConsultBtn(lookall);
|
761
|
|
});
|
762
|
|
//点击最新回复查看全部
|
763
|
|
$("#lookAllReply").click(function(){
|
764
|
|
$("#consultbtn").css({
|
765
|
|
color:"#fff",
|
766
|
|
background:"#f99550"
|
767
|
|
});
|
768
|
|
lookall = 2;
|
769
|
|
clickConsultBtn(lookall);
|
770
|
|
});
|
771
|
|
getConsultData(userid);
|
772
|
|
getReplyData(userid);
|
773
|
|
queryUnreadConsultFn(userid);//未读咨询总数
|
774
|
|
|
775
|
|
|
776
|
|
function queryUnreadConsultFn(professorId){//未读咨询总数函数
|
777
|
|
var params = {"professorId":professorId};
|
778
|
|
$.ajax({
|
779
|
|
"url":"/ajax/consult/qaReadStatus",
|
780
|
|
"type":"get",
|
781
|
|
"async": false,
|
782
|
|
"data":params,
|
783
|
|
"success":function(response){
|
784
|
|
$("#unreadConsult").html(response["data"]);
|
785
|
|
},
|
786
|
|
"error":function(){
|
787
|
|
$.MsgBox.Alert('message','总的未读咨询条数请求失败');
|
788
|
|
}
|
789
|
|
});
|
790
|
|
};
|
791
|
|
|
792
|
|
function getConsultData(professorId){
|
793
|
|
var params = {"professorId":professorId};
|
794
|
|
$.ajax({
|
795
|
|
"url":"/ajax/consult/qaNewConsult",
|
796
|
|
"type":"get",
|
797
|
|
"async": false,
|
798
|
|
"data":params,
|
799
|
|
"success":function(response){
|
800
|
|
if(response.success) {
|
801
|
|
if(response.data != null) {
|
802
|
|
var newConsultData = response["data"];
|
803
|
|
$("#myFlatConsultTime").attr("consultId",newConsultData["consultId"]);
|
804
|
|
$("#myFlatProName").text(newConsultData["professor"]["name"]);
|
805
|
|
if(newConsultData["professor"]["office"]) {
|
806
|
|
$("#myReplyProOffice").html(newConsultData["professor"]["office"]+",");
|
807
|
|
}
|
808
|
|
if(newConsultData["professor"]["title"]) {
|
809
|
|
$("#myReplyProTitle").html(newConsultData["professor"]["title"]);
|
810
|
|
}
|
811
|
|
if(newConsultData["professor"]["department"]) {
|
812
|
|
$("#myReplyProDepartment").html(newConsultData["professor"]["department"]+",");
|
813
|
|
}
|
814
|
|
if(newConsultData["professor"]["orgName"]) {
|
815
|
|
$("#myReplyProOrgName").html(newConsultData["professor"]["orgName"]);
|
816
|
|
}
|
817
|
|
if(newConsultData["professor"]["address"]) {
|
818
|
|
$("#myReplyAddress").html(newConsultData["professor"]["address"]);
|
819
|
|
}
|
820
|
|
$("#myFlatConsultTime").html(newConsultData["createTime"].substr(0,4) + "-" + newConsultData["createTime"].substr(4,2) + "-" + newConsultData["createTime"].substr(6,2) + " "
|
821
|
|
+ newConsultData["createTime"].substr(8,2)+ ":" +newConsultData["createTime"].substr(10,2));
|
822
|
|
$("#myFlatConsultTitle").html(newConsultData["consultTitle"]);
|
823
|
|
$("#myFlatConsultContent").html(newConsultData["consultContant"]);
|
824
|
|
if(response.data.professor.hasHeadImage){
|
825
|
|
$("#proImage").attr("src","images/head/"+response.data.professor.id+"_m.jpg");
|
826
|
|
}else{
|
827
|
|
$("#proImage").attr("src","images/default-photo.jpg");
|
828
|
|
}
|
829
|
|
}
|
830
|
|
else {
|
831
|
|
$("#wbcon1").empty("");
|
832
|
|
var height=$("#repalyf").height();
|
833
|
|
$("#wbcon1").append('<span id="wbcen">暂无最新咨询消息~~</span>').css("height",height);
|
834
|
|
var oHeight=($("#wbcon1").height()-$("#wbcen").height())/2;
|
835
|
|
var oWidth=($("#wbcon1").width()-$("#wbcen").width())/2;
|
836
|
|
$("#wbcen").css({"color":"#999","display":"inline-block","margin-top":oHeight,"margin-left":oWidth});
|
837
|
|
}
|
838
|
|
|
839
|
|
}
|
840
|
|
else {
|
841
|
|
$.MsgBox.Alert("消息","最新咨询数据请求失败");
|
842
|
|
}
|
843
|
|
|
844
|
|
},
|
845
|
|
"error":function(){
|
846
|
|
$.MsgBox.Alert('message','最新咨询数据请求失败');
|
847
|
|
}
|
848
|
|
|
849
|
|
})
|
850
|
|
}
|
851
|
|
|
852
|
|
|
853
|
|
function getReplyData(consultantId){
|
854
|
|
var params = {"consultantId":consultantId};
|
855
|
|
$.ajax({
|
856
|
|
"url":"/ajax/tidings/qaNewReply",
|
857
|
|
"type":"get",
|
858
|
|
"async": true,
|
859
|
|
"data":params,
|
860
|
|
"success":function(response){
|
861
|
|
if(response.success) {
|
862
|
|
if(response["data"] != null) {
|
863
|
|
var newReplyData = response["data"];
|
864
|
|
$("#myFlatRelpyTime").attr("consultId",newReplyData["consult"]["consultId"]);
|
865
|
|
$("#myFlatReplyProName").html(newReplyData["professor"]["name"]);
|
866
|
|
if(newReplyData["professor"]["office"]) {
|
867
|
|
$("#myProOffice").html(newReplyData["professor"]["office"]+",");
|
868
|
|
}
|
869
|
|
if(newReplyData["professor"]["title"]) {
|
870
|
|
$("#myProTitle").html(newReplyData["professor"]["title"]);
|
871
|
|
}
|
872
|
|
if(newReplyData["professor"]["department"]) {
|
873
|
|
$("#myProDepartment").html(newReplyData["professor"]["department"]+",");
|
874
|
|
}
|
875
|
|
if(newReplyData["professor"]["orgName"]) {
|
876
|
|
$("#myProOrgName").html(newReplyData["professor"]["orgName"]);
|
877
|
|
}
|
878
|
|
if(newReplyData["professor"]["address"]) {
|
879
|
|
$("#myAddress").html(newReplyData["professor"]["address"]);
|
880
|
|
}
|
881
|
|
$("#myFlatRelpyTime").html(newReplyData["createTime"].substr(0,4) + "-" + newReplyData["createTime"].substr(4,2) + "-" + newReplyData["createTime"].substr(6,2) + " "
|
882
|
|
+ newReplyData["createTime"].substr(8,2)+ ":" +newReplyData["createTime"].substr(10,2));
|
883
|
|
$("#myFlatRelpyTitle").html(newReplyData["consult"]["consultTitle"]);
|
884
|
|
|
885
|
|
$("#myFlatRelpyContent").html(newReplyData["tidingsContant"]);
|
886
|
|
if(response.data.professor.hasHeadImage){
|
887
|
|
$("#proreplayImage").attr("src","images/head/"+response.data.professor.id+"_m.jpg");
|
888
|
|
}else{
|
889
|
|
$("#proreplayImage").attr("src","images/default-photo.jpg");
|
890
|
|
}
|
891
|
|
}
|
892
|
|
else { $("#wbcon2").empty("")
|
893
|
|
var height=$("#wbcon1").height();
|
894
|
|
$("#wbcon2").append('<span id="wbcent">暂无最新回复消息~~</span>').css("height",height);
|
895
|
|
var oHeight=($("#wbcon2").height()+40-$("#wbcent").height())/2;
|
896
|
|
var oWidth=($("#wbcon2").width()-$("#wbcent").width())/2;
|
897
|
|
$("#wbcent").css({"color":"#999","display":"inline-block","margin-top":oHeight,"margin-left":oWidth});
|
898
|
|
}
|
899
|
|
|
900
|
|
}
|
901
|
|
else {
|
902
|
|
$.MsgBox.Alert('message','最新回复数据请求失败');
|
903
|
|
}
|
904
|
|
|
905
|
|
|
906
|
|
},
|
907
|
|
"error":function(){
|
908
|
|
$.MsgBox.Alert('message','最新回复数据请求失败');
|
909
|
|
}
|
910
|
|
|
911
|
|
})
|
912
|
|
}
|
913
|
|
|
914
|
|
|
915
|
|
//发送userid:用户id,container:获得内容的container
|
916
|
|
function newConsultSendFn(){
|
917
|
|
var consultId = $("#myFlatConsultTime").attr("consultId");
|
918
|
|
var consultCon = $("#myFlatConsultCon").val();
|
919
|
|
var params = {
|
920
|
|
"tidingsContant":consultCon,
|
921
|
|
"consultId":consultId,
|
922
|
|
"senderId":userid
|
923
|
|
}
|
924
|
|
$.ajax({
|
925
|
|
url:"/ajax/tidings",
|
926
|
|
type:"post",
|
927
|
|
async:true,
|
928
|
|
"contentType" : "application/x-www-form-urlencoded",
|
929
|
|
data:params,
|
930
|
|
success:function(response){
|
931
|
|
getConsultData(userid);
|
932
|
|
},
|
933
|
|
error:function(error){
|
934
|
|
|
935
|
|
}
|
936
|
|
|
937
|
|
});
|
938
|
|
|
939
|
|
$("#myFlatConsultCon").val("");
|
940
|
|
};
|
941
|
|
|
942
|
|
function newReplySendFn(){
|
943
|
|
var consultId = $("#myFlatRelpyTime").attr("consultId");
|
944
|
|
var consultCon = $("#myFlatReplyCon").val();
|
945
|
|
var params = {
|
946
|
|
"tidingsContant":consultCon,
|
947
|
|
"consultId":consultId,
|
948
|
|
"senderId":userid
|
949
|
|
}
|
950
|
|
$.ajax({
|
951
|
|
url:"/ajax/tidings",
|
952
|
|
type:"post",
|
953
|
|
async:false,
|
954
|
|
"contentType" : "application/x-www-form-urlencoded",
|
955
|
|
data:params,
|
956
|
|
success:function(response){
|
957
|
|
getReplyData(userid);
|
958
|
|
},
|
959
|
|
error:function(error){
|
960
|
|
|
961
|
|
}
|
962
|
|
|
963
|
|
});
|
964
|
|
// $.MsgBox.Alert("消息","回复成功!");
|
965
|
|
$("#myFlatReplyCon").val("");
|
966
|
|
};
|
967
|
|
|
968
|
|
|
969
|
|
|
970
|
|
|
971
|
|
|
972
|
|
});
|
973
|
|
|
|
1
|
$(function(){
|
|
2
|
var userid = $.cookie("userid");
|
|
3
|
var lookall;
|
|
4
|
|
|
5
|
//获取专家的数据
|
|
6
|
function getProfessorData(professorId){
|
|
7
|
$.ajax({
|
|
8
|
"url":"/ajax/professor/editBaseInfo/"+professorId,
|
|
9
|
"type":"get",
|
|
10
|
"async": true,
|
|
11
|
"success":function(data) {
|
|
12
|
if(data.success)
|
|
13
|
{
|
|
14
|
$("#nameS").text(data.data.name);
|
|
15
|
$("#allConsultCount").text(data.data.consultCount);
|
|
16
|
if(data.data.authentication){
|
|
17
|
$(".modifyicon")[0].src="/images/onauth.png"
|
|
18
|
}
|
|
19
|
else{
|
|
20
|
$(".modifyicon")[0].src="/images/icon-unauth.png";
|
|
21
|
|
|
22
|
}
|
|
23
|
if(data.data.office) {
|
|
24
|
$("#office").text(data.data.office+",");
|
|
25
|
}
|
|
26
|
if(data.data.title) {
|
|
27
|
$("#title").text(data.data.title+",");
|
|
28
|
}
|
|
29
|
if(data.data.department) {
|
|
30
|
$("#department").text(data.data.department+",");
|
|
31
|
}
|
|
32
|
if(data.data.orgName) {
|
|
33
|
$("#organization").text(data.data.orgName);
|
|
34
|
}
|
|
35
|
if(data.data.address) {
|
|
36
|
$("#address").text(data.data.address);
|
|
37
|
}
|
|
38
|
if(data.data.hasHeadImage) {
|
|
39
|
$(".imgProfess").attr("src","/images/head/"+userid+"_l.jpg");
|
|
40
|
}
|
|
41
|
else
|
|
42
|
{
|
|
43
|
$(".imgProfess").attr("src","/images/default-photo.jpg");
|
|
44
|
}
|
|
45
|
var startLeval=parseInt(data.data.starLevel);
|
|
46
|
for(var i=0;i<startLeval;i++) {
|
|
47
|
$(".evastar2").eq(i).addClass("startStyle");
|
|
48
|
}
|
|
49
|
}
|
|
50
|
else
|
|
51
|
{
|
|
52
|
$.MsgBox.Alert("消息","获取专家数据失败!");
|
|
53
|
}
|
|
54
|
},
|
|
55
|
"error":function(){$.MsgBox.Alert('message','获取专家数据失败')}
|
|
56
|
})
|
|
57
|
}
|
|
58
|
getProfessorData(userid);
|
|
59
|
getRecentlyData();
|
|
60
|
$("#allResource,#worklinkre").on("click",function(){
|
|
61
|
$(".worksubmenu").eq(1).addClass("subcolor").siblings().removeClass("subcolor");
|
|
62
|
$.ajax({
|
|
63
|
"url":"newsciresource.html",
|
|
64
|
"dataType":"html",
|
|
65
|
"success":function(result){
|
|
66
|
$(".workcon").html(result);
|
|
67
|
if(reNO==false&&opNO)
|
|
68
|
{
|
|
69
|
$(".workmysrc1").eq(1).show().siblings().hide();
|
|
70
|
$(".worksamlltit").eq(1).addClass("worksamlltitnow").siblings().removeClass("worksamlltitnow");
|
|
71
|
}
|
|
72
|
}
|
|
73
|
})
|
|
74
|
})
|
|
75
|
//获取最近3次的申请
|
|
76
|
function getRecentlyData(){
|
|
77
|
$.ajax({
|
|
78
|
"url":"/ajax/operation/pqpro",
|
|
79
|
"type":"get",
|
|
80
|
"data":{"id":userid,"pageSize":4},
|
|
81
|
"async": false,
|
|
82
|
"success":function(data)
|
|
83
|
{
|
|
84
|
if(data.success)
|
|
85
|
{
|
|
86
|
$(".sharesrcbox11").html("");
|
|
87
|
|
|
88
|
for(var i=0;i<data.data.data.length;i++)
|
|
89
|
{
|
|
90
|
data.data.data[i].createTime=changeTime(data.data.data[i].createTime);
|
|
91
|
var stringContent="";
|
|
92
|
if(userid==data.data.data[i].professor.id)
|
|
93
|
{
|
|
94
|
stringContent +='<div class="sharesrc replySide" 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+' flag=1>'
|
|
95
|
}
|
|
96
|
else
|
|
97
|
{
|
|
98
|
stringContent +='<div class="sharesrc replySide" 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+' flag=0>'
|
|
99
|
}
|
|
100
|
stringContent +='<div class="shareshow"><img src="" width="186" height="186"class="resourceImage"></div>'
|
|
101
|
stringContent +='<div class="shareshow"><p>资源名称:'+data.data.data[i].resource.resourceName+'</p>'
|
|
102
|
if(userid==data.data.data[i].professor.id)
|
|
103
|
{
|
|
104
|
stringContent +='<p>合作对象:'+data.data.data[i].resource.professor.name+'</p>'
|
|
105
|
}
|
|
106
|
else{
|
|
107
|
stringContent +='<p>合作对象:'+data.data.data[i].professor.name+'</p>'
|
|
108
|
}
|
|
109
|
stringContent +='<p>最新动态:</p>'
|
|
110
|
stringContent +='<p class="statuswork"></p></div>'
|
|
111
|
stringContent +='</div>'
|
|
112
|
var $stringContent=$(stringContent)
|
|
113
|
$(".sharesrcbox11").append($stringContent);
|
|
114
|
if(data.data.data[i].resource.images.length){
|
|
115
|
$stringContent.find(".resourceImage").attr("src","/images/resource/"+data.data.data[i].resource.resourceId+".jpg");
|
|
116
|
}
|
|
117
|
else{
|
|
118
|
$stringContent.find(".resourceImage").attr("src","/images/default-resource.jpg");
|
|
119
|
}
|
|
120
|
|
|
121
|
//console.log(data.data.data[i].resource.supportedServices);
|
|
122
|
if(userid==data.data.data[i].professor.id)
|
|
123
|
{
|
|
124
|
switch(data.data.data[i].operationStatus)
|
|
125
|
{
|
|
126
|
case 1:
|
|
127
|
var string='<span title="修改申请">申请已发送,待'+data.data.data[i].resource.professor.name+'确认</span><br/>'
|
|
128
|
$(".statuswork").eq(i).html(string);
|
|
129
|
break;
|
|
130
|
case 2:
|
|
131
|
var string='<span>'+data.data.data[i].resource.professor.name+'发来报价,回复报价</span><br/>'
|
|
132
|
$(".statuswork").eq(i).html(string);
|
|
133
|
break;
|
|
134
|
case 3:
|
|
135
|
var string='<span>合作进行中,查看详情</span><br/>'
|
|
136
|
$(".statuswork").eq(i).html(string);
|
|
137
|
break;
|
|
138
|
case 4:
|
|
139
|
var string='<span>中止合作,查看详情</span><br/>'
|
|
140
|
$(".statuswork").eq(i).html(string);
|
|
141
|
break;
|
|
142
|
case 5:
|
|
143
|
var string='<span>'+data.data.data[i].resource.professor.name+'拒绝合作,合作结束,查看详情</span><br/>'
|
|
144
|
$(".statuswork").eq(i).html(string);
|
|
145
|
break;
|
|
146
|
case 6:
|
|
147
|
var string='<span>本人中止合作,查看详情</span><br/>'
|
|
148
|
$(".statuswork").eq(i).html(string);
|
|
149
|
break;
|
|
150
|
case 7:
|
|
151
|
var string='<span>合作进行中,查看详情</span><br/>'
|
|
152
|
$(".statuswork").eq(i).html(string);
|
|
153
|
break;
|
|
154
|
case 8:
|
|
155
|
var string='<span>完成,查看详情</span><br/>'
|
|
156
|
$(".statuswork").eq(i).html(string);
|
|
157
|
break;
|
|
158
|
default:
|
|
159
|
}
|
|
160
|
}
|
|
161
|
else
|
|
162
|
{
|
|
163
|
switch(data.data.data[i].operationStatus)
|
|
164
|
{
|
|
165
|
case 1:
|
|
166
|
var string='<span>'+data.data.data[i].professor.name+'</span> <span>发来了</span><span>新的申请</span>'
|
|
167
|
$(".statuswork").eq(i).html(string);
|
|
168
|
break;
|
|
169
|
case 2:
|
|
170
|
var string='<span>发送报价待'+data.data.data[i].professor.name+'确认,修改报价</span><br/>';
|
|
171
|
$(".statuswork").eq(i).html(string);
|
|
172
|
break;
|
|
173
|
case 3:
|
|
174
|
var string='<span>'+data.data.data[i].professor.name+'发来报价,合作进行中,查看详情</span><br/>'
|
|
175
|
$(".statuswork").eq(i).html(string);
|
|
176
|
break;
|
|
177
|
case 4:
|
|
178
|
var string='<span>'+data.data.data[i].professor.name+'拒绝报价,合作结束,查看详情</span><br/>'
|
|
179
|
$(".statuswork").eq(i).html(string);
|
|
180
|
break;
|
|
181
|
case 5:
|
|
182
|
var string='<span>本人拒绝合作,查看详情</span><br/>'
|
|
183
|
$(".statuswork").eq(i).html(string);
|
|
184
|
break;
|
|
185
|
case 6:
|
|
186
|
var string='<span>'+data.data.data[i].professor.name+'中止合作合作结束,查看详情</span><br/>'
|
|
187
|
$(".statuswork").eq(i).html(string);
|
|
188
|
break;
|
|
189
|
case 7:
|
|
190
|
var string='<span>合作进行中,查看详情</span><br/>'
|
|
191
|
$(".statuswork").eq(i).html(string);
|
|
192
|
break;
|
|
193
|
case 8:
|
|
194
|
var string='<span>完成,查看详情</span><br/>'
|
|
195
|
$(".statuswork").eq(i).html(string);
|
|
196
|
break;
|
|
197
|
default:
|
|
198
|
}
|
|
199
|
}
|
|
200
|
|
|
201
|
}
|
|
202
|
}
|
|
203
|
else
|
|
204
|
{
|
|
205
|
alert("系统异常!");
|
|
206
|
}
|
|
207
|
},
|
|
208
|
"error":function(){$.MsgBox.Alert('message','fail111')}
|
|
209
|
});
|
|
210
|
}
|
|
211
|
//根据不同的状态进行操作回复或者查看详情
|
|
212
|
$(".sharesrcbox11").on("click",".replySide",function(){
|
|
213
|
var operationId=$(this).attr("operationId");
|
|
214
|
var operationStatus=$(this).attr("operationStatus");
|
|
215
|
var priceDifference=$(this).attr("dealPrice");
|
|
216
|
var flag=$(this).attr("flag");
|
|
217
|
var resourceId=$(this).attr("resourId");
|
|
218
|
opo=operationId;
|
|
219
|
if(flag==0&&operationStatus==1)
|
|
220
|
{ ResourceApply();
|
|
221
|
ajaxGet(operationId);
|
|
222
|
$(".dealTime").replaceWith("<span class='dealTime'></span>");
|
|
223
|
$(".detail").replaceWith("<span class='detail'></span>");
|
|
224
|
$("select").replaceWith("<span class='sname'></span>")
|
|
225
|
$(".btnboxdown").css({"display":"none"});
|
|
226
|
$(".applysure").css({"display":"none"});
|
|
227
|
$("#nextStep").click(function(){
|
|
228
|
$(".stateinfor span").text("报价中");
|
|
229
|
$(".btnboxup").css({"display":"none"});
|
|
230
|
$(".btnboxdown").css({"display":"block"});
|
|
231
|
$(".applysure").css({"display":"block"});
|
|
232
|
$(".bag").css("display","none");
|
|
233
|
$(".frm").click(function(){
|
|
234
|
var $date = {};
|
|
235
|
$date.detailDemand=$(".detail").text();
|
|
236
|
$date.deliverTime=replaceStr($.trim($(".dealTime").text()));
|
|
237
|
$date.dealPrice =$("#dealPrice").val();
|
|
238
|
$date.payMethod = $("#payMethod").val();
|
|
239
|
$date.replyNotes = $("#consultContent").val();
|
|
240
|
$date.applysquare = $(".sname").text();
|
|
241
|
$date.operationId=operationId;
|
|
242
|
$date.operationStatus=2;
|
|
243
|
$.ajax({
|
|
244
|
"url" : "/ajax/operation",
|
|
245
|
"type" : "put",
|
|
246
|
"data" :JSON.stringify($date),
|
|
247
|
"contentType" :"application/json",
|
|
248
|
"success" : function(data) {
|
|
249
|
if (data.success) {
|
|
250
|
$(".blackcover").remove();
|
|
251
|
$("body").css("position","static");
|
|
252
|
getRecentlyData();
|
|
253
|
$.MsgBox.Alert('message',"报价成功");
|
|
254
|
} else {
|
|
255
|
$.MsgBox.Alert('message',data.msg);
|
|
256
|
}
|
|
257
|
},
|
|
258
|
"beforeSend":function(){
|
|
259
|
//console.log(this.data);
|
|
260
|
},
|
|
261
|
});
|
|
262
|
})
|
|
263
|
|
|
264
|
})
|
|
265
|
$("#refuses").click(function(){
|
|
266
|
ResourceApply();
|
|
267
|
ajaxGet(operationId);
|
|
268
|
n=5;
|
|
269
|
$(".blackcover").remove();
|
|
270
|
$("body").css("position","static");
|
|
271
|
$.MsgBox.Confirm("消息", "确定拒绝吗?",upStatus1);
|
|
272
|
});
|
|
273
|
}
|
|
274
|
if(flag==0&&operationStatus==2){
|
|
275
|
ResourceApply();
|
|
276
|
ajaxGet(operationId);
|
|
277
|
$(".dealTime").replaceWith("<span class='dealTime'></span>");
|
|
278
|
$(".detail").replaceWith("<span class='detail'></span>");
|
|
279
|
$("select").replaceWith("<span class='sname'></span>")
|
|
280
|
$(".btnboxdown").css({"display":"none"});
|
|
281
|
$(".applysure").css({"display":"none"});
|
|
282
|
$(".stateinfor span").text("修改报价中");
|
|
283
|
$(".btnboxup").css({"display":"none"});
|
|
284
|
$(".btnboxdown").css({"display":"block"});
|
|
285
|
$(".applysure").css({"display":"block"});
|
|
286
|
$(".bag").css("display","none");
|
|
287
|
$(".frm").click(function(){
|
|
288
|
var $date = {};
|
|
289
|
$date.detailDemand=$(".detail").text();
|
|
290
|
$date.deliverTime=replaceStr($.trim($(".dealTime").text()));
|
|
291
|
$date.dealPrice = $("#dealPrice").val();
|
|
292
|
$date.payMethod = $("#payMethod").val();
|
|
293
|
$date.replyNotes = $("#consultContent").val();
|
|
294
|
$date.applysquare = $(".sname").text();
|
|
295
|
$date.operationId=operationId;
|
|
296
|
$date.operationStatus=2;
|
|
297
|
$.ajax({
|
|
298
|
"url" : "/ajax/operation",
|
|
299
|
"type" : "put",
|
|
300
|
"data" :JSON.stringify($date),
|
|
301
|
"contentType" :"application/json",
|
|
302
|
"success" : function(data) {
|
|
303
|
if (data.success) {
|
|
304
|
$(".blackcover").remove();
|
|
305
|
$("body").css("position","static");
|
|
306
|
getRecentlyData();
|
|
307
|
$.MsgBox.Alert('message',"报价成功");
|
|
308
|
} else {
|
|
309
|
$.MsgBox.Alert('message',data.msg);
|
|
310
|
}
|
|
311
|
},
|
|
312
|
"beforeSend":function(){
|
|
313
|
//console.log(this.data);
|
|
314
|
},
|
|
315
|
});
|
|
316
|
})
|
|
317
|
}
|
|
318
|
if(flag==0&&operationStatus==3){
|
|
319
|
|
|
320
|
DetailInfo();
|
|
321
|
$("#totalPrice").text(priceDifference);
|
|
322
|
$(".liuyaninfo").css("display","none");
|
|
323
|
$(".pingjiainfo").css("display","none");
|
|
324
|
$(".filebox").css("display","none");
|
|
325
|
ajaxGet1(operationId);
|
|
326
|
$(".payaddbox1").css("display","none");
|
|
327
|
|
|
328
|
discussGetPaidMoney(operationId,priceDifference)
|
|
329
|
}
|
|
330
|
if(flag==0&&operationStatus==4){
|
|
331
|
ResourceApply();
|
|
332
|
ajaxGet1(operationId);
|
|
333
|
$(".dealTime").replaceWith("<span class='dealTime'></span>");
|
|
334
|
$(".detail").replaceWith("<span class='detail'></span>");
|
|
335
|
$("select").replaceWith("<span class='sname'></span>")
|
|
336
|
$(".btnboxdown").css({"display":"none"});
|
|
337
|
$(".applysure").css({"display":"none"});
|
|
338
|
$(".stateinfor span").text("详情");
|
|
339
|
$(".btnboxup").css({"display":"none"});
|
|
340
|
$(".btnboxdown").css({"display":"block"});
|
|
341
|
$(".applysure").css({"display":"block"});
|
|
342
|
$(".bag").css("display","none");
|
|
343
|
$(".addrebtn").css("display","none");
|
|
344
|
$("#payMethod").replaceWith("<span id='payMethod'><span>");
|
|
345
|
$("#dealPrice").replaceWith("<span id='dealPrice'><span>");
|
|
346
|
$("#consultContent").replaceWith("<span id='consultContent'><span>");
|
|
347
|
}
|
|
348
|
if(flag==0&&operationStatus==5){
|
|
349
|
ResourceApply();
|
|
350
|
ajaxGet(operationId);
|
|
351
|
$(".dealTime").replaceWith("<span class='dealTime'></span>");
|
|
352
|
$(".detail").replaceWith("<span class='detail'></span>");
|
|
353
|
$("select").replaceWith("<span class='sname'></span>")
|
|
354
|
$(".btnboxdown").css({"display":"none"});
|
|
355
|
$(".applysure").css({"display":"none"});
|
|
356
|
$(".addrebtn").css("display","none");
|
|
357
|
}
|
|
358
|
if(flag==0&&operationStatus==6){
|
|
359
|
|
|
360
|
DetailInfo();
|
|
361
|
$("#totalPrice").text(priceDifference);
|
|
362
|
$(".liuyaninfo").css("display","none");
|
|
363
|
$(".pingjiainfo").css("display","none");
|
|
364
|
$(".filebox").css("display","none");
|
|
365
|
ajaxGet1(operationId);
|
|
366
|
$(".payaddbox1").css("display","none");
|
|
367
|
discussGetPaidMoney(operationId,priceDifference)
|
|
368
|
}
|
|
369
|
if(flag==0&&operationStatus==7){
|
|
370
|
|
|
371
|
DetailInfo();
|
|
372
|
$("#totalPrice").text(priceDifference);
|
|
373
|
$(".liuyaninfo").css("display","none");
|
|
374
|
$(".pingjiainfo").css("display","none");
|
|
375
|
$(".filebox").css("display","none");
|
|
376
|
ajaxGet1(operationId);
|
|
377
|
$(".payaddbox1").css("display","none");
|
|
378
|
discussGetPaidMoney(operationId,priceDifference)
|
|
379
|
}
|
|
380
|
if(flag==0&&operationStatus==8){
|
|
381
|
|
|
382
|
DetailInfo();
|
|
383
|
$("#totalPrice").text(priceDifference);
|
|
384
|
$(".liuyaninfo").css("display","none");
|
|
385
|
$(".pingjiainfo").css("display","none");
|
|
386
|
$(".filebox").css("display","none");
|
|
387
|
ajaxGet1(operationId);
|
|
388
|
$(".payaddbox1").css("display","none");
|
|
389
|
discussGetPaidMoney(operationId,priceDifference)
|
|
390
|
}
|
|
391
|
if(flag==1&&operationStatus==1)
|
|
392
|
{
|
|
393
|
ResourceApply();
|
|
394
|
$(".limitBox").removeClass("limitBox");
|
|
395
|
$(".limitwords").removeClass("limitwords");
|
|
396
|
$(".limitwordbox").removeClass("limitwordbox");
|
|
397
|
|
|
398
|
$( "#datepicker" ).datepicker({ "dateFormat":" yy-mm-dd"});
|
|
399
|
|
|
400
|
$(".stateinfor span").text("修改申请中");
|
|
401
|
$(".btnboxup").css({"display":"none"});
|
|
402
|
$(".applysure").css({"display":"none"});
|
|
403
|
ajaxGet(operationId,1,1);
|
|
404
|
getIdentity(userid);
|
|
405
|
//if($(".dealTime").val()!=""&&$(".detail").val()!="")
|
|
406
|
//{
|
|
407
|
$("#deliver").on("click",function()
|
|
408
|
{
|
|
409
|
var $data = {};
|
|
410
|
$data.demandId = userid;
|
|
411
|
$data.resourceId = resourceId;
|
|
412
|
$data.operationId=operationId;
|
|
413
|
$data.detailDemand=$(".detail").val();
|
|
414
|
$data.deliverTime=replaceStr($.trim($("#datepicker").val()));
|
|
415
|
$data.applysquare=$("select option:selected").val();
|
|
416
|
$data.operationStatus=1;
|
|
417
|
$.ajax({
|
|
418
|
"url" : "/ajax/operation",
|
|
419
|
"type" : "put",
|
|
420
|
"success" : function(rdata){
|
|
421
|
if (rdata.success){
|
|
422
|
getRecentlyData();
|
|
423
|
$(".blackcover").remove();
|
|
424
|
$("body").css("position","static");
|
|
425
|
$.MsgBox.Alert('消息',"资源申请信息修改成功");
|
|
426
|
} else {
|
|
427
|
$.MsgBox.Alert('消息',"资源申请信息修改失败");
|
|
428
|
}
|
|
429
|
},
|
|
430
|
"data" : JSON.stringify($data) ,
|
|
431
|
"contentType" :"application/json",
|
|
432
|
dataType : "json"
|
|
433
|
});
|
|
434
|
});
|
|
435
|
//}
|
|
436
|
|
|
437
|
}
|
|
438
|
if(flag==1&&operationStatus==2)
|
|
439
|
{
|
|
440
|
ResourceApply();
|
|
441
|
ajaxGet1(operationId);
|
|
442
|
$(".dealTime").replaceWith("<span class='dealTime'></span>");
|
|
443
|
$(".detail").replaceWith("<span class='detail'></span>");
|
|
444
|
$("select").replaceWith("<span class='sname'></span>")
|
|
445
|
$(".btnboxdown").css({"display":"none"});
|
|
446
|
$(".applysure").css({"display":"none"});
|
|
447
|
$(".stateinfor span").text("回复报价中");
|
|
448
|
$(".btnboxup").css({"display":"none"});
|
|
449
|
$(".btnboxdown").css({"display":"block"});
|
|
450
|
$(".applysure").css({"display":"block"});
|
|
451
|
$(".bag").css("display","none");
|
|
452
|
$(".sendpri").text("");
|
|
453
|
$("#payMethod").replaceWith("<span id='payMethod'><span>");
|
|
454
|
$("#dealPrice").replaceWith("<span id='dealPrice'><span>");
|
|
455
|
$("#consultContent").replaceWith("<span id='consultContent'><span>");
|
|
456
|
$(".frm")[0].value="直接拒绝";
|
|
457
|
$("#cooperation")[0].value="合作";
|
|
458
|
$(".frm").click(function(){
|
|
459
|
n=4;
|
|
460
|
$(".blackcover").remove();
|
|
461
|
$("body").css("position","static");
|
|
462
|
$.MsgBox.Confirm("消息", "确定继续吗?",upStatus1);
|
|
463
|
})
|
|
464
|
$("#cooperation").click(function(){
|
|
465
|
n=3;
|
|
466
|
$(".blackcover").remove();
|
|
467
|
$("body").css("position","static");
|
|
468
|
upStatus1();
|
|
469
|
})
|
|
470
|
}
|
|
471
|
if(flag==1&&operationStatus==3){
|
|
472
|
DetailInfo();
|
|
473
|
//console.log(priceDifference);
|
|
474
|
$("#totalPrice").text(priceDifference);
|
|
475
|
$(".liuyaninfo").css("display","none");
|
|
476
|
$(".pingjiainfo").css("display","none");
|
|
477
|
$(".filebox").css("display","none");
|
|
478
|
ajaxGet1(operationId);
|
|
479
|
$(".payaddbox1").css("display","none");
|
|
480
|
discussGetPaidMoney(operationId,priceDifference);
|
|
481
|
}
|
|
482
|
if(flag==1&&operationStatus==4){
|
|
483
|
ResourceApply();
|
|
484
|
ajaxGet1(operationId);
|
|
485
|
$(".dealTime").replaceWith("<span class='dealTime'></span>");
|
|
486
|
$(".detail").replaceWith("<span class='detail'></span>");
|
|
487
|
$("select").replaceWith("<span class='sname'></span>")
|
|
488
|
$(".btnboxdown").css({"display":"none"});
|
|
489
|
$(".applysure").css({"display":"none"});
|
|
490
|
$(".sendpri").text("");
|
|
491
|
$(".stateinfor span").text("详情");
|
|
492
|
$(".resde").text("详情页面");
|
|
493
|
$(".btnboxup").css({"display":"none"});
|
|
494
|
$(".btnboxdown").css({"display":"block"});
|
|
495
|
$(".applysure").css({"display":"block"});
|
|
496
|
$(".bag").css("display","none");
|
|
497
|
$(".addrebtn").css("display","none");
|
|
498
|
$("#payMethod").replaceWith("<span id='payMethod'><span>");
|
|
499
|
$("#dealPrice").replaceWith("<span id='dealPrice'><span>");
|
|
500
|
$("#consultContent").replaceWith("<span id='consultContent'><span>");
|
|
501
|
}
|
|
502
|
if(flag==1&&operationStatus==5){
|
|
503
|
ResourceApply();
|
|
504
|
ajaxGet(operationId);
|
|
505
|
$(".stateinfor").find("span").text("合作结束");
|
|
506
|
$(".dealTime").replaceWith("<span class='dealTime'></span>");
|
|
507
|
$(".detail").replaceWith("<span class='detail'></span>");
|
|
508
|
$("select").replaceWith("<span class='sname'></span>")
|
|
509
|
$(".btnboxdown").css({"display":"none"});
|
|
510
|
$(".applysure").css({"display":"none"});
|
|
511
|
//$(".resouinfotype2").text("");
|
|
512
|
$(".addrebtn").css("display","none");
|
|
513
|
}
|
|
514
|
if(flag==1&&operationStatus==6){
|
|
515
|
DetailInfo();
|
|
516
|
$("#totalPrice").text(priceDifference);
|
|
517
|
$(".filebox").css("display","none");
|
|
518
|
$(".liuyaninfo").css("display","none");
|
|
519
|
$(".pingjiainfo").css("display","none");
|
|
520
|
$(".filebox").css("display","none");
|
|
521
|
ajaxGet1(operationId);
|
|
522
|
$(".payaddbox1").css("display","none");
|
|
523
|
discussGetPaidMoney(operationId,priceDifference)
|
|
524
|
}
|
|
525
|
if(flag==1&&operationStatus==7){
|
|
526
|
DetailInfo();
|
|
527
|
$("#totalPrice").text(priceDifference);
|
|
528
|
$(".liuyaninfo").css("display","none");
|
|
529
|
$(".pingjiainfo").css("display","none");
|
|
530
|
$(".filebox").css("display","none");
|
|
531
|
ajaxGet1(operationId);
|
|
532
|
$(".payaddbox1").css("display","none");
|
|
533
|
discussGetPaidMoney(operationId,priceDifference)
|
|
534
|
}
|
|
535
|
if(flag==1&&operationStatus==8){
|
|
536
|
DetailInfo();
|
|
537
|
$("#totalPrice").text(priceDifference);
|
|
538
|
$(".liuyaninfo").css("display","none");
|
|
539
|
$(".pingjiainfo").css("display","none");
|
|
540
|
$(".filebox").css("display","none");
|
|
541
|
ajaxGet1(operationId);
|
|
542
|
$(".payaddbox1").css("display","none");
|
|
543
|
discussGetPaidMoney(operationId,priceDifference)
|
|
544
|
}
|
|
545
|
})
|
|
546
|
|
|
547
|
function ajaxGet(operationId,o,p){
|
|
548
|
$.ajax({
|
|
549
|
"url":"/ajax/operation/"+operationId,
|
|
550
|
"type":"get",
|
|
551
|
"async": true,
|
|
552
|
"success":function(data){
|
|
553
|
if(data.success)
|
|
554
|
{
|
|
555
|
$(".log").text(data.data.resource.resourceName);
|
|
556
|
$(".timelog").text(changeTime(data.data.createTime));
|
|
557
|
$(".contration").text(data.data.operationId);
|
|
558
|
$(".detail").text(data.data.detailDemand);
|
|
559
|
if(o==1&&p==1){
|
|
560
|
$(".dealTime").val(changeTime(data.data.deliverTime));
|
|
561
|
}else{
|
|
562
|
$(".dealTime").text(changeTime(data.data.deliverTime));
|
|
563
|
}
|
|
564
|
if(data.data.professor.name==data.data.applysquare){
|
|
565
|
$("select").find("option[title=个人]").attr("selected",true);
|
|
566
|
}else{
|
|
567
|
$("select").find("option[title=所属机构]").attr("selected",true);
|
|
568
|
}
|
|
569
|
$(".sname").text(data.data.applysquare);
|
|
570
|
$(".namecon").text(data.data.resource.professor.name);
|
|
571
|
$(".resouImage").attr("src","/images/resource/"+data.data.resource.resourceId+".jpg");
|
|
572
|
$(".resouImage").load(function(){})
|
|
573
|
.error(function(){
|
|
574
|
$(this).attr("src","/images/default-resource.jpg");
|
|
575
|
});
|
|
576
|
|
|
577
|
if(data.data.payMethod){
|
|
578
|
$("#payMethod").val(data.data.payMethod);
|
|
579
|
}
|
|
580
|
if(data.data.dealPrice){
|
|
581
|
$("#dealPrice").val(data.data.dealPrice);
|
|
582
|
}
|
|
583
|
if(data.data.replyNotes){
|
|
584
|
$("#consultContent").val(data.data.replyNotes);
|
|
585
|
}
|
|
586
|
}
|
|
587
|
else
|
|
588
|
{
|
|
589
|
//console.log("系统异常!");
|
|
590
|
}
|
|
591
|
},
|
|
592
|
"error":function(){$.MsgBox.Alert('message','failddd')}
|
|
593
|
});
|
|
594
|
}
|
|
595
|
function upStatus1(){
|
|
596
|
$.ajax({"url" : "/ajax/operation/operationStatus",
|
|
597
|
"type" : "POST",
|
|
598
|
"success" : function(rdata)
|
|
599
|
{
|
|
600
|
if (rdata.success)
|
|
601
|
{
|
|
602
|
getRecentlyData();
|
|
603
|
}
|
|
604
|
else
|
|
605
|
{
|
|
606
|
$.MsgBox.Alert('message','状态更新失败');
|
|
607
|
}
|
|
608
|
},
|
|
609
|
"data" :{"operationId":opo,"operationStatus":n},
|
|
610
|
"beforeSend":function(){/*console.log(this.data)*/},
|
|
611
|
"contentType" :"application/x-www-form-urlencoded",
|
|
612
|
dataType : "json"
|
|
613
|
});
|
|
614
|
}
|
|
615
|
function ajaxGet1(operationId){
|
|
616
|
$.ajax({
|
|
617
|
"url":"/ajax/operation/"+operationId,
|
|
618
|
"type":"get",
|
|
619
|
"async": true,
|
|
620
|
"success":function(data){
|
|
621
|
if(data.success)
|
|
622
|
{
|
|
623
|
$(".log").text(data.data.resource.resourceName);
|
|
624
|
$(".timelog").text(changeTime(data.data.createTime));
|
|
625
|
$(".contration").text(data.data.operationId);
|
|
626
|
$(".detail").text(data.data.detailDemand);
|
|
627
|
$(".dealTime").text(changeTime(data.data.deliverTime));
|
|
628
|
$(".namecon").text(data.data.resource.professor.name);
|
|
629
|
$(".sname").text(data.data.applysquare);
|
|
630
|
$(".resouImage").attr("src","/images/resource/"+data.data.resource.resourceId+".jpg");
|
|
631
|
$(".resouImage").load(function(){})
|
|
632
|
.error(function(){
|
|
633
|
$(this).attr("src","/images/default-resource.jpg");
|
|
634
|
});
|
|
635
|
if(data.data.payMethod){
|
|
636
|
$("#payMethod").text(data.data.payMethod);
|
|
637
|
}
|
|
638
|
if(data.data.dealPrice){
|
|
639
|
$("#dealPrice").text(data.data.dealPrice);
|
|
640
|
}
|
|
641
|
if(data.data.replyNotes){
|
|
642
|
$("#consultContent").text(data.data.replyNotes);
|
|
643
|
}
|
|
644
|
}
|
|
645
|
else
|
|
646
|
{
|
|
647
|
//console.log("系统异常!");
|
|
648
|
}
|
|
649
|
},
|
|
650
|
"error":function(){$.MsgBox.Alert('message','failddd')}
|
|
651
|
});
|
|
652
|
}
|
|
653
|
function discussGetPaidMoney(operationId,priceDifference){
|
|
654
|
var realCharge=0,balance=0;
|
|
655
|
$.ajax({
|
|
656
|
"url":"/ajax/payhistory/qadetail",
|
|
657
|
"type":"get",
|
|
658
|
"async": true,
|
|
659
|
"data":{"operationId":operationId},
|
|
660
|
"success":function(data){
|
|
661
|
if(data.success){
|
|
662
|
var popHtml="";
|
|
663
|
var $data=data.data;
|
|
664
|
var m;
|
|
665
|
for(var i=0;i<$data.length;i++){
|
|
666
|
|
|
667
|
PopHtml = '<tr class="payitem">';
|
|
668
|
PopHtml += '<td><div class="resouinforcon">'+changeTime($data[i].createTime)+'</div></td>';
|
|
669
|
PopHtml += '<td><div class="resouinforcon">'+$data[i].professor.name+'</div></td>';
|
|
670
|
PopHtml += '<td><div class="resouinforcon resou"></div></td>';
|
|
671
|
PopHtml += '<td><div class="resouinforcon to"></div></td>';
|
|
672
|
PopHtml += '<td><div class="resouinforcon resta"></div></td>';
|
|
673
|
PopHtml += '<td><div class="resouinforcon">'+$data[i].remark+'</div></td>';
|
|
674
|
PopHtml += '</tr>';
|
|
675
|
$("#paytit").append(PopHtml);
|
|
676
|
if($data[i].paidMoney==undefined)
|
|
677
|
{
|
|
678
|
$data[i].paidMoney=0;
|
|
679
|
}
|
|
680
|
if($data[i].returnMoney==undefined)
|
|
681
|
{
|
|
682
|
$data[i].returnMoney=0;
|
|
683
|
}
|
|
684
|
m=$data[i].paidMoney-$data[i].returnMoney;
|
|
685
|
$(".to").eq(i).text(m);
|
|
686
|
if($data[i].payType==0){
|
|
687
|
$(".resou").eq(i).text("线下支付");
|
|
688
|
}else{
|
|
689
|
$(".resou").eq(i).text("线上支付");
|
|
690
|
}
|
|
691
|
if($data[i].payStatus==0){
|
|
692
|
$(".resta").eq(i).text("未确认");
|
|
693
|
}else{
|
|
694
|
$(".resta").eq(i).text("确认收款");
|
|
695
|
}
|
|
696
|
popHtml="";
|
|
697
|
realCharge+=m;
|
|
698
|
}
|
|
699
|
balance=priceDifference-realCharge;
|
|
700
|
$("#balance").text(balance);
|
|
701
|
$("#realCharge").text(realCharge);
|
|
702
|
}
|
|
703
|
else
|
|
704
|
{
|
|
705
|
//console.log("系统异常!");
|
|
706
|
}
|
|
707
|
},
|
|
708
|
"error":function(){$.MsgBox.Alert('message','failddd')}
|
|
709
|
});
|
|
710
|
}
|
|
711
|
function getIdentity(professorId){
|
|
712
|
$.ajax({
|
|
713
|
"url":"ajax/professor/"+professorId,
|
|
714
|
"type":"get",
|
|
715
|
"async": false,
|
|
716
|
"success":function(data){
|
|
717
|
if(data.success)
|
|
718
|
{
|
|
719
|
$("option")[0].value=data.data.name;
|
|
720
|
$("option")[1].value=data.data.organization.name;
|
|
721
|
}
|
|
722
|
else
|
|
723
|
{
|
|
724
|
$.MsgBox.Alert("消息","系统异常!");
|
|
725
|
}
|
|
726
|
},
|
|
727
|
"error":function(){$.MsgBox.Alert('message','failddd')}
|
|
728
|
})
|
|
729
|
}
|
|
730
|
|
|
731
|
//正在合作的数量
|
|
732
|
$.ajax({
|
|
733
|
"url":"/ajax/operation/qaOnGoingOper",
|
|
734
|
"type":"get",
|
|
735
|
"data":{"professorId":userid},
|
|
736
|
"async": true,
|
|
737
|
"success":function(data)
|
|
738
|
{
|
|
739
|
if(data.success)
|
|
740
|
{
|
|
741
|
$("#workcontain").text(data.data);
|
|
742
|
}
|
|
743
|
}
|
|
744
|
});
|
|
745
|
|
|
746
|
|
|
747
|
|
|
748
|
|
|
749
|
//最新咨询中的发送
|
|
750
|
$("#myFlatSendConsultBtn").bind("click",newConsultSendFn);
|
|
751
|
//最新回复中的发送
|
|
752
|
$("#myFlatSendReplyBtn").bind("click",newReplySendFn);
|
|
753
|
//点击最新咨询查看全部
|
|
754
|
$("#lookAllConsult,#lookMyConsult").click(function(){
|
|
755
|
$("#consultbtn").css({
|
|
756
|
color:"#fff",
|
|
757
|
background:"#f99550"
|
|
758
|
});
|
|
759
|
lookall = 1;
|
|
760
|
clickConsultBtn(lookall);
|
|
761
|
});
|
|
762
|
//点击最新回复查看全部
|
|
763
|
$("#lookAllReply").click(function(){
|
|
764
|
$("#consultbtn").css({
|
|
765
|
color:"#fff",
|
|
766
|
background:"#f99550"
|
|
767
|
});
|
|
768
|
lookall = 2;
|
|
769
|
clickConsultBtn(lookall);
|
|
770
|
});
|
|
771
|
getConsultData(userid);
|
|
772
|
getReplyData(userid);
|
|
773
|
queryUnreadConsultFn(userid);//未读咨询总数
|
|
774
|
|
|
775
|
|
|
776
|
function queryUnreadConsultFn(professorId){//未读咨询总数函数
|
|
777
|
var params = {"professorId":professorId};
|
|
778
|
$.ajax({
|
|
779
|
"url":"/ajax/consult/qaReadStatus",
|
|
780
|
"type":"get",
|
|
781
|
"async": false,
|
|
782
|
"data":params,
|
|
783
|
"success":function(response){
|
|
784
|
$("#unreadConsult").html(response["data"]);
|
|
785
|
},
|
|
786
|
"error":function(){
|
|
787
|
$.MsgBox.Alert('message','总的未读咨询条数请求失败');
|
|
788
|
}
|
|
789
|
});
|
|
790
|
};
|
|
791
|
|
|
792
|
function getConsultData(professorId){
|
|
793
|
var params = {"professorId":professorId};
|
|
794
|
$.ajax({
|
|
795
|
"url":"/ajax/consult/qaNewConsult",
|
|
796
|
"type":"get",
|
|
797
|
"async": false,
|
|
798
|
"data":params,
|
|
799
|
"success":function(response){
|
|
800
|
if(response.success) {
|
|
801
|
if(response.data != null) {
|
|
802
|
var newConsultData = response["data"];
|
|
803
|
$("#myFlatConsultTime").attr("consultId",newConsultData["consultId"]);
|
|
804
|
$("#myFlatProName").text(newConsultData["professor"]["name"]);
|
|
805
|
if(newConsultData["professor"]["office"]) {
|
|
806
|
$("#myReplyProOffice").html(newConsultData["professor"]["office"]+",");
|
|
807
|
}
|
|
808
|
if(newConsultData["professor"]["title"]) {
|
|
809
|
$("#myReplyProTitle").html(newConsultData["professor"]["title"]);
|
|
810
|
}
|
|
811
|
if(newConsultData["professor"]["department"]) {
|
|
812
|
$("#myReplyProDepartment").html(newConsultData["professor"]["department"]+",");
|
|
813
|
}
|
|
814
|
if(newConsultData["professor"]["orgName"]) {
|
|
815
|
$("#myReplyProOrgName").html(newConsultData["professor"]["orgName"]);
|
|
816
|
}
|
|
817
|
if(newConsultData["professor"]["address"]) {
|
|
818
|
$("#myReplyAddress").html(newConsultData["professor"]["address"]);
|
|
819
|
}
|
|
820
|
$("#myFlatConsultTime").html(newConsultData["createTime"].substr(0,4) + "-" + newConsultData["createTime"].substr(4,2) + "-" + newConsultData["createTime"].substr(6,2) + " "
|
|
821
|
+ newConsultData["createTime"].substr(8,2)+ ":" +newConsultData["createTime"].substr(10,2));
|
|
822
|
$("#myFlatConsultTitle").html(newConsultData["consultTitle"]);
|
|
823
|
$("#myFlatConsultContent").html(newConsultData["consultContant"]);
|
|
824
|
if(response.data.professor.hasHeadImage){
|
|
825
|
$("#proImage").attr("src","images/head/"+response.data.professor.id+"_m.jpg");
|
|
826
|
}else{
|
|
827
|
$("#proImage").attr("src","images/default-photo.jpg");
|
|
828
|
}
|
|
829
|
}
|
|
830
|
else {
|
|
831
|
$("#wbcon1").empty("");
|
|
832
|
var height=$("#repalyf").height();
|
|
833
|
$("#wbcon1").append('<span id="wbcen">暂无最新咨询消息~~</span>').css("height",height);
|
|
834
|
var oHeight=($("#wbcon1").height()-$("#wbcen").height())/2;
|
|
835
|
var oWidth=($("#wbcon1").width()-$("#wbcen").width())/2;
|
|
836
|
$("#wbcen").css({"color":"#999","display":"inline-block","margin-top":oHeight,"margin-left":oWidth});
|
|
837
|
}
|
|
838
|
|
|
839
|
}
|
|
840
|
else {
|
|
841
|
$.MsgBox.Alert("消息","最新咨询数据请求失败");
|
|
842
|
}
|
|
843
|
|
|
844
|
},
|
|
845
|
"error":function(){
|
|
846
|
$.MsgBox.Alert('message','最新咨询数据请求失败');
|
|
847
|
}
|
|
848
|
|
|
849
|
})
|
|
850
|
}
|
|
851
|
|
|
852
|
|
|
853
|
function getReplyData(consultantId){
|
|
854
|
var params = {"consultantId":consultantId};
|
|
855
|
$.ajax({
|
|
856
|
"url":"/ajax/tidings/qaNewReply",
|
|
857
|
"type":"get",
|
|
858
|
"async": true,
|
|
859
|
"data":params,
|
|
860
|
"success":function(response){
|
|
861
|
if(response.success) {
|
|
862
|
if(response["data"] != null) {
|
|
863
|
var newReplyData = response["data"];
|
|
864
|
$("#myFlatRelpyTime").attr("consultId",newReplyData["consult"]["consultId"]);
|
|
865
|
$("#myFlatReplyProName").html(newReplyData["professor"]["name"]);
|
|
866
|
if(newReplyData["professor"]["office"]) {
|
|
867
|
$("#myProOffice").html(newReplyData["professor"]["office"]+",");
|
|
868
|
}
|
|
869
|
if(newReplyData["professor"]["title"]) {
|
|
870
|
$("#myProTitle").html(newReplyData["professor"]["title"]);
|
|
871
|
}
|
|
872
|
if(newReplyData["professor"]["department"]) {
|
|
873
|
$("#myProDepartment").html(newReplyData["professor"]["department"]+",");
|
|
874
|
}
|
|
875
|
if(newReplyData["professor"]["orgName"]) {
|
|
876
|
$("#myProOrgName").html(newReplyData["professor"]["orgName"]);
|
|
877
|
}
|
|
878
|
if(newReplyData["professor"]["address"]) {
|
|
879
|
$("#myAddress").html(newReplyData["professor"]["address"]);
|
|
880
|
}
|
|
881
|
$("#myFlatRelpyTime").html(newReplyData["createTime"].substr(0,4) + "-" + newReplyData["createTime"].substr(4,2) + "-" + newReplyData["createTime"].substr(6,2) + " "
|
|
882
|
+ newReplyData["createTime"].substr(8,2)+ ":" +newReplyData["createTime"].substr(10,2));
|
|
883
|
$("#myFlatRelpyTitle").html(newReplyData["consult"]["consultTitle"]);
|
|
884
|
|
|
885
|
$("#myFlatRelpyContent").html(newReplyData["tidingsContant"]);
|
|
886
|
if(response.data.professor.hasHeadImage){
|
|
887
|
$("#proreplayImage").attr("src","images/head/"+response.data.professor.id+"_m.jpg");
|
|
888
|
}else{
|
|
889
|
$("#proreplayImage").attr("src","images/default-photo.jpg");
|
|
890
|
}
|
|
891
|
}
|
|
892
|
else { $("#wbcon2").empty("")
|
|
893
|
var height=$("#wbcon1").height();
|
|
894
|
$("#wbcon2").append('<span id="wbcent">暂无最新回复消息~~</span>').css("height",height);
|
|
895
|
var oHeight=($("#wbcon2").height()+40-$("#wbcent").height())/2;
|
|
896
|
var oWidth=($("#wbcon2").width()-$("#wbcent").width())/2;
|
|
897
|
$("#wbcent").css({"color":"#999","display":"inline-block","margin-top":oHeight,"margin-left":oWidth});
|
|
898
|
}
|
|
899
|
|
|
900
|
}
|
|
901
|
else {
|
|
902
|
$.MsgBox.Alert('message','最新回复数据请求失败');
|
|
903
|
}
|
|
904
|
|
|
905
|
|
|
906
|
},
|
|
907
|
"error":function(){
|
|
908
|
$.MsgBox.Alert('message','最新回复数据请求失败');
|
|
909
|
}
|
|
910
|
|
|
911
|
})
|
|
912
|
}
|
|
913
|
|
|
914
|
|
|
915
|
//发送userid:用户id,container:获得内容的container
|
|
916
|
function newConsultSendFn(){
|
|
917
|
var consultId = $("#myFlatConsultTime").attr("consultId");
|
|
918
|
var consultCon = $("#myFlatConsultCon").val();
|
|
919
|
var params = {
|
|
920
|
"tidingsContant":consultCon,
|
|
921
|
"consultId":consultId,
|
|
922
|
"senderId":userid
|
|
923
|
}
|
|
924
|
$.ajax({
|
|
925
|
url:"/ajax/tidings",
|
|
926
|
type:"post",
|
|
927
|
async:true,
|
|
928
|
"contentType" : "application/x-www-form-urlencoded",
|
|
929
|
data:params,
|
|
930
|
success:function(response){
|
|
931
|
getConsultData(userid);
|
|
932
|
},
|
|
933
|
error:function(error){
|
|
934
|
|
|
935
|
}
|
|
936
|
|
|
937
|
});
|
|
938
|
|
|
939
|
$("#myFlatConsultCon").val("");
|
|
940
|
};
|
|
941
|
|
|
942
|
function newReplySendFn(){
|
|
943
|
var consultId = $("#myFlatRelpyTime").attr("consultId");
|
|
944
|
var consultCon = $("#myFlatReplyCon").val();
|
|
945
|
var params = {
|
|
946
|
"tidingsContant":consultCon,
|
|
947
|
"consultId":consultId,
|
|
948
|
"senderId":userid
|
|
949
|
}
|
|
950
|
$.ajax({
|
|
951
|
url:"/ajax/tidings",
|
|
952
|
type:"post",
|
|
953
|
async:false,
|
|
954
|
"contentType" : "application/x-www-form-urlencoded",
|
|
955
|
data:params,
|
|
956
|
success:function(response){
|
|
957
|
getReplyData(userid);
|
|
958
|
},
|
|
959
|
error:function(error){
|
|
960
|
|
|
961
|
}
|
|
962
|
|
|
963
|
});
|
|
964
|
// $.MsgBox.Alert("消息","回复成功!");
|
|
965
|
$("#myFlatReplyCon").val("");
|
|
966
|
};
|
|
967
|
|
|
968
|
|
|
969
|
|
|
970
|
|
|
971
|
|
|
972
|
});
|
|
973
|
|