|
@@ -8,23 +8,23 @@
|
|
|
|
|
|
//日期
|
|
//日期
|
|
laydate.render({
|
|
laydate.render({
|
|
- elem: '#beginDate1'
|
|
|
|
|
|
+ elem: '#beginDate1' //工程开始时间
|
|
});
|
|
});
|
|
laydate.render({
|
|
laydate.render({
|
|
- elem: '#endDate1'
|
|
|
|
|
|
+ elem: '#endDate1' //结束时间
|
|
});
|
|
});
|
|
laydate.render({
|
|
laydate.render({
|
|
- elem: '#beginDate2'
|
|
|
|
|
|
+ elem: '#beginDate2' //项目开始时间
|
|
});
|
|
});
|
|
laydate.render({
|
|
laydate.render({
|
|
- elem: '#endDate2'
|
|
|
|
|
|
+ elem: '#endDate2' //项目结束时间
|
|
});
|
|
});
|
|
});
|
|
});
|
|
layui.config({
|
|
layui.config({
|
|
base: '${ctxp}/static/plugin/assets/'
|
|
base: '${ctxp}/static/plugin/assets/'
|
|
}).extend({
|
|
}).extend({
|
|
treetable: 'treetable-lay/treetable'
|
|
treetable: 'treetable-lay/treetable'
|
|
-}).use(['layer', 'table', 'treetable'], function () {
|
|
|
|
|
|
+}).use(['layer', 'table', 'treetable'], function () { //生成下拉表格
|
|
var $ = layui.jquery;
|
|
var $ = layui.jquery;
|
|
var table = layui.table;
|
|
var table = layui.table;
|
|
var layer = layui.layer;
|
|
var layer = layui.layer;
|
|
@@ -48,17 +48,17 @@ layui.config({
|
|
{field:'op',align:'center',title:"操作",minWidth:200,templet:function(d){
|
|
{field:'op',align:'center',title:"操作",minWidth:200,templet:function(d){
|
|
////对操作进行初始化
|
|
////对操作进行初始化
|
|
var xml = "";
|
|
var xml = "";
|
|
- if(d.status==1){
|
|
|
|
|
|
+ if(d.status==1){ //工程按钮
|
|
xml += "<a class='layui-btn layui-btn-primary layui-btn-xs' onclick=\"look( '${ctx}/project/form?id=" + d.id + "&tabId=1')\">查看</a>"
|
|
xml += "<a class='layui-btn layui-btn-primary layui-btn-xs' onclick=\"look( '${ctx}/project/form?id=" + d.id + "&tabId=1')\">查看</a>"
|
|
+"<a class='layui-btn layui-btn-xs' onclick=\"update( '${ctx}/project/form?id=" + d.id + "&tabId=2')\">修改</a>"
|
|
+"<a class='layui-btn layui-btn-xs' onclick=\"update( '${ctx}/project/form?id=" + d.id + "&tabId=2')\">修改</a>"
|
|
+"<a class='layui-btn layui-btn-normal layui-btn-xs' lay-event='add'>添加项目</a>"
|
|
+"<a class='layui-btn layui-btn-normal layui-btn-xs' lay-event='add'>添加项目</a>"
|
|
+"<a class='layui-btn layui-btn-warm layui-btn-xs' lay-event=''href=\"${ctx}/project/export?id=" + d.id+"\">导出</a>"
|
|
+"<a class='layui-btn layui-btn-warm layui-btn-xs' lay-event=''href=\"${ctx}/project/export?id=" + d.id+"\">导出</a>"
|
|
+"<a class='layui-btn layui-btn-xs layui-btn-danger' onclick=\"deleteProject('"+d.id+"')\">删除</a>";
|
|
+"<a class='layui-btn layui-btn-xs layui-btn-danger' onclick=\"deleteProject('"+d.id+"')\">删除</a>";
|
|
}
|
|
}
|
|
- if(d.status==2){
|
|
|
|
|
|
+ if(d.status==2){ //项目表头操作
|
|
xml +="<span class='myspan'>操作</span>";
|
|
xml +="<span class='myspan'>操作</span>";
|
|
}
|
|
}
|
|
- if(d.status==3){
|
|
|
|
|
|
+ if(d.status==3){ //项目类型
|
|
xml +="<a class='layui-btn layui-btn-xs' href=\"${ctx}/jkxl/list?id="+d.id+"&type="+d.type+"\">编辑</a>"
|
|
xml +="<a class='layui-btn layui-btn-xs' href=\"${ctx}/jkxl/list?id="+d.id+"&type="+d.type+"\">编辑</a>"
|
|
+"<a class='layui-btn layui-btn-xs layui-btn-danger' onclick=\"deleteItem('" + d.id + "')\">删除</a>";
|
|
+"<a class='layui-btn layui-btn-xs layui-btn-danger' onclick=\"deleteItem('" + d.id + "')\">删除</a>";
|
|
}
|
|
}
|
|
@@ -115,7 +115,7 @@ layui.config({
|
|
treetable.foldAll('#table1');
|
|
treetable.foldAll('#table1');
|
|
table.on('tool(table1)', function(obj,target){
|
|
table.on('tool(table1)', function(obj,target){
|
|
var data = obj.data;
|
|
var data = obj.data;
|
|
- if(obj.event == 'add'){
|
|
|
|
|
|
+ if(obj.event == 'add'){ //添加项目
|
|
$("#addtext").val(data.id);
|
|
$("#addtext").val(data.id);
|
|
layui.use(['table','layer'],function(){
|
|
layui.use(['table','layer'],function(){
|
|
layer.open({
|
|
layer.open({
|
|
@@ -153,10 +153,10 @@ layui.config({
|
|
}
|
|
}
|
|
});
|
|
});
|
|
});
|
|
});
|
|
-function refresh(){
|
|
|
|
|
|
+function refresh(){ //刷新
|
|
$("#fromSumbit").submit();
|
|
$("#fromSumbit").submit();
|
|
}
|
|
}
|
|
-function addProject(){
|
|
|
|
|
|
+function addProject(){ //添加工程
|
|
layer.prompt({title: '请输入工程名称', formType: 3,offset:['35%','37%']}, function(text, index){
|
|
layer.prompt({title: '请输入工程名称', formType: 3,offset:['35%','37%']}, function(text, index){
|
|
layer.close(index);
|
|
layer.close(index);
|
|
$.ajax({
|
|
$.ajax({
|
|
@@ -173,24 +173,23 @@ function addProject(){
|
|
}
|
|
}
|
|
}
|
|
}
|
|
});
|
|
});
|
|
- });
|
|
|
|
|
|
+ })
|
|
}
|
|
}
|
|
-function look(url) {
|
|
|
|
|
|
+function look(url) { //工程 查看
|
|
layer.open({
|
|
layer.open({
|
|
type: 2,
|
|
type: 2,
|
|
title: '查看',
|
|
title: '查看',
|
|
area: ['70%', '90%'],
|
|
area: ['70%', '90%'],
|
|
offset:['7%','14%'],
|
|
offset:['7%','14%'],
|
|
shade: 0.8,
|
|
shade: 0.8,
|
|
-
|
|
|
|
shadeClose: true,
|
|
shadeClose: true,
|
|
fixed: true, //不固定
|
|
fixed: true, //不固定
|
|
maxmin: true,
|
|
maxmin: true,
|
|
- content: url
|
|
|
|
- , btn: ['关闭']
|
|
|
|
|
|
+ content: url,//查看的路径
|
|
|
|
+ btn: ['关闭']
|
|
})
|
|
})
|
|
}
|
|
}
|
|
-function update(url) {
|
|
|
|
|
|
+function update(url) { //修改
|
|
layer.open({
|
|
layer.open({
|
|
type: 2,
|
|
type: 2,
|
|
title: '修改工程',
|
|
title: '修改工程',
|
|
@@ -203,16 +202,15 @@ function update(url) {
|
|
content: url
|
|
content: url
|
|
, btn: ['确定','关闭']
|
|
, btn: ['确定','关闭']
|
|
,yes: function(index, layero){
|
|
,yes: function(index, layero){
|
|
- var bodyparent = layer.getChildFrame('body', index);
|
|
|
|
- bodyparent.find('#updatebtn').click();
|
|
|
|
|
|
+ var bodyparent = layer.getChildFrame('body', index); //获取子类页面body下内容
|
|
|
|
+ bodyparent.find('#updatebtn').click(); // 点击修改页面隐藏的按钮
|
|
}
|
|
}
|
|
,btn2: function(index, layero){
|
|
,btn2: function(index, layero){
|
|
layer.close(index);
|
|
layer.close(index);
|
|
}
|
|
}
|
|
})
|
|
})
|
|
}
|
|
}
|
|
-//逻辑删除项目
|
|
|
|
-function deleteItem(id) {
|
|
|
|
|
|
+function deleteItem(id) { //逻辑删除项目
|
|
layer.msg('你确定要删除吗?', {
|
|
layer.msg('你确定要删除吗?', {
|
|
icon: 3
|
|
icon: 3
|
|
, time: 0 //不自动关闭
|
|
, time: 0 //不自动关闭
|
|
@@ -237,8 +235,7 @@ function deleteItem(id) {
|
|
}
|
|
}
|
|
})
|
|
})
|
|
}
|
|
}
|
|
-//删除工程
|
|
|
|
-function deleteProject(id) {
|
|
|
|
|
|
+function deleteProject(id) {//删除工程
|
|
layer.msg('你确定要删除吗?', {
|
|
layer.msg('你确定要删除吗?', {
|
|
icon: 3
|
|
icon: 3
|
|
, time: 0 //不自动关闭
|
|
, time: 0 //不自动关闭
|
|
@@ -263,10 +260,9 @@ function deleteProject(id) {
|
|
}
|
|
}
|
|
})
|
|
})
|
|
}
|
|
}
|
|
-$(document).ready(function(e) {
|
|
|
|
|
|
+$(document).ready(function(e) { //触发隐藏的 搜索框
|
|
$("#noneBtn").click(function(e) {
|
|
$("#noneBtn").click(function(e) {
|
|
$("#noneDiv").toggle();
|
|
$("#noneDiv").toggle();
|
|
})
|
|
})
|
|
});
|
|
});
|
|
-
|
|
|
|
</script>
|
|
</script>
|