|
|
@@ -206,14 +206,17 @@ function queryCheckScores() {
|
|
|
}
|
|
|
// alert("ff");
|
|
|
var cols = [
|
|
|
- { width: 80, text: '序号', type: 'number', flex: true, colClass: 'text-center', field: 'num' },
|
|
|
+ { width: 40, text: '序号', type: 'number', flex: true, colClass: 'text-center', field: 'num' },
|
|
|
{ width: 160, text: '评分记录', type: 'string', flex: true, sort: 'down', field: 'content' },
|
|
|
- { width: 80, text: '分数', type: 'string', flex: true, colClass: '', field: 'check_item_score' },
|
|
|
+ { width: 50, 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: 80, text: '图片', type: 'imagedd', flex: true, colClass: '',field: 'pics'},
|
|
|
{
|
|
|
- width: 160, text: '操作', type: 'string', flex: true, field: 'id',
|
|
|
+ width: 110, 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' }
|
|
|
]
|
|
|
}
|
|
|
@@ -229,16 +232,44 @@ function queryCheckScores() {
|
|
|
}
|
|
|
);
|
|
|
}
|
|
|
-function showEditCheckScore(id) {
|
|
|
- // deleteItem4Common(id,"/score/delete/",queryCheckScores);
|
|
|
+function showEditPic(){
|
|
|
var rowData = getItemByIdFromArr(id, $('#score_datatable').mytable('getTableData'));
|
|
|
- // scoreDetailLayer = showPopup4Common('修改考核项',null,['600px','500px'],'#score-detail-div');
|
|
|
- // var rowData=getItemByIdFromArr(id,$('#score_datatable').mytable('getTableData'));
|
|
|
showPics(rowData.pics);
|
|
|
- // $("#scoreContent").val(rowData.content);
|
|
|
$("#saveEditBtn").show();
|
|
|
editScoreId = id;
|
|
|
}
|
|
|
+function showEditCheckScore(id) {
|
|
|
+ // deleteItem4Common(id,"/score/delete/",queryCheckScores);
|
|
|
+ var rowData = getItemByIdFromArr(id, $('#score_datatable').mytable('getTableData'));
|
|
|
+ scoreDetailLayer = showPopup4Common('修改考核项',function(data){
|
|
|
+ saveScoreEdit();
|
|
|
+ },['350px','400px'],'#score-detail-div','r');
|
|
|
+
|
|
|
+ $("#score_id_text").val(rowData.id);
|
|
|
+ $("#check_item_text").val(rowData.content);
|
|
|
+ $("#check_score_text").val(rowData.check_item_score);
|
|
|
+ $("#check_remark_text").val(rowData.remark);
|
|
|
+ setTeamUserSelect("#check_checked_person_select",rowData.checked_person,$.checkTask.user_class_id);
|
|
|
+}
|
|
|
+function saveScoreEdit(){
|
|
|
+ var param = {
|
|
|
+ 'id': $("#score_id_text").val(),
|
|
|
+ 'content': $("#check_item_text").val(),
|
|
|
+ 'check_item_score': $("#check_score_text").val(),
|
|
|
+ 'remark': $("#check_remark_text").val(),
|
|
|
+ 'checked_person': $("#check_checked_person_select").val(),
|
|
|
+ };
|
|
|
+ editScoreId = null;
|
|
|
+ $("#saveEditBtn").hide();
|
|
|
+ no_return_common_service("/score/update", param, function (data) {
|
|
|
+ if (scoreLayer) layer.close(scoreLayer);
|
|
|
+ //查询评分情况
|
|
|
+ queryCheckScores();
|
|
|
+ // layer.msg(data, {
|
|
|
+ // time: 2000//20s后自动关闭
|
|
|
+ // });
|
|
|
+ });
|
|
|
+}
|
|
|
var editScoreId;
|
|
|
function saveEdit() {
|
|
|
if (editScoreId) {
|
|
|
@@ -360,8 +391,8 @@ function showChangeUser() {
|
|
|
var pic = "../../images/body-bg.png";
|
|
|
if (data[i].pic) pic = base_image_server_url + data[i].pic;
|
|
|
str = '<div style="width:90px;float:left;margin:5px;">'
|
|
|
- + '<a class="card" href="javascript:void(0)" onclick="showBigImg(\'' + pic + '\')">'
|
|
|
- + '<img src="' + pic + '" alt="" style="height:100px;width:90px;">'
|
|
|
+ + '<a class="card" href="javascript:void(0)">'
|
|
|
+ + '<img src="' + pic + '" alt="" style="height:100px;width:90px;" onclick="showBigImg(\'' + pic + '\')">'
|
|
|
+ '<div class="card-heading"><strong>' + name + '</strong></div>'
|
|
|
+ '<div class="card-actions">'
|
|
|
+ '<button type="button" class="btn btn-mini btn-danger" onclick="changePerson(\'' + data[i].id + '\')">选择</button>'
|
|
|
@@ -380,10 +411,17 @@ function changePerson(id) {
|
|
|
"id": $.checkTask.id,
|
|
|
"checked_person": id,
|
|
|
}
|
|
|
- no_return_common_service("task/update/", param, function (data) {
|
|
|
+ post_common_service("task/update/", param, function (task_data) {
|
|
|
+ //重置当前任务
|
|
|
+ $.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);
|
|
|
+ })
|
|
|
layer.close(changePersonLayer);
|
|
|
}, function (error) {
|
|
|
alert(error);
|
|
|
@@ -528,35 +566,57 @@ function genNode(m) {
|
|
|
}
|
|
|
|
|
|
function zTreeOnClick(event, treeId, treeNode) {
|
|
|
- //alert(treeNode.name);
|
|
|
- var imgArr = $("#img_container .pic-class");
|
|
|
- var picsStr = "";
|
|
|
- if (imgArr && imgArr.length > 0) {
|
|
|
- for (var i = 0; i < imgArr.length; i++) {
|
|
|
- picsStr += $(imgArr[i]).attr("path") + ","
|
|
|
+ if(isEdit){
|
|
|
+ var imgArr = $("#img_container .pic-class");
|
|
|
+ var picsStr = "";
|
|
|
+ if (imgArr && imgArr.length > 0) {
|
|
|
+ for (var i = 0; i < imgArr.length; i++) {
|
|
|
+ picsStr += $(imgArr[i]).attr("path") + ","
|
|
|
+ }
|
|
|
+ picsStr = picsStr.substr(0, picsStr.length - 1);
|
|
|
}
|
|
|
- picsStr = picsStr.substr(0, picsStr.length - 1);
|
|
|
- }
|
|
|
- var param = {
|
|
|
- 'task_id': $.checkTask.id,
|
|
|
- 'pics': picsStr,
|
|
|
- 'name': treeNode.value,
|
|
|
- 'check_item_score': treeNode.score,
|
|
|
- 'content': treeNode.value,
|
|
|
- 'check_item_id': treeNode.id,
|
|
|
- 'checkman': treeNode.id,
|
|
|
- 'checked_person': $.checkTask.checked_person,
|
|
|
- 'checked_dept': $.checkTask.checked_dept
|
|
|
- };
|
|
|
- no_return_common_service("/score/add", param, function (data) {
|
|
|
- if (scoreLayer) layer.close(scoreLayer);
|
|
|
- clearAllImg();
|
|
|
- //查询评分情况
|
|
|
- queryCheckScores();
|
|
|
- layer.msg(data, {
|
|
|
- time: 2000//20s后自动关闭
|
|
|
+ var param = {
|
|
|
+ 'task_id': $.checkTask.id,
|
|
|
+ 'pics': picsStr,
|
|
|
+ 'name': treeNode.value,
|
|
|
+ 'check_item_score': treeNode.score,
|
|
|
+ 'content': treeNode.value,
|
|
|
+ 'check_item_id': treeNode.id,
|
|
|
+ 'checkman': treeNode.id,
|
|
|
+ 'checked_person': $.checkTask.checked_person,
|
|
|
+ 'checked_dept': $.checkTask.checked_dept
|
|
|
+ };
|
|
|
+ no_return_common_service("/score/add", param, function (data) {
|
|
|
+ if (scoreLayer) layer.close(scoreLayer);
|
|
|
+ clearAllImg();
|
|
|
+ //查询评分情况
|
|
|
+ queryCheckScores();
|
|
|
+ layer.msg(data, {
|
|
|
+ time: 2000//20s后自动关闭
|
|
|
+ });
|
|
|
});
|
|
|
- });
|
|
|
+ }else{
|
|
|
+ var param = {
|
|
|
+ 'task_id': $.checkTask.id,
|
|
|
+ 'pics': picsStr,
|
|
|
+ 'name': treeNode.value,
|
|
|
+ 'check_item_score': treeNode.score,
|
|
|
+ 'content': treeNode.value,
|
|
|
+ 'check_item_id': treeNode.id,
|
|
|
+ 'checkman': treeNode.id,
|
|
|
+ 'checked_person': $.checkTask.checked_person,
|
|
|
+ 'checked_dept': $.checkTask.checked_dept
|
|
|
+ };
|
|
|
+ no_return_common_service("/score/add", param, function (data) {
|
|
|
+ if (scoreLayer) layer.close(scoreLayer);
|
|
|
+ clearAllImg();
|
|
|
+ //查询评分情况
|
|
|
+ queryCheckScores();
|
|
|
+ layer.msg(data, {
|
|
|
+ time: 2000//20s后自动关闭
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
function submitCheck() {
|