program_list.js
3.0 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
define(['jquery', 'bootstrap', 'frontend', 'form', 'template', 'swiper', 'layer'], function($, undefined, Frontend,
Form, Template, Swiper, Layer) {
var Controller = {
index: function() {
// console.log(true)
var first_swiper = new Swiper ('#first_swiper', {
loop: true, // 循环模式选项
// 如果需要分页器
autoplay:true,
pagination: {
el: '.swiper-pagination',
}
})
// 项目延期
$("#subject_delay").click(function () {
var item_id = $(this).data('id');
var get_url = "/index/program_list/subject_delay";
layer.prompt({
formType: 2,
title: '项目延期申请',
placeholder:'延期申请',
area: ['600px', '350px']
}, function(value, index, elem){
Fast.api.ajax({url:get_url,data:{item_id:item_id , delay_memo:value}},function (success) {
layer.msg("申请成功",{icon: 1 , time:1000} , function () {
window.location.href = success.url;
}); return false;
},function (error) {
layer.msg(error,{icon: 2})
})
layer.close(index);
});
})
// 项目终止申请
$("#subject_ended").click(function () {
var item_id = $(this).data('id');
var get_url = "/index/programList/subject_ended";
layer.prompt({
formType: 2,
title: '项目终止申请',
placeholder:'终止申请',
area: ['600px', '350px']
}, function(value, index, elem){
Fast.api.ajax({url:get_url,data:{item_id:item_id , end_memo:value}},function (success) {
layer.msg("申请成功",{icon: 1, time:1000} , function () {
window.location.href = success.url;
}); return false;
},function (error) {
layer.msg(error,{icon: 2})
})
layer.close(index);
});
})
$("#member_declare").click(function(){
layer.open({
type: 1,
title:['审核成员','font-size:1rem;'],
area:['50rem','20rem'],
scrollbar:false,
content: $('#modal')
});
})
$("#apply").click(function(){
$(this).addClass("li_active")
$("#establish").removeClass("li_active")
$("#apply_content").removeClass("taggle")
$("#establish_content").addClass("taggle")
})
$("#establish").click(function(){
$(this).addClass("li_active")
$("#apply").removeClass("li_active")
$("#establish_content").removeClass("taggle")
$("#apply_content").addClass("taggle")
})
$(".tab_li") .click(function(){
if($(this).index()<=$(".main_right").length){
$(this).addClass("left_active")
$(this).siblings().removeClass("left_active")
$(".main_right").each((i,ele)=>{
if(i+1==$(this).index()){
console.log(ele)
$(ele).show()
}else{
$(ele).hide()
}
})
}
})
},
}
return Controller;
});