|
|
@@ -11,8 +11,10 @@ var bootstrap = function ($, learun) { |
|
|
|
var page = { |
|
|
|
init: function () { |
|
|
|
page.initTree(); |
|
|
|
//page.initGird(); |
|
|
|
page.initGird(); |
|
|
|
page.search({ ParentID: '' }); |
|
|
|
page.bind(); |
|
|
|
|
|
|
|
}, |
|
|
|
bind: function () { |
|
|
|
|
|
|
@@ -36,14 +38,15 @@ var bootstrap = function ($, learun) { |
|
|
|
if (selectedParent.ID != null) { |
|
|
|
url = top.$.rootUrl + '/LogisticsManagement/Accommodation/Form?ParentID=' + selectedParent.ID + '&ParentName=' + selectedParent.Name; |
|
|
|
} else { |
|
|
|
url = top.$.rootUrl + '/LogisticsManagement/Accommodation/Form'; |
|
|
|
return learun.alert.warning("请选择上级!"); |
|
|
|
//url = top.$.rootUrl + '/LogisticsManagement/Accommodation/Form'; |
|
|
|
} |
|
|
|
learun.layerForm({ |
|
|
|
id: 'form', |
|
|
|
title: '新增', |
|
|
|
url: url, |
|
|
|
width: 600, |
|
|
|
height: 400, |
|
|
|
width: 900, |
|
|
|
height: 550, |
|
|
|
callBack: function (id) { |
|
|
|
return top[id].acceptClick(refreshGirdData); |
|
|
|
} |
|
|
@@ -61,8 +64,8 @@ var bootstrap = function ($, learun) { |
|
|
|
id: 'form', |
|
|
|
title: '编辑', |
|
|
|
url: top.$.rootUrl + '/LogisticsManagement/Accommodation/Form?keyValue=' + keyValue, |
|
|
|
width: 600, |
|
|
|
height: 400, |
|
|
|
width: 900, |
|
|
|
height: 550, |
|
|
|
callBack: function (id) { |
|
|
|
return top[id].acceptClick(refreshGirdData); |
|
|
|
} |
|
|
@@ -210,158 +213,142 @@ var bootstrap = function ($, learun) { |
|
|
|
}, |
|
|
|
// 初始化列表 |
|
|
|
initGird: function () { |
|
|
|
//$("#gridtable").removeClass("jfgrid-layout"); |
|
|
|
//$("#gridtable").removeAttr("style"); |
|
|
|
//$("#gridtable").empty(); |
|
|
|
$('#gridtable').jfGrid({ |
|
|
|
url: top.$.rootUrl + '/LogisticsManagement/Accommodation/GetPageList', |
|
|
|
headData: [ |
|
|
|
{ label: "名称", name: "Name", width: 100, align: "left" }, |
|
|
|
{ |
|
|
|
label: "宿舍楼", name: "ApartmentName", width: 100, align: "left" |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: "单元", name: "UnitName", width: 100, align: "left" }, |
|
|
|
{ |
|
|
|
label: "楼层", name: "FloorName", width: 100, align: "left" }, |
|
|
|
//{ |
|
|
|
// label: "学生", name: "StudentID", width: 100, align: "left", |
|
|
|
// formatterAsync: function (callback, value, row, op, $cell) { |
|
|
|
|
|
|
|
//$("#gridtable")[0].dfop = undefined; |
|
|
|
console.log('selectedParent.ChildType=', selectedParent.ChildType); |
|
|
|
if (selectedParent.ChildType == "5") { |
|
|
|
$('#gridtable').lrAuthorizeJfGridLei({ |
|
|
|
url: top.$.rootUrl + '/LogisticsManagement/Accommodation/GetPageList', |
|
|
|
headData: [ |
|
|
|
{ label: "名称", name: "Name", width: 100, align: "left" }, |
|
|
|
{ label: "学生名字", name: "StuName", width: 100, align: "left" }, |
|
|
|
{ |
|
|
|
label: "班级", name: "Class", width: 100, align: "left", |
|
|
|
formatterAsync: function (callback, value, row, op, $cell) { |
|
|
|
learun.clientdata.getAsync('custmerData', { |
|
|
|
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'bjsj', |
|
|
|
key: value, |
|
|
|
keyId: 'classno', |
|
|
|
callback: function (_data) { |
|
|
|
callback(_data['classname']); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: "性别", name: "Sex", width: 100, align: "left", |
|
|
|
formatterAsync: function (callback, value, row, op, $cell) { |
|
|
|
learun.clientdata.getAsync('dataItem', { |
|
|
|
key: value, |
|
|
|
code: 'usersex', |
|
|
|
callback: function (_data) { |
|
|
|
callback(_data.text); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
}, |
|
|
|
{ label: "负责人", name: "Functionary", width: 100, align: "left" }, |
|
|
|
{ label: "负责人电话", name: "Phone", width: 100, align: "left" }, |
|
|
|
{ label: "价格", name: "Price", width: 100, align: "left" }, |
|
|
|
{ label: "星级", name: "Starred", width: 100, align: "left" }, |
|
|
|
{ |
|
|
|
label: "是否独卫", name: "HasToilet", width: 100, align: "left", |
|
|
|
formatterAsync: function (callback, value, row, op, $cell) { |
|
|
|
learun.clientdata.getAsync('dataItem', { |
|
|
|
key: value, |
|
|
|
code: 'HasToilet', |
|
|
|
callback: function (_data) { |
|
|
|
callback(_data.text); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
}, |
|
|
|
{ label: "舍长", name: "Leader", width: 100, align: "left" }, |
|
|
|
{ label: "备注", name: "Remark", width: 100, align: "left" }, |
|
|
|
], |
|
|
|
mainId: 'ID', |
|
|
|
isPage: true, |
|
|
|
isMultiselect:true |
|
|
|
}); |
|
|
|
} else { |
|
|
|
$('#gridtable').lrAuthorizeJfGridLei({ |
|
|
|
url: top.$.rootUrl + '/LogisticsManagement/Accommodation/GetPageList', |
|
|
|
headData: [ |
|
|
|
{ label: "名称", name: "Name", width: 100, align: "left" }, |
|
|
|
{ label: "学生", name: "StudentID", width: 100, align: "left", |
|
|
|
formatterAsync: function (callback, value, row, op, $cell) { |
|
|
|
// learun.clientdata.getAsync('custmerData', { |
|
|
|
// url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'StuInfoBasic', |
|
|
|
// key: value, |
|
|
|
// keyId: 'stuid', |
|
|
|
// callback: function (_data) { |
|
|
|
// callback(_data['stuname']); |
|
|
|
// } |
|
|
|
// }); |
|
|
|
// } |
|
|
|
//}, |
|
|
|
{ label: "位置", name: "Address", width: 100, align: "left" }, |
|
|
|
{ |
|
|
|
label: "校区", name: "Campus", width: 100, align: "left", |
|
|
|
formatterAsync: function (callback, value, row, op, $cell) { |
|
|
|
|
|
|
|
learun.clientdata.getAsync('custmerData', { |
|
|
|
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'StuInfoBasic', |
|
|
|
key: value, |
|
|
|
keyId: 'stuid', |
|
|
|
callback: function (_data) { |
|
|
|
callback(_data['stuname']); |
|
|
|
} |
|
|
|
}); |
|
|
|
} }, |
|
|
|
{ label: "位置", name: "Address", width: 100, align: "left" }, |
|
|
|
{ |
|
|
|
label: "校区", name: "Campus", width: 100, align: "left", |
|
|
|
formatterAsync: function (callback, value, row, op, $cell) { |
|
|
|
learun.clientdata.getAsync('custmerData', { |
|
|
|
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'company', |
|
|
|
key: value, |
|
|
|
keyId: 'f_companyid', |
|
|
|
callback: function (_data) { |
|
|
|
callback(_data['f_fullname']); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: "系", name: "Dept", width: 100, align: "left", |
|
|
|
formatterAsync: function (callback, value, row, op, $cell) { |
|
|
|
learun.clientdata.getAsync('custmerData', { |
|
|
|
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdDeptInfo', |
|
|
|
key: value, |
|
|
|
keyId: 'deptno', |
|
|
|
callback: function (_data) { |
|
|
|
callback(_data['deptname']); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: "专业", name: "Major", width: 100, align: "left", |
|
|
|
formatterAsync: function (callback, value, row, op, $cell) { |
|
|
|
learun.clientdata.getAsync('custmerData', { |
|
|
|
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo', |
|
|
|
key: value, |
|
|
|
keyId: 'id', |
|
|
|
callback: function (_data) { |
|
|
|
callback(_data['majorname']); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
}, |
|
|
|
{ label: "班级", name: "Class", width: 100, align: "left" }, |
|
|
|
{ |
|
|
|
label: "性别", name: "Sex", width: 100, align: "left", |
|
|
|
formatterAsync: function (callback, value, row, op, $cell) { |
|
|
|
learun.clientdata.getAsync('dataItem', { |
|
|
|
key: value, |
|
|
|
code: 'usersex', |
|
|
|
callback: function (_data) { |
|
|
|
callback(_data.text); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
}, |
|
|
|
{ label: "负责人", name: "Functionary", width: 100, align: "left" }, |
|
|
|
{ label: "负责人电话", name: "Phone", width: 100, align: "left" }, |
|
|
|
{ label: "备注", name: "Remark", width: 100, align: "left" }, |
|
|
|
], |
|
|
|
mainId: 'ID', |
|
|
|
isPage: true, |
|
|
|
isMultiselect: true, |
|
|
|
sidx: 'ApartmentId asc,UnitId asc ,FloorId asc ', |
|
|
|
//sord: 'ASC', |
|
|
|
}); |
|
|
|
//if (selectedParent.ChildType == "5") { |
|
|
|
// $('#gridtable').lrAuthorizeJfGridLei({ |
|
|
|
// url: top.$.rootUrl + '/LogisticsManagement/Accommodation/GetPageList', |
|
|
|
// headData: [ |
|
|
|
// { label: "名称", name: "Name", width: 100, align: "left" }, |
|
|
|
// { label: "学生名字", name: "StuName", width: 100, align: "left" }, |
|
|
|
|
|
|
|
learun.clientdata.getAsync('custmerData', { |
|
|
|
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'company', |
|
|
|
key: value, |
|
|
|
keyId: 'f_companyid', |
|
|
|
callback: function (_data) { |
|
|
|
callback(_data['f_fullname']); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: "系", name: "Dept", width: 100, align: "left", |
|
|
|
formatterAsync: function (callback, value, row, op, $cell) { |
|
|
|
learun.clientdata.getAsync('custmerData', { |
|
|
|
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdDeptInfo', |
|
|
|
key: value, |
|
|
|
keyId: 'deptno', |
|
|
|
callback: function (_data) { |
|
|
|
callback(_data['deptname']); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: "专业", name: "Major", width: 100, align: "left", |
|
|
|
formatterAsync: function (callback, value, row, op, $cell) { |
|
|
|
learun.clientdata.getAsync('custmerData', { |
|
|
|
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo', |
|
|
|
key: value, |
|
|
|
keyId: 'majorno', |
|
|
|
callback: function (_data) { |
|
|
|
callback(_data['majorname']); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: "班级", name: "Class", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) { |
|
|
|
learun.clientdata.getAsync('custmerData', { |
|
|
|
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'bjsj', |
|
|
|
key: value, |
|
|
|
keyId: 'classno', |
|
|
|
callback: function (_data) { |
|
|
|
callback(_data['classname']); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: "性别", name: "Sex", width: 100, align: "left", |
|
|
|
formatterAsync: function (callback, value, row, op, $cell) { |
|
|
|
learun.clientdata.getAsync('dataItem', { |
|
|
|
key: value, |
|
|
|
code: 'usersex', |
|
|
|
callback: function (_data) { |
|
|
|
callback(_data.text); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
}, |
|
|
|
{ label: "负责人", name: "Functionary", width: 100, align: "left" }, |
|
|
|
{ label: "负责人电话", name: "Phone", width: 100, align: "left" }, |
|
|
|
{ label: "备注", name: "Remark", width: 100, align: "left" }, |
|
|
|
], |
|
|
|
mainId: 'ID', |
|
|
|
isPage: true, |
|
|
|
isMultiselect:true |
|
|
|
}); |
|
|
|
} |
|
|
|
// { label: "班级", name: "Class", width: 100, align: "left" }, |
|
|
|
// { |
|
|
|
// label: "性别", name: "Sex", width: 100, align: "left", |
|
|
|
// formatterAsync: function (callback, value, row, op, $cell) { |
|
|
|
// learun.clientdata.getAsync('dataItem', { |
|
|
|
// key: value, |
|
|
|
// code: 'usersex', |
|
|
|
// callback: function (_data) { |
|
|
|
// callback(_data.text); |
|
|
|
// } |
|
|
|
// }); |
|
|
|
// } |
|
|
|
// }, |
|
|
|
// { label: "负责人", name: "Functionary", width: 100, align: "left" }, |
|
|
|
// { label: "负责人电话", name: "Phone", width: 100, align: "left" }, |
|
|
|
// { label: "价格", name: "Price", width: 100, align: "left" }, |
|
|
|
// { label: "星级", name: "Starred", width: 100, align: "left" }, |
|
|
|
// { |
|
|
|
// label: "是否独卫", name: "HasToilet", width: 100, align: "left", |
|
|
|
// formatterAsync: function (callback, value, row, op, $cell) { |
|
|
|
// learun.clientdata.getAsync('dataItem', { |
|
|
|
// key: value, |
|
|
|
// code: 'HasToilet', |
|
|
|
// callback: function (_data) { |
|
|
|
// callback(_data.text); |
|
|
|
// } |
|
|
|
// }); |
|
|
|
// } |
|
|
|
// }, |
|
|
|
// { label: "舍长", name: "Leader", width: 100, align: "left" }, |
|
|
|
// { label: "备注", name: "Remark", width: 100, align: "left" }, |
|
|
|
// ], |
|
|
|
// mainId: 'ID', |
|
|
|
// isPage: true, |
|
|
|
// isMultiselect:true |
|
|
|
// }); |
|
|
|
//} else { |
|
|
|
|
|
|
|
//} |
|
|
|
|
|
|
|
//page.search(); |
|
|
|
}, |
|
|
|
search: function (param) { |
|
|
@@ -372,9 +359,12 @@ var bootstrap = function ($, learun) { |
|
|
|
refreshGirdData = function () { |
|
|
|
//page.initTree(); |
|
|
|
if (!!selectedParent.ID) { |
|
|
|
|
|
|
|
//var param = { ParentID: selectedParent.ID }; |
|
|
|
//$('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); |
|
|
|
page.initTree(); |
|
|
|
page.search({ ParentID: selectedParent.ID }); |
|
|
|
} else { |
|
|
|
page.initTree(); |
|
|
|
page.search(); |
|
|
|
} |
|
|
|
}; |
|
|
|