|
|
@@ -62,13 +62,14 @@ function initCheck() {
|
|
|
if ($.checkTask) {
|
|
|
getUserCheckCount();
|
|
|
initCheckAppealBtns();
|
|
|
- setFeSelect("#fsList", $.checkTask.checked_dept);
|
|
|
-
|
|
|
+ // setFeSelect("#fsList", $.checkTask.checked_dept);
|
|
|
+ $("#taskName").html($.checkTask.name);
|
|
|
$("#ex1_span").html($.checkTask.start_time)
|
|
|
$("#full_ex1_span").html($.checkTask.start_time)
|
|
|
|
|
|
$("#lane").val($.checkTask.checked_location);
|
|
|
- $("#check_time").val($.checkTask.check_period);
|
|
|
+ $("#check_time").html($.checkTask.check_period);
|
|
|
+ $("#monitor").html($.checkTask.monitor_user_name);
|
|
|
// setLaneSelect("#lane", $.checkTask.checked_location);
|
|
|
get_common_service('user/getUserById/' + $.checkTask.checked_person, null, function(data) {
|
|
|
changePersonContent(data);
|
|
|
@@ -337,7 +338,7 @@ function showAppealLayer() {
|
|
|
// 使用data参数更新数据:
|
|
|
function queryCheckScores() {
|
|
|
//$('#score_datatable').score_datatable("");
|
|
|
- console.log("任务id:" + $.checkTask.id);
|
|
|
+ // console.log("任务id:" + $.checkTask.id);
|
|
|
var data = {
|
|
|
"task_id": $.checkTask.id
|
|
|
}
|
|
|
@@ -347,22 +348,34 @@ function queryCheckScores() {
|
|
|
{ width: 100, text: '评分记录', type: 'string', flex: true, sort: 'down', field: 'content' },
|
|
|
{ width: 40, text: '分数', type: 'string', flex: true, colClass: '', field: 'check_item_score' },
|
|
|
{ width: 100, text: '备注', type: 'string', flex: true, colClass: '', field: 'remark' },
|
|
|
- { width: 55, text: '考核人', type: 'string', flex: true, colClass: '', field: 'checked_person_name' },
|
|
|
+ { width: 50, text: '考核人', type: 'string', flex: true, colClass: '', field: 'checked_person_name' },
|
|
|
// {width: 80, text: '图片', type: 'imagedd', flex: true, colClass: '',field: 'pics'},
|
|
|
- {
|
|
|
- width: 150,
|
|
|
- text: '操作',
|
|
|
- type: 'string',
|
|
|
- flex: true,
|
|
|
- field: 'id',
|
|
|
- oper: [
|
|
|
- { func: 'showEditCheckScore', text: '修改', icon_class: 'icon-edit' },
|
|
|
- { func: 'showEditPic', text: '图片', icon_class: 'icon-edit' },
|
|
|
- { func: 'deleteCheckScore', text: '删除', icon_class: 'icon-remove-circle' }
|
|
|
- ]
|
|
|
- }
|
|
|
+ // {
|
|
|
+ // width: 150,
|
|
|
+ // text: '操作',
|
|
|
+ // type: 'string',
|
|
|
+ // flex: true,
|
|
|
+ // field: 'id',
|
|
|
+ // oper: [
|
|
|
+ // { func: 'showEditCheckScore', text: '修改', icon_class: 'icon-edit' },
|
|
|
+ // { func: 'showEditPic', text: '图片', icon_class: 'icon-edit' },
|
|
|
+ // { func: 'deleteCheckScore', text: '删除', icon_class: 'icon-remove-circle' }
|
|
|
+ // ]
|
|
|
+ // }
|
|
|
];
|
|
|
|
|
|
+ var colFunc = {width: 120, text: '操作', type: 'string', flex: true, field: 'id'};
|
|
|
+ colFunc.oper = [
|
|
|
+ { func: 'showEditCheckScore', text: '修改', icon_class: 'icon-edit' },
|
|
|
+ { func: 'showEditPic', text: '图片', icon_class: 'icon-edit' }
|
|
|
+ ];
|
|
|
+ if ($.checkTask.appeal){
|
|
|
+ colFunc.oper.push({ func: 'backoutCheckScore', text: '撤销', icon_class: 'icon-reply' });
|
|
|
+ }else{
|
|
|
+ colFunc.oper.push({ func: 'deleteCheckScore', text: '删除', icon_class: 'icon-remove-circle' });
|
|
|
+ }
|
|
|
+ cols.push(colFunc);
|
|
|
+
|
|
|
// var pager = {
|
|
|
// page_size:10
|
|
|
// }
|
|
|
@@ -476,7 +489,28 @@ function saveEdit() {
|
|
|
function deleteCheckScore(id) {
|
|
|
deleteItem4Common(id, "/score/delete/", queryCheckScores, 'r');
|
|
|
}
|
|
|
+function backoutCheckScore(id) {
|
|
|
+ layer.confirm('是否要撤销扣分?', {
|
|
|
+ btn: ['是', '否'], //按钮
|
|
|
+ shadeClose: true,
|
|
|
+ shade: 0, //不显示遮罩
|
|
|
+ offset: 'r'
|
|
|
+ }, function() {
|
|
|
+ var param = {
|
|
|
+ "id": id,
|
|
|
+ "check_item_score": 0
|
|
|
+ };
|
|
|
+ post_common_service("/score/backoutScore/", param, function(data) {
|
|
|
+ layer.msg('撤销成功!', {
|
|
|
+ offset: 'r',
|
|
|
+ time: 2000, //20s后自动关闭
|
|
|
+ });
|
|
|
+ queryCheckScores();
|
|
|
+ });
|
|
|
+ }, function() {
|
|
|
|
|
|
+ });
|
|
|
+}
|
|
|
function setVideoList(videos) {
|
|
|
var videoArr;
|
|
|
if (videos) {
|
|
|
@@ -599,42 +633,53 @@ function showChangeUser() {
|
|
|
}
|
|
|
|
|
|
function changePerson(id) {
|
|
|
- var flag = true;
|
|
|
- var param = {
|
|
|
- "id": $.checkTask.id,
|
|
|
- "checked_person": id,
|
|
|
- "class_type": $.checkTask.class_type
|
|
|
- };
|
|
|
- post_common_service("/task/getUserCount/", param, function(data) {
|
|
|
- if (data && data.length >= 2) {
|
|
|
- layer.msg("本周期稽查次数已满,不能再被稽查!", {
|
|
|
- time: 2000, //20s后自动关闭
|
|
|
- offset: 'r'
|
|
|
- });
|
|
|
- } else {
|
|
|
- // $('#checked_person').html(id);
|
|
|
- var param1 = {
|
|
|
- "id": $.checkTask.id,
|
|
|
- "checked_person": id,
|
|
|
- }
|
|
|
- post_common_service("task/update/", param1, function(task_data) {
|
|
|
- checkHasScore(id, $.checkTask.checked_person);
|
|
|
- //重置当前任务
|
|
|
- $.checkTask = task_data;
|
|
|
- //获取用户信息
|
|
|
- get_common_service('user/getUserById/' + id, null, function(data) {
|
|
|
- changePersonContent(data);
|
|
|
+ layer.confirm('是否要更改考核人?', {
|
|
|
+ btn: ['是', '否'], //按钮
|
|
|
+ shadeClose: true,
|
|
|
+ shade: 0, //不显示遮罩
|
|
|
+ offset: 'r'
|
|
|
+ }, function(index) {
|
|
|
+ layer.close(index);
|
|
|
+ var flag = true;
|
|
|
+ var param = {
|
|
|
+ "id": $.checkTask.id,
|
|
|
+ "checked_person": id,
|
|
|
+ "class_type": $.checkTask.class_type
|
|
|
+ };
|
|
|
+ post_common_service("/task/getUserCount/", param, function(data) {
|
|
|
+ if (data && data.length >= 2) {
|
|
|
+ layer.msg("本周期稽查次数已满,不能再被稽查!", {
|
|
|
+ time: 2000, //20s后自动关闭
|
|
|
+ offset: 'r'
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ // $('#checked_person').html(id);
|
|
|
+ var param1 = {
|
|
|
+ "id": $.checkTask.id,
|
|
|
+ "checked_person": id,
|
|
|
+ }
|
|
|
+ post_common_service("task/update/", param1, function(task_data) {
|
|
|
+ checkHasScore(id, $.checkTask.checked_person);
|
|
|
+ //重置当前任务
|
|
|
+ $.checkTask = task_data;
|
|
|
+ //获取用户信息
|
|
|
+ get_common_service('user/getUserById/' + id, null, function(data) {
|
|
|
+ changePersonContent(data);
|
|
|
+ })
|
|
|
+ //更新用户次数表
|
|
|
+ no_return_common_service('task/updateUserCount/', param, function(data) {
|
|
|
+ // changePersonContent(data);
|
|
|
})
|
|
|
- //更新用户次数表
|
|
|
- no_return_common_service('task/updateUserCount/', param, function(data) {
|
|
|
- // changePersonContent(data);
|
|
|
- })
|
|
|
- layer.close(changePersonLayer);
|
|
|
- }, function(error) {
|
|
|
- // alert(error);
|
|
|
- });
|
|
|
- }
|
|
|
+ layer.close(changePersonLayer);
|
|
|
+ }, function(error) {
|
|
|
+ // alert(error);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }, function() {
|
|
|
+
|
|
|
});
|
|
|
+
|
|
|
}
|
|
|
|
|
|
function checkHasScore(id, old_person) {
|
|
|
@@ -689,7 +734,7 @@ function resetUserImgInfo() {
|
|
|
var str = '<a id="person_img" href="../../images/img4.jpg" class="lightbox-toggle">' +
|
|
|
'<img src="../../images/img4.jpg" class="img-thumbnail" style="width:50px;height:50px;margin-top:-10px;"></a>' +
|
|
|
'<label id="checked_person"></label>' +
|
|
|
- '(次数:<a href="javascript:void(0)" onclick="showCheckDetailCount()"><label id="checked_count"></label></a>)';
|
|
|
+ '(次数:<a href="javascript:void(0)" onclick="showCheckDetailCount()"><span class="label label-primary" id="checked_count">Primary</span></a>)';
|
|
|
$("#user_img_container").html(str);
|
|
|
}
|
|
|
|