|
@@ -9,32 +9,80 @@ function queryTable(){
|
|
|
var cols = [
|
|
var cols = [
|
|
|
{width: 30, text: '序号', flex: false, colClass: 'text-center',field:'num'},
|
|
{width: 30, text: '序号', flex: false, colClass: 'text-center',field:'num'},
|
|
|
{width: 160, text: '考核办法', flex: false,colClass: 'text-center',field:'name'},
|
|
{width: 160, text: '考核办法', flex: false,colClass: 'text-center',field:'name'},
|
|
|
- {width: 80, text: '被考核部门', flex: true, colClass: 'text-center',field:'checked_dept_name'},
|
|
|
|
|
- {width: 100, text: '被考核职位', flex: true, colClass: 'text-center',field:'checked_position_name'},
|
|
|
|
|
|
|
+ // {width: 80, text: '被考核部门', flex: true, colClass: 'text-center',field:'checked_dept_name'},
|
|
|
|
|
+ // {width: 100, text: '被考核职位', flex: true, colClass: 'text-center',field:'checked_position_name'},
|
|
|
|
|
+ {width: 80, text: '类型', flex: false, colClass: 'text-center',field:'rule_type_name'},
|
|
|
{width: 100, text: '考核项', flex: false, type: 'string',colClass: 'text-center modity-flag',field:'checked_item_num' },
|
|
{width: 100, text: '考核项', flex: false, type: 'string',colClass: 'text-center modity-flag',field:'checked_item_num' },
|
|
|
{width: 80, text: '操作', flex: false, colClass: 'text-center',field:'id',oper:[
|
|
{width: 80, text: '操作', flex: false, colClass: 'text-center',field:'id',oper:[
|
|
|
|
|
+ {func:'showEditRule',text:'编辑',col_class:'icon-remove-circle'},
|
|
|
{func:'deleteCheckRule',text:'删除',col_class:'icon-remove-circle'}
|
|
{func:'deleteCheckRule',text:'删除',col_class:'icon-remove-circle'}
|
|
|
]},
|
|
]},
|
|
|
] ;
|
|
] ;
|
|
|
|
|
|
|
|
- $('.datatable').mytable({'cols':cols,
|
|
|
|
|
|
|
+ $('#ruleDatatable').mytable({'cols':cols,
|
|
|
'url':"/checkRule/getAllRule/",
|
|
'url':"/checkRule/getAllRule/",
|
|
|
'param':data}
|
|
'param':data}
|
|
|
);
|
|
);
|
|
|
$('#addModal').modal('hide');
|
|
$('#addModal').modal('hide');
|
|
|
|
|
+
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+function setRuleTypeSelect(div, selectId) {
|
|
|
|
|
+ post_common_service("/constant/getConstantByFlag", {code_flag: "rule_type"}, function(data) {
|
|
|
|
|
+ var optStr = '<option value="">无</option>';
|
|
|
|
|
+ for (var i in data) {
|
|
|
|
|
+ if (data[i].code_value == selectId)
|
|
|
|
|
+ optStr += '<option value="' + data[i].code_value + '" selected="selected">' + data[i].code_name + '</option>';
|
|
|
|
|
+ else
|
|
|
|
|
+ optStr += '<option value="' + data[i].code_value + '">' + data[i].code_name + '</option>';
|
|
|
|
|
+ }
|
|
|
|
|
+ $(div).html('');
|
|
|
|
|
+ $(div).html(optStr);
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 删除
|
|
// 删除
|
|
|
function deleteCheckRule(id){
|
|
function deleteCheckRule(id){
|
|
|
deleteItem4Common(id,"/checkRule/delete/",queryTable);
|
|
deleteItem4Common(id,"/checkRule/delete/",queryTable);
|
|
|
}
|
|
}
|
|
|
|
|
+// function addOrUpdateConstant(url){
|
|
|
|
|
+// var valid=1;
|
|
|
|
|
+// if(!$("#valid").is(':checked')) valid=0;
|
|
|
|
|
+// var param ={
|
|
|
|
|
+// 'id':cur_id,
|
|
|
|
|
+// 'code_flag':$('#code_flag').val(),
|
|
|
|
|
+// 'flag_name':$('#flag_name').val(),
|
|
|
|
|
+// 'code_value':Number($('#code_value').val()),
|
|
|
|
|
+// 'code_name':$('#code_name').val(),
|
|
|
|
|
+// 'sort_no':Number($('#sort_no').val()),
|
|
|
|
|
+// 'remark':$('#remark').val(),
|
|
|
|
|
+// 'valid':valid
|
|
|
|
|
+// };
|
|
|
|
|
+// addOrUpdateItem4Common(param,url,queryConstant);
|
|
|
|
|
+// }
|
|
|
|
|
+
|
|
|
|
|
+function showEditRule(id){
|
|
|
|
|
+ cur_id='';
|
|
|
|
|
+ var rowData=getItemByIdFromArr(id,$('#ruleDatatable').mytable('getTableData'));
|
|
|
|
|
+ if(rowData) {
|
|
|
|
|
+ cur_id = rowData.id;
|
|
|
|
|
+ $('#check_rule_name').val(rowData.name);
|
|
|
|
|
+ $('#rule_type').val(rowData.rule_type);
|
|
|
|
|
+ // alert(rowData);
|
|
|
|
|
+ showPopup4Common('修改考核办法',function(){
|
|
|
|
|
+ addOrUpdateCheckRule("/checkRule/update/");
|
|
|
|
|
+ },'400px','#edit-rule-div');
|
|
|
|
|
+ setRuleTypeSelect("#rule_type", rowData.rule_type);
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
|
|
|
function showAddCheckRule(){
|
|
function showAddCheckRule(){
|
|
|
- $('#check_rule_name,#dep_id,#position_id').val('');
|
|
|
|
|
- // showPopup4Common('添加考核办法',function(){
|
|
|
|
|
- // return addOrUpdateCheckRule("/checkRule/add");
|
|
|
|
|
- // },'400px');
|
|
|
|
|
- $('#addModal').modal('show');
|
|
|
|
|
|
|
+ $('#check_rule_name').val('');
|
|
|
|
|
+ showPopup4Common('添加考核办法',function(){
|
|
|
|
|
+ return addOrUpdateCheckRule("/checkRule/add");
|
|
|
|
|
+ },'400px','#edit-rule-div');
|
|
|
|
|
+ setRuleTypeSelect("#rule_type", null);
|
|
|
|
|
+ // $('#addModal').modal('show');
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
var all_data = [];
|
|
var all_data = [];
|
|
@@ -115,26 +163,40 @@ function getJob(dept_id){
|
|
|
/**
|
|
/**
|
|
|
* 添加考核办法 - 保存
|
|
* 添加考核办法 - 保存
|
|
|
*/
|
|
*/
|
|
|
-function addOrUpdateCheckRule(){
|
|
|
|
|
- if(idVal("check_rule_name") == ''){
|
|
|
|
|
- tip("请输入考核办法");
|
|
|
|
|
- return false;
|
|
|
|
|
- }
|
|
|
|
|
- if(idVal("position_id") == ''){
|
|
|
|
|
- tip("请选择职位");
|
|
|
|
|
- return false;
|
|
|
|
|
- }
|
|
|
|
|
- if(dept_selectinput.value==null || dept_selectinput.value==''){
|
|
|
|
|
- tip("请选择部门信息");
|
|
|
|
|
- return false ;
|
|
|
|
|
- }
|
|
|
|
|
- var param ={
|
|
|
|
|
- "name":idVal("check_rule_name") ,
|
|
|
|
|
- "checked_dept_id":dept_selectinput.value,
|
|
|
|
|
- "checked_position_id":idVal("position_id"),
|
|
|
|
|
- "checked_person_type":1
|
|
|
|
|
- };
|
|
|
|
|
- addOrUpdateItem4Common(param,"/checkRule/add",queryTable);
|
|
|
|
|
|
|
+function addOrUpdateCheckRule(url){
|
|
|
|
|
+
|
|
|
|
|
+ layer.confirm('相同类型的考核办法只能保留一条,可能会影响到之前数据,是否确定保存?', {
|
|
|
|
|
+ btn: ['是', '否'], //按钮
|
|
|
|
|
+ shadeClose: true,
|
|
|
|
|
+ }, function() {
|
|
|
|
|
+ if(idVal("check_rule_name") == ''){
|
|
|
|
|
+ tip("请输入考核办法");
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+ // if(idVal("rule_type") == ''){
|
|
|
|
|
+ // tip("请选择类型");
|
|
|
|
|
+ // return false;
|
|
|
|
|
+ // }
|
|
|
|
|
+ // if(idVal("position_id") == ''){
|
|
|
|
|
+ // tip("请选择职位");
|
|
|
|
|
+ // return false;
|
|
|
|
|
+ // }
|
|
|
|
|
+ // if(dept_selectinput.value==null || dept_selectinput.value==''){
|
|
|
|
|
+ // tip("请选择部门信息");
|
|
|
|
|
+ // return false ;
|
|
|
|
|
+ // }
|
|
|
|
|
+ var param ={
|
|
|
|
|
+ "name":idVal("check_rule_name") ,
|
|
|
|
|
+ "rule_type":idVal("rule_type"),
|
|
|
|
|
+ "id":cur_id
|
|
|
|
|
+ // "checked_dept_id":dept_selectinput.value,
|
|
|
|
|
+ // "checked_position_id":idVal("position_id"),
|
|
|
|
|
+ // "checked_person_type":1
|
|
|
|
|
+ };
|
|
|
|
|
+ addOrUpdateItem4Common(param,url,queryTable);
|
|
|
|
|
+ }, function() {
|
|
|
|
|
+
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
function idVal(id){
|
|
function idVal(id){
|
|
@@ -149,8 +211,8 @@ $(document).ready(function() {
|
|
|
queryTable();
|
|
queryTable();
|
|
|
|
|
|
|
|
// 考核项链接
|
|
// 考核项链接
|
|
|
- $(".datatable").delegate("td.modity-flag","click",function(){
|
|
|
|
|
- var obj = $('.datatable').data("data_cache")[$(this).attr("data-row")] ;
|
|
|
|
|
|
|
+ $("#ruleDatatable").delegate("td.modity-flag","click",function(){
|
|
|
|
|
+ var obj = $('#ruleDatatable').data("data_cache")[$(this).attr("data-row")] ;
|
|
|
$.zui.store.set("check_rule_id",obj.id);
|
|
$.zui.store.set("check_rule_id",obj.id);
|
|
|
$.zui.store.set("check_rule_name",obj.name);
|
|
$.zui.store.set("check_rule_name",obj.name);
|
|
|
changePage("/view/assess_management/assess_way_edit.html");
|
|
changePage("/view/assess_management/assess_way_edit.html");
|