js 排班插件_JS实现日程安排 日程安排插件

代码:

员工周计划

body

{

margin: 0;

padding: 0;

font-size: 12px;

color: #555;

background-color: #fff;

}

.table-title

{

border-collapse: collapse;

width: 100%;

border: solid 1px #ddd;

font-size: 12px;

font-weight: bold;

color: #555;

}

.table-title td

{

text-align: center;

padding: 5px;

height: 25px;

}

.table-days

{

border-collapse: collapse;

width: 100%;

}

.table-days td

{

border: solid 1px #ddd;

height: 150px;

vertical-align: top;

width: 14px;

}

.td-gray

{

color: #ccc;

background-color: #f7f7f7;

}

.div-task-item

{

background-color: #bfecff;

margin-top: 2px;

padding: 2px;

height: 14px;

cursor: default;

/* margin-left: 5px;

margin-right: 5px;*/

}

.div-task-item:hover

{

background-color: #ff5588 !important;

}

.div-no-task-item

{

margin-top: 2px;

padding: 2px;

height: 14px;

}

.td-selected

{

background-color: #e0f2f8 !important;

}

.div-day-title

{

text-align: right;

padding: 3px;

}

.td-today

{

background-color: #fcd7d7;

}

.td-today div:first-child

{

border-top: solid 2px #f72f37;

padding-top: 1px;

}

.highlight-task

{

background-color: #ff3366 !important;

color: #fff !important;

}

var data = {

empCode: '101',

list: [

//说明:id暂时无用

{ id: '01', taskCode: '001', title: '任务一', content: '测试内容', year: 2016, month: 1, day: 3 },

{ id: '02', taskCode: '001', title: '任务一', content: '测试内容', year: 2016, month: 1, day: 4 },

//{ id: '02', taskCode: '001', title: '任务一', content: '测试内容', year: 2016, month: 1, day: 5 },

{ id: '03', taskCode: '002', title: '任务二', content: '测试内容', year: 2016, month: 1, day: 4 },

//{ id: '04', taskCode: '002', title: '任务二', content: '测试内容', year: 2016, month: 1, day: 5 },

{ id: '05', taskCode: '003', title: '任务三', content: '测试内容', year: 2016, month: 1, day: 5 },

{ id: '06', taskCode: '003', title: '任务三', content: '测试内容', year: 2016, month: 1, day: 6 },

{ id: '07', taskCode: '004', title: '任务四', content: '测试内容', year: 2016, month: 1, day: 6 },

{ id: '08', taskCode: '005', title: '任务五', content: '测试内容', year: 2016, month: 1, day: 6 },

{ id: '09', taskCode: '005', title: '任务五', content: '测试内容', year: 2016, month: 1, day: 7 },

{ id: '10', taskCode: '006', title: '任务六', content: '测试内容', year: 2016, month: 1, day: 7 },

//{ id: '11', taskCode: '006', title: '任务六', content: '测试内容', year: 2016, month: 1, day: 8 },

//{ id: '12', taskCode: '006', title: '任务六', content: '测试内容', year: 2016, month: 1, day: 9 },

{ id: '13', taskCode: '007', title: '任务七', content: '测试内容', year: 2016, month: 1, day: 6 },

{ id: '13', taskCode: '007', title: '任务七', content: '测试内容', year: 2016, month: 1, day: 7 },

{ id: '14', taskCode: '007', title: '任务七', content: '测试内容', year: 2016, month: 1, day: 8 },

//{ id: '15', taskCode: '008', title: '任务八', content: '测试内容', year: 2016, month: 1, day: 6 },

//{ id: '15', taskCode: '008', title: '任务八', content: '测试内容', year: 2016, month: 1, day: 7 },

{ id: '15', taskCode: '008', title: '任务八', content: '测试内容', year: 2016, month: 1, day: 8 },

{ id: '15', taskCode: '008', title: '任务八', content: '测试内容', year: 2016, month: 1, day: 9 },

{ id: '15', taskCode: '009', title: '任务九', content: '测试内容', year: 2016, month: 1, day: 4 },

{ id: '15', taskCode: '009', title: '任务九', content: '测试内容', year: 2016, month: 1, day: 5 },

{ id: '15', taskCode: '010', title: '任务十', content: '测试内容', year: 2016, month: 1, day: 10 },

{ id: '15', taskCode: '010', title: '任务十', content: '测试内容', year: 2016, month: 1, day: 9 },

{ id: '15', taskCode: '011', title: '任务十一', content: '测试内容', year: 2015, month: 12, day: 31 },

{ id: '15', taskCode: '011', title: '任务十一', content: '测试内容', year: 2016, month: 1, day: 1 },

{ id: '15', taskCode: '011', title: '任务十一', content: '测试内容', year: 2016, month: 1, day: 2 },

{ id: '15', taskCode: '011', title: '任务十一', content: '测试内容', year: 2016, month: 1, day: 3 }

]

};

var taskCodeList = new Array();

function createTaskCodeList(data, taskCodeList) {

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

var bl = true;

for (var j = 0; j < taskCodeList.length; j++) {

if (taskCodeList[j] == data.list[i].taskCode) {

bl = false;

}

}

if (bl) {

taskCodeList.push(data.list[i].taskCode);

}

}

}

createTaskCodeList(data, taskCodeList);

$(function () {

$(".table-days").parent().height($(window).height() - $(".table-days").parent().position().top - 10);

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

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

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

createPlanTable(year, month);

});

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

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

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值