|
|
@@ -70,6 +70,10 @@ var bootstrap = function ($, learun) { |
|
|
|
// 编辑 |
|
|
|
$('#lr_edit').on('click', function () { |
|
|
|
var keyValue = $('#gridtable').jfGridValue('Id'); |
|
|
|
if (keyValue.indexOf(",")>=0) { |
|
|
|
learun.alert.warning("只允许编辑一条!"); |
|
|
|
return false; |
|
|
|
} |
|
|
|
selectedRow = $('#gridtable').jfGridGet('rowdata'); |
|
|
|
if (learun.checkrow(keyValue)) { |
|
|
|
if (selectedRow.Status == 1) {//提交 |
|
|
@@ -102,9 +106,25 @@ var bootstrap = function ($, learun) { |
|
|
|
var keyValue = $('#gridtable').jfGridValue('Id'); |
|
|
|
selectedRow = $('#gridtable').jfGridGet('rowdata'); |
|
|
|
if (learun.checkrow(keyValue)) { |
|
|
|
if (selectedRow.Status !== 0) { |
|
|
|
learun.alert.warning("当前课程异动记录已提交,无法删除!"); |
|
|
|
var status = selectedRow.map(item => item.Status); |
|
|
|
let newList3 = []; |
|
|
|
let map = new Map() |
|
|
|
status.forEach((item) => { |
|
|
|
// 如果map.has指定的item不存在,那么就设置key和value 这个item就是当前map里面不存在的key,把这个item添加到新数组 |
|
|
|
// 如果下次出现重复的item,那么map.has(item等于ture 取反 !map.has(item) 不执行 |
|
|
|
if (!map.has(item)) { |
|
|
|
map.set(item, true) |
|
|
|
newList3.push(item) |
|
|
|
} |
|
|
|
}) |
|
|
|
if (newList3.length > 1) {//.Status !== 0) { |
|
|
|
learun.alert.warning("当前课程异动记录已提交!"); |
|
|
|
return false; |
|
|
|
} else { |
|
|
|
if (newList3[0] !== 0) { |
|
|
|
learun.alert.warning("当前课程异动记录已提交!"); |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
learun.layerConfirm('是否确认删除该项!', function (res) { |
|
|
|
if (res) { |
|
|
@@ -121,9 +141,25 @@ var bootstrap = function ($, learun) { |
|
|
|
var keyValue = $('#gridtable').jfGridValue('Id'); |
|
|
|
selectedRow = $('#gridtable').jfGridGet('rowdata'); |
|
|
|
if (learun.checkrow(keyValue)) { |
|
|
|
if (selectedRow.Status !== 0) { |
|
|
|
var status = selectedRow.map(item => item.Status); |
|
|
|
let newList3 = []; |
|
|
|
let map = new Map() |
|
|
|
status.forEach((item) => { |
|
|
|
// 如果map.has指定的item不存在,那么就设置key和value 这个item就是当前map里面不存在的key,把这个item添加到新数组 |
|
|
|
// 如果下次出现重复的item,那么map.has(item等于ture 取反 !map.has(item) 不执行 |
|
|
|
if (!map.has(item)) { |
|
|
|
map.set(item, true) |
|
|
|
newList3.push(item) |
|
|
|
} |
|
|
|
}) |
|
|
|
if (newList3.length > 1) {//.Status !== 0) { |
|
|
|
learun.alert.warning("当前课程异动记录已提交!"); |
|
|
|
return false; |
|
|
|
} else { |
|
|
|
if (newList3[0] !== 0) { |
|
|
|
learun.alert.warning("当前课程异动记录已提交!"); |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
learun.layerConfirm('是否确认提交该项!', function (res) { |
|
|
|
if (res) { |
|
|
@@ -176,6 +212,7 @@ var bootstrap = function ($, learun) { |
|
|
|
{ label: "调度备注", name: "AttemperRemark", width: 100, align: "left" }, |
|
|
|
{ label: "学年", name: "AcademicYearNo", width: 100, align: "left" }, |
|
|
|
{ label: "学期", name: "Semester", width: 100, align: "left" }, |
|
|
|
{ label: "学期", name: "Status", width: 100, align: "left" }, |
|
|
|
{ |
|
|
|
label: "系部", name: "DeptNo", width: 100, align: "left", |
|
|
|
formatterAsync: function (callback, value, row, op, $cell) { |
|
|
@@ -525,6 +562,7 @@ var bootstrap = function ($, learun) { |
|
|
|
//}, |
|
|
|
], |
|
|
|
mainId: 'Id', |
|
|
|
isMultiselect: true, |
|
|
|
isPage: true, |
|
|
|
sord: 'desc', |
|
|
|
sidx: 'CreateTime' |
|
|
|