work转换html,workmain.html

任务

领取人

任务标题


任务周期

尽快完成

本周内完成

本月内完成

指定日期完成

保密级别

汇报周期

每日汇报

每周汇报

每月汇报

自由汇报

任务结束时间

  • 0%

创建任务

$('#top').load('html/common/top.html');

$("#footer").load("html/common/footer.html");

$('#datetimepicker').datetimepicker();

$(function() {

doAjax("/OA/allClass.do", {}, function(data) {

var html = '';

for(var i = 0; i < data.ok.length; i++) {

html += '' + data.ok[i].project + '';

}

$("#worktype").html(html);

});

$("#sub").click(function() {

var title = $("#theme").val();

var content = $("#workcontent").val();

var timetype = $("#worktimetype").val();

var datetimepicker = $("#datetimepicker").val();

var worktype = $("#worktype").val();

var workreport = $("#workreport").val();

var user = "";

$("#userslist li").each(function() {

user += $(this).attr("id_prikey") + ",";

});

if(user.length > 0) {

user = user.substr(0, user.length - 1);

} else {

alert("请选择人员在发送");

return;

}

if(title == "") {

alert("请添加标题");

return;

}

if(content == "") {

alert("请添加内容");

return;

}

if(datetimepicker == "") {

alert("请选择时间");

return;

}

var fileName = "";

$("#filelist div").each(function() {

fileName += $(this).attr("name") + ',' + $(this).attr("path") + ',' + $(this).attr("size") + ';';

});

if(fileName.length > 0) {

fileName = fileName.substr(0, fileName.length - 1);

}

var data = {

contentType: work_sql_id_prikey,

title: title,

"class": worktype,

content: content,

userList: user,

cycle: workreport,

fileName: fileName,

rate: 0,

fatherContentId: 0,

endTime: new Date(datetimepicker).getTime(),

taskTime: timetype,

id: 0

}

doAjax("/OA/addTask.do", data, function(data) {

alert(data.ok);

});

});

});

var path = "";

var status = 0;

$(".hb-list").click(function() {

status = $(this).attr("status");

path = $(this).attr("path");

invokingfenye(1);

});

function invokingfenye(currentPage) {

fenye(currentPage, status);

}

function fenye(currentPage, status) {

doAjax(path, {

"pageSize": 12,

"currentPage": currentPage,

"status": status,

}, function(data) {

var rows = data.ok.list;

$("#content").html("");

$("#content").hide();

var html = '';

if(rows.length == 0) {

html += '

';

html += '

您暂时还没有内容

';

html += '

';

} else {

for(var i = 0; i < rows.length; i++) {

html += '

';

html += '

';

html += '' + rows[i].title + ' ' + rows[i].total + '';

html += '

';

html += '

';

html += '' + rows[i].rate + '%';

html += '

';

html += '

';

html += '

  • ';

html += '

发  布  人:' + rows[i].name + '
';

html += '

汇报周期:' + rows[i].cycle + '
';

html += '

开始时间:' + rows[i].releaseTime + '
';

html += '

结束时间:' + rows[i].endTime + '
';

html += '

';

html += '

';

html += '

';

}

}

$("#content").html(html);

$("#content").fadeIn();

$(".hb-content").unbind("click");

$(".hb-content").click(function() {

localStorage.setItem("workid", $(this).attr("id_prikey"));

window.location.href = "workshow.html";

});

var fen = data.ok.info;

var p1 = parseInt(fen.currentPage);

var f = intoPage(fen.pages, p1);

var html = pageShow(f, p1, fen.pages);

$("#fen").html(html);

});

}

function fileChange(target) {

var filename = $("#exampleInputFile").val();

filename = filename.substr(filename.lastIndexOf("\\") + 1);

$(".hb-progress").show();

var t = setInterval(function() {

$("#filename").text(filename);

doAjax(progress, {}, function(data) {

$(".progress-bar").css("width", data.ok + "%");

$(".progress-bar").text(data.ok + "%");

if(data.ok == 100) {

clearInterval(t);

$(".hb-progress").hide();

$(".progress-bar").css("width", 0 + "%");

$(".progress-bar").text("0%");

}

});

}, 500);

uploadFile($(target).prop("files")[0], function(data) {

$('#file').val('');

data = JSON.parse(data);

var html = '';

html += '

';

html += '

  • ';

html += '

' + data.ok.filename + '
';

html += '

' + data.ok.flag + '
';

html += '

取消';

html += '

';

html += '

';

$("#filelist").append(html);

$(".delfujian").unbind("click");

$(".delfujian").click(function() {

$(this).parents(".border-t").remove();

});

});

}

var setting = {

view: {

selectedMulti: false

},

check: {

enable: true

},

data: {

simpleData: {

enable: true

}

},

callback: {

onCheck: onCheck

}

};

var zNodes = JSON.parse(localStorage.getItem("dep"));

var clearFlag = false;

function onCheck(e, treeId, treeNode) {

var treeObj = $.fn.zTree.getZTreeObj("treeDemo");

var peoples = treeObj.getCheckedNodes(true);

var html = '';

for(var i = 0; i < peoples.length; i++) {

if(!peoples[i].isParent && !isNaN(peoples[i].id)) {

html += '

';

html += '' + peoples[i].name + '';

html += '

';

}

}

$("#userslist").html(html);

$(".hb-deluser").unbind("click");

$(".hb-deluser").click(function() {

var treeObj = $.fn.zTree.getZTreeObj("treeDemo");

var peoples = treeObj.getCheckedNodes(true);

for(var i = 0, l = peoples.length; i < l; i++) {

if(peoples[i].id == $(this).parents("li").attr("id_prikey")) {

treeObj.checkNode(peoples[i], false, true);

}

}

$(this).parents("li").remove();

});

}

function clearCheckedOldNodes() {

var zTree = $.fn.zTree.getZTreeObj("treeDemo"),

nodes = zTree.getChangeCheckedNodes();

for(var i = 0, l = nodes.length; i < l; i++) {

nodes[i].checkedOld = nodes[i].checked;

}

}

function count() {

var zTree = $.fn.zTree.getZTreeObj("treeDemo"),

checkCount = zTree.getCheckedNodes(true).length,

nocheckCount = zTree.getCheckedNodes(false).length,

changeCount = zTree.getChangeCheckedNodes().length;

$("#checkCount").text(checkCount);

$("#nocheckCount").text(nocheckCount);

$("#changeCount").text(changeCount);

}

function createTree() {

$.fn.zTree.init($("#treeDemo"), setting, zNodes);

count();

clearFlag = $("#last").attr("checked");

}

function zTreeOnClick(event, treeId, treeNode) {

};

$(document).ready(function() {

createTree();

$("#init").bind("change", createTree);

$("#last").bind("change", createTree);

$("#selecttree").change(function() {

var val = $(this).val();

var zNodes = JSON.parse(localStorage.getItem(val));

$.fn.zTree.init($("#treeDemo"), setting, zNodes);

})

});

一键复制

编辑

Web IDE

原始数据

按行查看

历史

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值