@@ -0,0 +1,56 @@ | |||
@{ | |||
ViewBag.Title = "教材库存表"; | |||
Layout = "~/Views/Shared/_Form.cshtml"; | |||
} | |||
<div class="lr-form-wrap"> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookInOut"> | |||
<div class="lr-form-item-title">库存单</div> | |||
<input id="BookCode" type="text" class="form-control" readonly /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookInOut"> | |||
<div class="lr-form-item-title">课程</div> | |||
<div id="LessonNo" isvalid="yes" checkexpession="NotNull" readonly></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="TextBookInOut"> | |||
<div class="lr-form-item-title">所选书籍</div> | |||
<input id="TextBookName" type="text" class="form-control" readonly /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookInOut"> | |||
<div class="lr-form-item-title">出版号</div> | |||
<input id="PublishNo" type="text" class="form-control" readonly /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookInOut"> | |||
<div class="lr-form-item-title">作者</div> | |||
<input id="FirstAuthor" type="text" class="form-control" readonly /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookInOut"> | |||
<div class="lr-form-item-title">其他作者</div> | |||
<input id="OtherAuthor" type="text" class="form-control" readonly /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookInOut"> | |||
<div class="lr-form-item-title">出版社</div> | |||
<input id="Publisher" type="text" class="form-control" readonly /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookInOut"> | |||
<div class="lr-form-item-title">版次</div> | |||
<input id="Edition" type="text" class="form-control" readonly /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookInOut"> | |||
<div class="lr-form-item-title">当前库存</div> | |||
<input id="FinallyNum" type="text" class="form-control" readonly /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="TextBookInOut"> | |||
<div class="lr-form-item-title">备注</div> | |||
<textarea id="Remark" class="form-control" style="height: 100px;" readonly></textarea> | |||
</div> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">明细操作</div> | |||
<input id="detailadd" type="button" class="btn btn-success" value="添加入库单" /> | |||
@*<input id="detailedit" type="button" class="btn btn-warning" value="编辑明细" />*@ | |||
<input id="detaildel" type="button" class="btn btn-danger" value="移除入库单" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item lr-form-item-grid"> | |||
<div id="TextBookIn"></div> | |||
</div> | |||
</div> | |||
@Html.AppendJsFile("/Areas/EducationalAdministration/Views/TextBookIn/Form.js") |
@@ -0,0 +1,163 @@ | |||
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) | |||
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
* 创建人:超级管理员 | |||
* 日 期:2022-03-02 10:37 | |||
* 描 述:教材库存表 | |||
*/ | |||
var acceptClick; | |||
var keyValue = request('keyValue'); | |||
// 设置权限 | |||
var setAuthorize; | |||
// 设置表单数据 | |||
var setFormData; | |||
// 验证数据是否填写完整 | |||
var validForm; | |||
// 保存数据 | |||
var save; | |||
var selectedRow; | |||
var refreshGirdData; | |||
var tempdatra = new Array(); | |||
var bootstrap = function ($, learun) { | |||
"use strict"; | |||
// 设置权限 | |||
setAuthorize = function (data) { | |||
}; | |||
var page = { | |||
init: function () { | |||
$('.lr-form-wrap').lrscroll(); | |||
$("#detailadd").on('click', function () { | |||
selectedRow = null; | |||
learun.layerForm({ | |||
id: 'formTextBookIn', | |||
title: '申请入库', | |||
url: top.$.rootUrl + '/EducationalAdministration/TextBookIn/FormIn', | |||
width: 500, | |||
height: 500, | |||
callBack: function (id) { | |||
return top[id].acceptClick(refreshGirdData); | |||
} | |||
}); | |||
}); | |||
//$("#detailedit").on('click', function () { | |||
// var keyValue = $('#TextBookIn').jfGridValue('ID'); | |||
// selectedRow = $('#TextBookIn').jfGridGet('rowdata'); | |||
// if (learun.checkrow(keyValue)) { | |||
// learun.layerForm({ | |||
// id: 'formTextBookIn', | |||
// title: '修改入库单', | |||
// url: top.$.rootUrl + '/EducationalAdministration/TextBookIn/FormIn?keyValue=' + keyValue, | |||
// width: 600, | |||
// height: 350, | |||
// callBack: function (id) { | |||
// return top[id].acceptClick(refreshGirdData); | |||
// } | |||
// }); | |||
// } | |||
//}); | |||
$("#detaildel").on('click', function () { | |||
var keyValue = $('#TextBookIn').jfGridValue('ID'); | |||
if (learun.checkrow(keyValue)) { | |||
learun.layerConfirm('是否确认删除该项!', function (res, index) { | |||
if (res) { | |||
$.each(tempdatra, function (key, val) { | |||
if (tempdatra[key].ID === keyValue) { | |||
// order -= tempdatra[key].TeachSum + tempdatra[key].StuSum; | |||
tempdatra.splice(key, 1); | |||
} | |||
}); | |||
$('#TextBookIn').jfGridSet('refreshdata', tempdatra); | |||
top.layer.close(index); | |||
} | |||
}); | |||
} | |||
}); | |||
page.bind(); | |||
page.initData(); | |||
}, | |||
bind: function () { | |||
$('#LessonNo').lrDataSourceSelect({ code: 'LessonInfo', value: 'lessonno', text: 'lessonname' }); | |||
$('#TextBookIn').jfGrid({ | |||
headData: [ | |||
{ label: '入库单', name: 'BookCode', width: 180, align: 'left' }, | |||
{ label: '入库数量', name: 'variate', width: 100, align: 'left' }, | |||
{ label: '入库时间', name: 'CreateTime', width: 200, align: 'left' }, | |||
{ label: '入库用户', name: 'CrateUserID', width: 100, align: 'left' }, | |||
{ label: '备注', name: 'Remark', width: 100, align: 'left' }, | |||
], | |||
height: 400, | |||
mainId: 'CreateTime desc', | |||
reloadSelected: false, | |||
}); | |||
}, | |||
initData: function () { | |||
if (!!keyValue) { | |||
$.lrSetForm(top.$.rootUrl + '/EducationalAdministration/TextBookIn/GetFormDataEdit?keyValue=' + keyValue, function (data) { | |||
for (var id in data) { | |||
if (!!data[id].length && data[id].length > 0) { | |||
$('#' + id).jfGridSet('refreshdata', data[id]); | |||
} | |||
else { | |||
$('[data-table="' + id + '"]').lrSetFormData(data[id]); | |||
} | |||
} | |||
}); | |||
} | |||
} | |||
}; | |||
refreshGirdData = function (temprow) { | |||
var ifnewrow = true; | |||
$.each(tempdatra, function (key, val) { | |||
if (tempdatra[key].BookCode === temprow.InOutBook) { | |||
tempdatra[key] = temprow; | |||
ifnewrow = false; | |||
} | |||
}); | |||
if (ifnewrow) { | |||
tempdatra.push(temprow); | |||
} | |||
$('#TextBookIn').jfGridSet('refreshdata', tempdatra); | |||
}; | |||
// 设置表单数据 | |||
setFormData = function (processId, param, callback) { | |||
if (!!processId) { | |||
$.lrSetForm(top.$.rootUrl + '/EducationalAdministration/TextBookIn/GetFormDataByProcessId?processId=' + processId, function (data) { | |||
for (var id in data) { | |||
if (!!data[id] && data[id].length > 0) { | |||
$('#' + id).jfGridSet('refreshdata', data[id]); | |||
} | |||
else { | |||
if (id == 'TextBookIn' && data[id]) { | |||
keyValue = data[id].ID; | |||
} | |||
$('[data-table="' + id + '"]').lrSetFormData(data[id]); | |||
} | |||
} | |||
}); | |||
} | |||
} | |||
// 验证数据是否填写完整 | |||
validForm = function () { | |||
var datas = $('#TextBookIn').jfGridGet('rowdatas'); | |||
if (datas == null || datas.length == 0) { | |||
learun.alert.warning("申请未包含入库申请!请先添加入库申请!"); | |||
return false; | |||
} | |||
return true; | |||
}; | |||
// 保存数据 | |||
save = function (callBack) { | |||
var postData = {}; | |||
var formData = $('[data-table="TextBookInOut"]').lrGetFormData(); | |||
postData.strEntity = JSON.stringify(formData); | |||
postData.strTextBookInList = JSON.stringify($('#TextBookIn').jfGridGet('rowdatas')); | |||
$.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/TextBookIn/SaveForm?keyValue=' + keyValue, postData, function (res) { | |||
// 保存成功后才回调 | |||
if (!!callBack) { | |||
callBack(); | |||
} | |||
}); | |||
}; | |||
page.init(); | |||
} |
@@ -0,0 +1,55 @@ | |||
@{ | |||
ViewBag.Title = "教材库存表"; | |||
Layout = "~/Views/Shared/_Form.cshtml"; | |||
} | |||
<div class="lr-form-wrap"> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookInOut"> | |||
<div class="lr-form-item-title">库存单</div> | |||
<input id="BookCode" type="text" class="form-control" readonly /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookInOut"> | |||
<div class="lr-form-item-title">课程</div> | |||
<div id="LessonNo" isvalid="yes" checkexpession="NotNull" readonly></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="TextBookInOut"> | |||
<div class="lr-form-item-title">所选书籍</div> | |||
<input id="TextBookName" type="text" class="form-control" readonly /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookInOut"> | |||
<div class="lr-form-item-title">出版号</div> | |||
<input id="PublishNo" type="text" class="form-control" readonly /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookInOut"> | |||
<div class="lr-form-item-title">作者</div> | |||
<input id="FirstAuthor" type="text" class="form-control" readonly /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookInOut"> | |||
<div class="lr-form-item-title">其他作者</div> | |||
<input id="OtherAuthor" type="text" class="form-control" readonly /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookInOut"> | |||
<div class="lr-form-item-title">出版社</div> | |||
<input id="Publisher" type="text" class="form-control" readonly /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookInOut"> | |||
<div class="lr-form-item-title">版次</div> | |||
<input id="Edition" type="text" class="form-control" readonly /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookInOut"> | |||
<div class="lr-form-item-title">当前库存</div> | |||
<input id="FinallyNum" type="text" class="form-control" readonly /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="TextBookInOut"> | |||
<div class="lr-form-item-title">备注</div> | |||
<textarea id="Remark" class="form-control" style="height: 100px;" readonly></textarea> | |||
</div> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">明细操作</div> | |||
@*<input id="detailedit" type="button" class="btn btn-warning" value="编辑明细" />*@ | |||
<input id="detaildel" type="button" class="btn btn-danger" value="删除入库单" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item lr-form-item-grid"> | |||
<div id="TextBookIn"></div> | |||
</div> | |||
</div> | |||
@Html.AppendJsFile("/Areas/EducationalAdministration/Views/TextBookIn/FormDelete.js") |
@@ -0,0 +1,132 @@ | |||
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) | |||
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
* 创建人:超级管理员 | |||
* 日 期:2022-03-02 10:37 | |||
* 描 述:教材库存表 | |||
*/ | |||
var acceptClick; | |||
var keyValue = request('keyValue'); | |||
var DelkeyValue = request('DelkeyValue'); | |||
// 设置权限 | |||
var setAuthorize; | |||
// 设置表单数据 | |||
var setFormData; | |||
// 验证数据是否填写完整 | |||
var validForm; | |||
// 保存数据 | |||
var save; | |||
var selectedRow; | |||
var refreshGirdData; | |||
var tempdatra = new Array(); | |||
var bootstrap = function ($, learun) { | |||
"use strict"; | |||
// 设置权限 | |||
setAuthorize = function (data) { | |||
}; | |||
var page = { | |||
init: function () { | |||
$('.lr-form-wrap').lrscroll(); | |||
page.bind(); | |||
page.initData(); | |||
}, | |||
bind: function () { | |||
$('#LessonNo').lrDataSourceSelect({ code: 'LessonInfo', value: 'lessonno', text: 'lessonname' }); | |||
$('#TextBookIn').jfGrid({ | |||
headData: [ | |||
{ label: '入库单', name: 'BookCode', width: 180, align: 'left' }, | |||
{ label: '入库数量', name: 'variate', width: 100, align: 'left' }, | |||
{ label: '入库时间', name: 'CreateTime', width: 200, align: 'left' }, | |||
{ label: '入库用户', name: 'CrateUserID', width: 100, align: 'left' }, | |||
{ label: '备注', name: 'Remark', width: 100, align: 'left' }, | |||
], | |||
height: 400, | |||
mainId: 'CreateTime desc', | |||
reloadSelected: false, | |||
}); | |||
$("#detaildel").on('click', function () { | |||
var NewkeyValue = $('#TextBookIn').jfGridValue('ID'); | |||
if (learun.checkrow(NewkeyValue)) { | |||
learun.layerConfirm('是否确认删除该项!', function (res, index) { | |||
if (res) { | |||
learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/TextBookIn/DeleteForm', { keyValue: NewkeyValue }, function () { | |||
var index = top.layer.getFrameIndex(window.name); | |||
console.log('index', index); | |||
top.layer.close(index); | |||
}); | |||
} | |||
}); | |||
} | |||
}); | |||
}, | |||
initData: function () { | |||
if (!!keyValue) { | |||
$.lrSetForm(top.$.rootUrl + '/EducationalAdministration/TextBookIn/GetFormData?keyValue=' + keyValue, function (data) { | |||
for (var id in data) { | |||
if (!!data[id].length && data[id].length > 0) { | |||
$('#' + id).jfGridSet('refreshdata', data[id]); | |||
} | |||
else { | |||
$('[data-table="' + id + '"]').lrSetFormData(data[id]); | |||
} | |||
} | |||
}); | |||
} | |||
} | |||
}; | |||
refreshGirdData = function (temprow) { | |||
var ifnewrow = true; | |||
$.each(tempdatra, function (key, val) { | |||
if (tempdatra[key].BookCode === temprow.InOutBook) { | |||
tempdatra[key] = temprow; | |||
ifnewrow = false; | |||
} | |||
}); | |||
if (ifnewrow) { | |||
tempdatra.push(temprow); | |||
} | |||
$('#TextBookIn').jfGridSet('refreshdata', tempdatra); | |||
}; | |||
// 设置表单数据 | |||
setFormData = function (processId, param, callback) { | |||
if (!!processId) { | |||
$.lrSetForm(top.$.rootUrl + '/EducationalAdministration/TextBookIn/GetFormDataByProcessId?processId=' + processId, function (data) { | |||
for (var id in data) { | |||
if (!!data[id] && data[id].length > 0) { | |||
$('#' + id).jfGridSet('refreshdata', data[id]); | |||
} | |||
else { | |||
if (id == 'TextBookIn' && data[id]) { | |||
keyValue = data[id].ID; | |||
} | |||
$('[data-table="' + id + '"]').lrSetFormData(data[id]); | |||
} | |||
} | |||
}); | |||
} | |||
} | |||
// 验证数据是否填写完整 | |||
validForm = function () { | |||
var datas = $('#TextBookIn').jfGridGet('rowdatas'); | |||
if (datas == null || datas.length == 0) { | |||
learun.alert.warning("申请未包含入库申请!请先添加入库申请!"); | |||
return false; | |||
} | |||
return true; | |||
}; | |||
// 保存数据 | |||
save = function (callBack) { | |||
var postData = {}; | |||
var formData = $('[data-table="TextBookInOut"]').lrGetFormData(); | |||
postData.strEntity = JSON.stringify(formData); | |||
postData.strTextBookInList = JSON.stringify($('#TextBookIn').jfGridGet('rowdatas')); | |||
$.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/TextBookIn/SaveForm?keyValue=' + keyValue, postData, function (res) { | |||
// 保存成功后才回调 | |||
if (!!callBack) { | |||
callBack(); | |||
} | |||
}); | |||
}; | |||
page.init(); | |||
} |
@@ -0,0 +1,30 @@ | |||
@{ | |||
ViewBag.Title = "教材入库"; | |||
Layout = "~/Views/Shared/_Form.cshtml"; | |||
} | |||
<script> | |||
var InBookCode = "@ViewBag.BookCode"; | |||
</script> | |||
<div class="lr-form-wrap" id="form"> | |||
<div class="col-xs-12 lr-form-item" data-table="TextBookIn"> | |||
<div class="lr-form-item-title">入库单<font face="宋体">*</font></div> | |||
<input id="BookCode" type="text" class="form-control" readonly="readonly" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="TextBookIn"> | |||
<div class="lr-form-item-title">数量<font face="宋体">*</font></div> | |||
<input id="variate" type="number" class="form-control" isvalid="yes" checkexpession="PositiveInteger" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="BC_ShopPurchaseRecord"> | |||
<div class="lr-form-item-title">创建人<font face="宋体">*</font></div> | |||
<input id="CrateUserID" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="BC_ShopPurchaseRecord"> | |||
<div class="lr-form-item-title">创建时间<font face="宋体">*</font></div> | |||
<input id="CreateTime" type="text" class="form-control lr-input-wdatepicker" isvalid="yes" checkexpession="DateTime" onfocus="WdatePicker({ dateFmt:'yyyy-MM-dd HH:mm:ss',onpicked: function () { $('#CreateTime').trigger('change'); } })" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">备注</div> | |||
<textarea id="Remark" class="form-control" style="height:100px;"></textarea> | |||
</div> | |||
</div> | |||
@Html.AppendJsFile("/Areas/EducationalAdministration/Views/TextBookIn/FormIn.js") |
@@ -0,0 +1,57 @@ | |||
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) | |||
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
* 创建人:超级管理员 | |||
* 日 期:2022-03-03 10:15 | |||
* 描 述:教材入库 | |||
*/ | |||
var acceptClick; | |||
var keyValue = request('keyValue'); | |||
var bootstrap = function ($, learun) { | |||
"use strict"; | |||
var page = { | |||
init: function () { | |||
$('.lr-form-wrap').lrscroll(); | |||
page.bind(); | |||
page.initData(); | |||
}, | |||
bind: function () { | |||
}, | |||
initData: function () { | |||
if (!!keyValue) { | |||
$.lrSetForm(top.$.rootUrl + '/EducationalAdministration/TextBookIn/GetFormData?keyValue=' + keyValue, function (data) { | |||
for (var id in data) { | |||
if (!!data[id].length && data[id].length > 0) { | |||
$('#' + id).jfGridSet('refreshdata', data[id]); | |||
} | |||
else { | |||
$('[data-table="' + id + '"]').lrSetFormData(data[id]); | |||
} | |||
} | |||
}); | |||
} else { | |||
$("#BookCode").val(InBookCode); | |||
} | |||
} | |||
}; | |||
// 保存数据 | |||
acceptClick = function (callBack) { | |||
if (!$('body').lrValidform()) { | |||
return false; | |||
} | |||
var postData = $('body').lrGetFormData(); | |||
if (!!keyValue) { | |||
if (!!selectedRow) { | |||
postData.ID = selectedRow.ID; | |||
} | |||
} else { | |||
postData.ID = learun.newGuid(); | |||
} | |||
if (!!callBack) { | |||
callBack(postData); | |||
return true; | |||
} | |||
}; | |||
page.init(); | |||
} |
@@ -0,0 +1,50 @@ | |||
@{ | |||
ViewBag.Title = "教材库存表"; | |||
Layout = "~/Views/Shared/_Form.cshtml"; | |||
} | |||
<div class="lr-form-wrap"> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookInOut"> | |||
<div class="lr-form-item-title">库存单</div> | |||
<input id="BookCode" type="text" class="form-control" readonly /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookInOut"> | |||
<div class="lr-form-item-title">课程</div> | |||
<div id="LessonNo" isvalid="yes" checkexpession="NotNull" readonly></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="TextBookInOut"> | |||
<div class="lr-form-item-title">所选书籍</div> | |||
<input id="TextBookName" type="text" class="form-control" readonly /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookInOut"> | |||
<div class="lr-form-item-title">出版号</div> | |||
<input id="PublishNo" type="text" class="form-control" readonly /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookInOut"> | |||
<div class="lr-form-item-title">作者</div> | |||
<input id="FirstAuthor" type="text" class="form-control" readonly /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookInOut"> | |||
<div class="lr-form-item-title">其他作者</div> | |||
<input id="OtherAuthor" type="text" class="form-control" readonly /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookInOut"> | |||
<div class="lr-form-item-title">出版社</div> | |||
<input id="Publisher" type="text" class="form-control" readonly /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookInOut"> | |||
<div class="lr-form-item-title">版次</div> | |||
<input id="Edition" type="text" class="form-control" readonly /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookInOut"> | |||
<div class="lr-form-item-title">当前库存</div> | |||
<input id="FinallyNum" type="text" class="form-control" readonly /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="TextBookInOut"> | |||
<div class="lr-form-item-title">备注</div> | |||
<textarea id="Remark" class="form-control" style="height: 100px;" readonly></textarea> | |||
</div> | |||
<div class="col-xs-12 lr-form-item lr-form-item-grid"> | |||
<div id="TextBookIn"></div> | |||
</div> | |||
</div> | |||
@Html.AppendJsFile("/Areas/EducationalAdministration/Views/TextBookIn/FormView.js") |
@@ -0,0 +1,117 @@ | |||
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) | |||
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
* 创建人:超级管理员 | |||
* 日 期:2022-03-02 10:37 | |||
* 描 述:教材库存表 | |||
*/ | |||
var acceptClick; | |||
var keyValue = request('keyValue'); | |||
// 设置权限 | |||
var setAuthorize; | |||
// 设置表单数据 | |||
var setFormData; | |||
// 验证数据是否填写完整 | |||
var validForm; | |||
// 保存数据 | |||
var save; | |||
var selectedRow; | |||
var refreshGirdData; | |||
var tempdatra = new Array(); | |||
var bootstrap = function ($, learun) { | |||
"use strict"; | |||
// 设置权限 | |||
setAuthorize = function (data) { | |||
}; | |||
var page = { | |||
init: function () { | |||
$('.lr-form-wrap').lrscroll(); | |||
page.bind(); | |||
page.initData(); | |||
}, | |||
bind: function () { | |||
$('#LessonNo').lrDataSourceSelect({ code: 'LessonInfo', value: 'lessonno', text: 'lessonname' }); | |||
$('#TextBookIn').jfGrid({ | |||
headData: [ | |||
{ label: '入库单', name: 'BookCode', width: 180, align: 'left' }, | |||
{ label: '入库数量', name: 'variate', width: 100, align: 'left' }, | |||
{ label: '入库时间', name: 'CreateTime', width: 200, align: 'left' }, | |||
{ label: '入库用户', name: 'CrateUserID', width: 100, align: 'left' }, | |||
{ label: '备注', name: 'Remark', width: 100, align: 'left' }, | |||
], | |||
height: 400, | |||
mainId: 'CreateTime desc', | |||
reloadSelected: false, | |||
}); | |||
}, | |||
initData: function () { | |||
if (!!keyValue) { | |||
$.lrSetForm(top.$.rootUrl + '/EducationalAdministration/TextBookIn/GetFormData?keyValue=' + keyValue, function (data) { | |||
for (var id in data) { | |||
if (!!data[id].length && data[id].length > 0) { | |||
$('#' + id).jfGridSet('refreshdata', data[id]); | |||
} | |||
else { | |||
$('[data-table="' + id + '"]').lrSetFormData(data[id]); | |||
} | |||
} | |||
}); | |||
} | |||
} | |||
}; | |||
refreshGirdData = function (temprow) { | |||
var ifnewrow = true; | |||
$.each(tempdatra, function (key, val) { | |||
if (tempdatra[key].BookCode === temprow.InOutBook) { | |||
tempdatra[key] = temprow; | |||
ifnewrow = false; | |||
} | |||
}); | |||
if (ifnewrow) { | |||
tempdatra.push(temprow); | |||
} | |||
$('#TextBookIn').jfGridSet('refreshdata', tempdatra); | |||
}; | |||
// 设置表单数据 | |||
setFormData = function (processId, param, callback) { | |||
if (!!processId) { | |||
$.lrSetForm(top.$.rootUrl + '/EducationalAdministration/TextBookIn/GetFormDataByProcessId?processId=' + processId, function (data) { | |||
for (var id in data) { | |||
if (!!data[id] && data[id].length > 0) { | |||
$('#' + id).jfGridSet('refreshdata', data[id]); | |||
} | |||
else { | |||
if (id == 'TextBookIn' && data[id]) { | |||
keyValue = data[id].ID; | |||
} | |||
$('[data-table="' + id + '"]').lrSetFormData(data[id]); | |||
} | |||
} | |||
}); | |||
} | |||
} | |||
// 验证数据是否填写完整 | |||
validForm = function () { | |||
var datas = $('#TextBookIn').jfGridGet('rowdatas'); | |||
if (datas == null || datas.length == 0) { | |||
learun.alert.warning("申请未包含入库申请!请先添加入库申请!"); | |||
return false; | |||
} | |||
return true; | |||
}; | |||
// 保存数据 | |||
save = function (callBack) { | |||
var postData = {}; | |||
var formData = $('[data-table="TextBookInOut"]').lrGetFormData(); | |||
postData.strEntity = JSON.stringify(formData); | |||
postData.strTextBookInList = JSON.stringify($('#TextBookIn').jfGridGet('rowdatas')); | |||
$.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/TextBookIn/SaveForm?keyValue=' + keyValue, postData, function (res) { | |||
// 保存成功后才回调 | |||
if (!!callBack) { | |||
callBack(); | |||
} | |||
}); | |||
}; | |||
page.init(); | |||
} |
@@ -0,0 +1,36 @@ | |||
@{ | |||
ViewBag.Title = "教材入库"; | |||
Layout = "~/Views/Shared/_Index.cshtml"; | |||
} | |||
<div class="lr-layout "> | |||
<div class="lr-layout-center"> | |||
<div class="lr-layout-wrap lr-layout-wrap-notitle "> | |||
<div class="lr-layout-tool"> | |||
<div class="lr-layout-tool-left"> | |||
<div class="lr-layout-tool-item"> | |||
<div id="multiple_condition_query"> | |||
<div class="lr-query-formcontent"> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">教材</div> | |||
<input id="TextBookName" type="text" class="form-control" /> | |||
</div> | |||
</div> | |||
</div> | |||
</div> | |||
</div> | |||
<div class="lr-layout-tool-right"> | |||
<div class=" btn-group btn-group-sm"> | |||
<a id="lr_refresh" class="btn btn-default"><i class="fa fa-refresh"></i></a> | |||
</div> | |||
<div class=" btn-group btn-group-sm" learun-authorize="yes"> | |||
<a id="lr_edit" class="btn btn-default"><i class="fa fa-pencil-square-o"></i> 教材入库</a> | |||
<a id="lr_view" class="btn btn-default"><i class="fa fa-pencil-square-o"></i> 教材明细查看</a> | |||
<a id="lr_delete" class="btn btn-default"><i class="fa fa-trash-o"></i> 删除明细</a> | |||
</div> | |||
</div> | |||
</div> | |||
<div class="lr-layout-body" id="gridtable"></div> | |||
</div> | |||
</div> | |||
</div> | |||
@Html.AppendJsFile("/Areas/EducationalAdministration/Views/TextBookIn/Index.js") |
@@ -0,0 +1,128 @@ | |||
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) | |||
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
* 创建人:超级管理员 | |||
* 日 期:2022-03-03 10:15 | |||
* 描 述:教材入库 | |||
*/ | |||
var refreshGirdData; | |||
var bootstrap = function ($, learun) { | |||
"use strict"; | |||
var page = { | |||
init: function () { | |||
page.initGird(); | |||
page.bind(); | |||
}, | |||
bind: function () { | |||
$('#multiple_condition_query').lrMultipleQuery(function (queryJson) { | |||
page.search(queryJson); | |||
}, 220, 400); | |||
// 刷新 | |||
$('#lr_refresh').on('click', function () { | |||
location.reload(); | |||
}); | |||
// 入库 | |||
$('#lr_edit').on('click', function () { | |||
var keyValue = $('#gridtable').jfGridValue('ID'); | |||
if (learun.checkrow(keyValue)) { | |||
learun.layerForm({ | |||
id: 'form', | |||
title: '编辑', | |||
url: top.$.rootUrl + '/EducationalAdministration/TextBookIn/Form?keyValue=' + keyValue, | |||
width: 800, | |||
height: 800, | |||
callBack: function (id) { | |||
var res = false; | |||
// 验证数据 | |||
res = top[id].validForm(); | |||
// 保存数据 | |||
if (res) { | |||
res = top[id].save('', function () { | |||
page.search(); | |||
}); | |||
} | |||
return res; | |||
} | |||
}); | |||
} | |||
}); | |||
// 查看 | |||
$('#lr_view').on('click', function () { | |||
var keyValue = $('#gridtable').jfGridValue('ID'); | |||
if (learun.checkrow(keyValue)) { | |||
learun.layerForm({ | |||
id: 'formview', | |||
title: '查看', | |||
url: top.$.rootUrl + '/EducationalAdministration/TextBookIn/FormView?keyValue=' + keyValue, | |||
width: 1000, | |||
height: 700, | |||
btn: null, | |||
}); | |||
} | |||
}); | |||
// 删除 | |||
$('#lr_delete').on('click', function () { | |||
var keyValue = $('#gridtable').jfGridValue('ID'); | |||
if (learun.checkrow(keyValue)) { | |||
learun.layerForm({ | |||
id: 'formdelete', | |||
title: '删除明细', | |||
url: top.$.rootUrl + '/EducationalAdministration/TextBookIn/FormDelete?keyValue=' + keyValue, | |||
width: 1000, | |||
height: 700, | |||
btn: null, | |||
}); | |||
} | |||
}); | |||
}, | |||
// 初始化列表 | |||
initGird: function () { | |||
$('#gridtable').lrAuthorizeJfGrid({ | |||
url: top.$.rootUrl + '/EducationalAdministration/TextBookInOut/GetPageList', | |||
headData: [ | |||
{ label: '库存单号', name: 'BookCode', width: 200, align: "left" }, | |||
{ | |||
label: "课程", name: "LessonNo", width: 150, align: "left", | |||
formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getAsync('custmerData', { | |||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'LessonInfo', | |||
key: value, | |||
keyId: 'lessonno', | |||
callback: function (_data) { | |||
callback(_data['lessonname']); | |||
} | |||
}); | |||
} | |||
}, | |||
{ label: '教材名称', name: 'TextBookName', width: 200, align: "left" }, | |||
{ label: '教材号', name: 'TextBookNo', width: 200, align: "left" }, | |||
{ label: '出版号', name: 'PublishNo', width: 200, align: "left" }, | |||
{ label: '第一作者', name: 'FirstAuthor', width: 200, align: "left" }, | |||
{ label: '其他作者', name: 'OtherAuthor', width: 200, align: "left" }, | |||
{ label: '出版社', name: 'Publisher', width: 200, align: "left" }, | |||
{ label: '版次', name: 'Edition', width: 200, align: "left" }, | |||
{ label: '印次', name: 'Impression', width: 200, align: "left" }, | |||
{ label: '创建人', name: 'CreateTime', width: 200, align: "left" }, | |||
{ label: '创建用户', name: 'CrateUserID', width: 200, align: "left" }, | |||
{ label: '修改人', name: 'UpTime', width: 200, align: "left" }, | |||
{ label: '修改用户', name: 'UpUserID', width: 200, align: "left" }, | |||
{ label: '当前数量', name: 'FinallyNum', width: 200, align: "left" }, | |||
{ label: '备注', name: 'Remark', width: 200, align: "left" }, | |||
], | |||
mainId: 'ID', | |||
isPage: true, | |||
sidx: 'CreateTime desc' | |||
}); | |||
page.search(); | |||
}, | |||
search: function (param) { | |||
param = param || {}; | |||
param.SqlParameter = ' and IsSubmit =1 '; | |||
$('#gridtable').jfGridSet('reload',{ queryJson: JSON.stringify(param) }); | |||
} | |||
}; | |||
refreshGirdData = function () { | |||
$('#gridtable').jfGridSet('reload'); | |||
}; | |||
page.init(); | |||
} |
@@ -0,0 +1,58 @@ | |||
@{ | |||
ViewBag.Title = "教材库存表"; | |||
Layout = "~/Views/Shared/_Form.cshtml"; | |||
} | |||
<script> | |||
var BookCode = "@ViewBag.BookCode"; | |||
</script> | |||
<div class="lr-form-wrap" id="form"> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookInOut"> | |||
<div class="lr-form-item-title">库存编码<font face="宋体">*</font></div> | |||
<input id="BookCode" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" readonly /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookInOut"> | |||
<div class="lr-form-item-title">课程<font face="宋体">*</font></div> | |||
<div id="LessonNo" isvalid="yes" checkexpession="NotNull"></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="TextBookInOut"> | |||
<div class="lr-form-item-title">教材<font face="宋体">*</font></div> | |||
<input id="TextBookName" type="text" class="form-control" isvalid="yes" checkexpession="NotNull"/> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookInOut"> | |||
<div class="lr-form-item-title">教材号</div> | |||
<input id="TextBookNo" type="text" class="form-control" readonly /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookInOut"> | |||
<div class="lr-form-item-title">出版号</div> | |||
<input id="PublishNo" type="text" class="form-control" readonly /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookInOut"> | |||
<div class="lr-form-item-title">第一作者</div> | |||
<input id="FirstAuthor" type="text" class="form-control" readonly /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookInOut"> | |||
<div class="lr-form-item-title">其他作者</div> | |||
<input id="OtherAuthor" type="text" class="form-control" readonly /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookInOut"> | |||
<div class="lr-form-item-title">出版社</div> | |||
<input id="Publisher" type="text" class="form-control" readonly /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookInOut"> | |||
<div class="lr-form-item-title">版次</div> | |||
<input id="Edition" type="text" class="form-control" readonly /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookInOut"> | |||
<div class="lr-form-item-title">印次</div> | |||
<input id="Impression" type="text" class="form-control" readonly /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookInOut"> | |||
<div class="lr-form-item-title">数量<font face="宋体">*</font></div> | |||
<input id="FinallyNum" type="number" class="form-control" isvalid="yes" checkexpession="PositiveInteger" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="TextBookInOut"> | |||
<div class="lr-form-item-title">备注</div> | |||
<textarea id="Remark" class="form-control" style="height:100px;"></textarea> | |||
</div> | |||
</div> | |||
@Html.AppendJsFile("/Areas/EducationalAdministration/Views/TextBookInOut/Form.js") |
@@ -0,0 +1,112 @@ | |||
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) | |||
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
* 创建人:超级管理员 | |||
* 日 期:2022-03-02 10:37 | |||
* 描 述:教材库存表 | |||
*/ | |||
var acceptClick; | |||
var keyValue = request('keyValue'); | |||
var bootstrap = function ($, learun) { | |||
"use strict"; | |||
var page = { | |||
init: function () { | |||
$('.lr-form-wrap').lrscroll(); | |||
page.bind(); | |||
page.initData(); | |||
}, | |||
bind: function () { | |||
$('#LessonNo').lrDataSourceSelect({ code: 'LessonInfo', value: 'lessonno', text: 'lessonname' }); | |||
$('#TextBookName').lrGirdSelect({ | |||
url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=TextBookInfo', | |||
param: { strWhere: " IsDel = '0' and IsValid ='true' " }, | |||
height: 800, | |||
width: 1100, | |||
selectWord: 'textbookname', | |||
value: 'textbookname', | |||
text: 'textbookname', | |||
headData: | |||
[ | |||
{ label: "教材号", name: "publishno", width: 150, align: "left" }, | |||
{ label: "教材编码", name: "textbookno", width: 150, align: "left" }, | |||
{ label: "教材名称", name: "textbookname", width: 150, align: "left" }, | |||
{ label: "作者", name: "firstauthor", width: 150, align: "left" }, | |||
{ label: "其他作者", name: "otherauthor", width: 100, align: "left" }, | |||
{ label: "出版日期", name: "pubdate", width: 100, align: "left" }, | |||
{ label: "出版社", name: "publisher", width: 100, align: "left" }, | |||
{ | |||
label: "教材类型", name: "textbooktype", width: 100, align: "left", | |||
formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getAsync('dataItem', { | |||
key: value, | |||
code: 'TextBookType', | |||
callback: function (_data) { | |||
callback(_data.text); | |||
} | |||
}); | |||
} | |||
}, | |||
{ | |||
label: "教材性质", name: "textbooknature", width: 100, align: "left", | |||
formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getAsync('dataItem', { | |||
key: value, | |||
code: 'TextBookNature', | |||
callback: function (_data) { | |||
callback(_data.text); | |||
} | |||
}); | |||
} | |||
}, | |||
{ label: "价格", name: "price", width: 50, align: "left" }, | |||
{ label: "版次", name: "edition", width: 100, align: "left" }, | |||
{ label: "印次", name: "impression", width: 100, align: "left" }, | |||
], | |||
select: function (item) { | |||
////赋值 | |||
$("#Price").val(item.price); | |||
$("#PublishNo").val(item.publishno); | |||
$("#TextBookNo").val(item.textbookno); | |||
$("#TextBookName").val(item.textbookname); | |||
$("#FirstAuthor").val(item.firstauthor); | |||
$("#OtherAuthor").val(item.otherauthor); | |||
$("#Publisher").val(item.publisher); | |||
$("#Edition").val(item.edition); | |||
$("#Impression").val(item.impression); | |||
} | |||
}); | |||
}, | |||
initData: function () { | |||
if (!!keyValue) { | |||
$.lrSetForm(top.$.rootUrl + '/EducationalAdministration/TextBookInOut/GetFormData?keyValue=' + keyValue, function (data) { | |||
for (var id in data) { | |||
if (!!data[id].length && data[id].length > 0) { | |||
$('#' + id).jfGridSet('refreshdata', data[id]); | |||
} | |||
else { | |||
$('[data-table="' + id + '"]').lrSetFormData(data[id]); | |||
} | |||
} | |||
}); | |||
} else { | |||
$("#BookCode").val(BookCode); | |||
} | |||
} | |||
}; | |||
// 保存数据 | |||
acceptClick = function (callBack) { | |||
if (!$('body').lrValidform()) { | |||
return false; | |||
} | |||
var postData = { | |||
strEntity: JSON.stringify($('body').lrGetFormData()) | |||
}; | |||
$.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/TextBookInOut/SaveForm?keyValue=' + keyValue, postData, function (res) { | |||
// 保存成功后才回调 | |||
if (!!callBack) { | |||
callBack(); | |||
} | |||
}); | |||
}; | |||
page.init(); | |||
} |
@@ -0,0 +1,51 @@ | |||
@{ | |||
ViewBag.Title = "教材库存表"; | |||
Layout = "~/Views/Shared/_Form.cshtml"; | |||
} | |||
<div class="lr-form-wrap"> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookInOut"> | |||
<div class="lr-form-item-title">库存单</div> | |||
<input id="BookCode" type="text" class="form-control" readonly /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookInOut"> | |||
<div class="lr-form-item-title">课程</div> | |||
<div id="LessonNo" isvalid="yes" checkexpession="NotNull" readonly></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="TextBookInOut"> | |||
<div class="lr-form-item-title">所选书籍</div> | |||
<input id="TextBookName" type="text" class="form-control" readonly /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookInOut"> | |||
<div class="lr-form-item-title">出版号</div> | |||
<input id="PublishNo" type="text" class="form-control" readonly /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookInOut"> | |||
<div class="lr-form-item-title">作者</div> | |||
<input id="FirstAuthor" type="text" class="form-control" readonly /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookInOut"> | |||
<div class="lr-form-item-title">其他作者</div> | |||
<input id="OtherAuthor" type="text" class="form-control" readonly /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookInOut"> | |||
<div class="lr-form-item-title">出版社</div> | |||
<input id="Publisher" type="text" class="form-control" readonly /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookInOut"> | |||
<div class="lr-form-item-title">版次</div> | |||
<input id="Edition" type="text" class="form-control" readonly /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookInOut"> | |||
<div class="lr-form-item-title">当前库存</div> | |||
<input id="FinallyNum" type="text" class="form-control" readonly /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="TextBookInOut"> | |||
<div class="lr-form-item-title">备注</div> | |||
<textarea id="Remark" class="form-control" style="height: 100px;" readonly></textarea> | |||
</div> | |||
<div class="col-xs-12 lr-form-item lr-form-item-grid"> | |||
<div id="TextBookInOrOut"></div> | |||
</div> | |||
</div> | |||
@Html.AppendJsFile("/Areas/EducationalAdministration/Views/TextBookInOut/FormUse.js") | |||
@@ -0,0 +1,97 @@ | |||
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) | |||
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
* 创建人:超级管理员 | |||
* 日 期:2022-03-02 10:37 | |||
* 描 述:教材库存表 | |||
*/ | |||
var acceptClick; | |||
var keyValue = request('keyValue'); | |||
// 设置权限 | |||
var setAuthorize; | |||
// 设置表单数据 | |||
var setFormData; | |||
// 验证数据是否填写完整 | |||
var validForm; | |||
// 保存数据 | |||
var save; | |||
var selectedRow; | |||
var refreshGirdData; | |||
var tempdatra = new Array(); | |||
var bootstrap = function ($, learun) { | |||
"use strict"; | |||
var page = { | |||
init: function () { | |||
$('.lr-form-wrap').lrscroll(); | |||
page.bind(); | |||
page.initData(); | |||
}, | |||
bind: function () { | |||
$('#LessonNo').lrDataSourceSelect({ code: 'LessonInfo', value: 'lessonno', text: 'lessonname' }); | |||
$('#TextBookInOrOut').jfGrid({ | |||
headData: [ | |||
{ label: '出/入库', name: 'CKORRK', width: 180, align: 'left' }, | |||
{ label: '库存单', name: 'InorOut', width: 180, align: 'left' }, | |||
{ label: '出库单', name: 'BookCode', width: 180, align: 'left' }, | |||
{ label: '出/入库数量', name: 'variate', width: 100, align: 'left' }, | |||
{ label: '出库时间', name: 'CreateTime', width: 200, align: 'left' }, | |||
{ label: '出库用户', name: 'CrateUserID', width: 100, align: 'left' }, | |||
{ label: '备注', name: 'Remark', width: 100, align: 'left' }, | |||
], | |||
height: 400, | |||
mainId: 'CreateTime desc', | |||
reloadSelected: false, | |||
}); | |||
}, | |||
initData: function () { | |||
if (!!keyValue) { | |||
$.lrSetForm(top.$.rootUrl + '/EducationalAdministration/TextBookInOut/GetFormUseData?keyValue=' + keyValue, function (data) { | |||
console.log(data,123123) | |||
for (var id in data) { | |||
if (!!data[id].length && data[id].length > 0) { | |||
$('#' + id).jfGridSet('refreshdata', data[id]); | |||
tempdatra = data[id]; | |||
} | |||
else { | |||
$('[data-table="' + id + '"]').lrSetFormData(data[id]); | |||
} | |||
} | |||
}); | |||
} | |||
} | |||
}; | |||
refreshGirdData = function (temprow) { | |||
var ifnewrow = true; | |||
$.each(tempdatra, function (key, val) { | |||
if (tempdatra[key].ID === temprow.ID) { | |||
tempdatra[key] = temprow; | |||
ifnewrow = false; | |||
} | |||
}); | |||
if (ifnewrow) { | |||
tempdatra.push(temprow); | |||
} | |||
$('#TextBookInOrOut').jfGridSet('refreshdata', tempdatra); | |||
}; | |||
// 设置表单数据 | |||
setFormData = function (processId, param, callback) { | |||
if (!!processId) { | |||
$.lrSetForm(top.$.rootUrl + '/EducationalAdministration/TextBookOut/GetFormData?processId=' + processId, function (data) { | |||
for (var id in data) { | |||
if (!!data[id] && data[id].length > 0) { | |||
$('#' + id).jfGridSet('refreshdata', data[id]); | |||
} | |||
else { | |||
if (id == 'TextBookInOrOut' && data[id]) { | |||
keyValue = data[id].ID; | |||
} | |||
$('[data-table="' + id + '"]').lrSetFormData(data[id]); | |||
} | |||
} | |||
}); | |||
} | |||
callback && callback(); | |||
} | |||
page.init(); | |||
} |
@@ -0,0 +1,32 @@ | |||
@{ | |||
ViewBag.Title = "教材库存表"; | |||
Layout = "~/Views/Shared/_Index.cshtml"; | |||
} | |||
<div class="lr-layout"> | |||
<div class="lr-layout-center "> | |||
<div class="lr-layout-wrap lr-layout-wrap-notitle "> | |||
<div class="lr-layout-tool"> | |||
<div class="lr-layout-tool-left"> | |||
<div class="lr-layout-tool-item"> | |||
<input id="txt_Keyword" type="text" class="form-control" placeholder="请输入要查询关键字" /> | |||
</div> | |||
<div class="lr-layout-tool-item"> | |||
<a id="btn_Search" class="btn btn-primary btn-sm"><i class="fa fa-search"></i> 查询</a> | |||
</div> | |||
</div> | |||
<div class="lr-layout-tool-right"> | |||
<div class=" btn-group btn-group-sm"> | |||
<a id="lr_refresh" class="btn btn-default"><i class="fa fa-refresh"></i></a> | |||
</div> | |||
<div class=" btn-group btn-group-sm" learun-authorize="yes"> | |||
<a id="lr_add" class="btn btn-default"><i class="fa fa-plus"></i> 新增</a> | |||
<a id="lr_edit" class="btn btn-default"><i class="fa fa-pencil-square-o"></i> 编辑</a> | |||
<a id="lr_delete" class="btn btn-default"><i class="fa fa-trash-o"></i> 删除</a> | |||
<a id="lr_submit" class="btn btn-default"><i class="fa fa-plus"></i> 提交</a> </div> | |||
</div> | |||
</div> | |||
<div class="lr-layout-body" id="gridtable"></div> | |||
</div> | |||
</div> | |||
</div> | |||
@Html.AppendJsFile("/Areas/EducationalAdministration/Views/TextBookInOut/Index.js") |
@@ -0,0 +1,146 @@ | |||
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) | |||
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
* 创建人:超级管理员 | |||
* 日 期:2022-03-02 10:37 | |||
* 描 述:教材库存表 | |||
*/ | |||
var refreshGirdData; | |||
var bootstrap = function ($, learun) { | |||
"use strict"; | |||
var page = { | |||
init: function () { | |||
page.initGird(); | |||
page.bind(); | |||
}, | |||
bind: function () { | |||
// 查询 | |||
$('#btn_Search').on('click', function () { | |||
var keyword = $('#txt_Keyword').val(); | |||
page.search({ keyword: keyword }); | |||
}); | |||
$('#LessonNo').lrDataSourceSelect({ code: 'LessonInfo', value: 'lessonno', text: 'lessonname' }); | |||
// 刷新 | |||
$('#lr_refresh').on('click', function () { | |||
location.reload(); | |||
}); | |||
// 新增 | |||
$('#lr_add').on('click', function () { | |||
learun.layerForm({ | |||
id: 'form', | |||
title: '新增', | |||
url: top.$.rootUrl + '/EducationalAdministration/TextBookInOut/Form', | |||
width: 700, | |||
height: 500, | |||
callBack: function (id) { | |||
return top[id].acceptClick(refreshGirdData); | |||
} | |||
}); | |||
}); | |||
// 编辑 | |||
$('#lr_edit').on('click', function () { | |||
var keyValue = $('#gridtable').jfGridValue('ID'); | |||
if (learun.checkrow(keyValue)) { | |||
var IsSubmit = $('#gridtable').jfGridValue('IsSubmit'); | |||
if (IsSubmit == 1) { | |||
learun.alert.warning("当前项目已提交,不可编辑!"); | |||
return; | |||
} | |||
learun.layerForm({ | |||
id: 'form', | |||
title: '编辑', | |||
url: top.$.rootUrl + '/EducationalAdministration/TextBookInOut/Form?keyValue=' + keyValue, | |||
width: 700, | |||
height: 500, | |||
callBack: function (id) { | |||
return top[id].acceptClick(refreshGirdData); | |||
} | |||
}); | |||
} | |||
}); | |||
// 删除 | |||
$('#lr_delete').on('click', function () { | |||
var keyValue = $('#gridtable').jfGridValue('ID'); | |||
if (learun.checkrow(keyValue)) { | |||
var IsSubmit = $('#gridtable').jfGridValue('IsSubmit'); | |||
if (IsSubmit == 1) { | |||
learun.alert.warning("当前项目已提交,不可删除!"); | |||
return; | |||
} | |||
learun.layerConfirm('是否确认删除该项!', function (res) { | |||
if (res) { | |||
learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/TextBookInOut/DeleteForm', { keyValue: keyValue }, function () { | |||
}); | |||
} | |||
}); | |||
} | |||
}); | |||
$('#lr_submit').on('click', function () { | |||
var keyValue = $('#gridtable').jfGridValue('ID'); | |||
if (learun.checkrow(keyValue)) { | |||
var IsSubmit = $('#gridtable').jfGridValue('IsSubmit'); | |||
if (IsSubmit == 1) { | |||
learun.alert.warning("当前项目已提交,请勿重复提交!"); | |||
return; | |||
} | |||
learun.layerConfirm('是否确认提交该项!', function (res) { | |||
if (res) { | |||
learun.postForm(top.$.rootUrl + '/EducationalAdministration/TextBookInOut/SubmitForm', { keyValue: keyValue }, function (res) { | |||
refreshGirdData(res, {}); | |||
}); | |||
} | |||
}); | |||
} | |||
}); | |||
}, | |||
initGird: function () { | |||
$('#gridtable').lrAuthorizeJfGrid({ | |||
url: top.$.rootUrl + '/EducationalAdministration/TextBookInOut/GetPageList', | |||
headData: [ | |||
{ label: '库存单号', name: 'BookCode', width: 200, align: "left" }, | |||
{ | |||
label: "课程", name: "LessonNo", width: 150, align: "left", | |||
formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getAsync('custmerData', { | |||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'LessonInfo', | |||
key: value, | |||
keyId: 'lessonno', | |||
callback: function (_data) { | |||
callback(_data['lessonname']); | |||
} | |||
}); | |||
} | |||
}, | |||
{ label: '教材名称', name: 'TextBookName', width: 200, align: "left" }, | |||
{ label: '教材号', name: 'TextBookNo', width: 200, align: "left" }, | |||
{ label: '出版号', name: 'PublishNo', width: 200, align: "left" }, | |||
{ label: '第一作者', name: 'FirstAuthor', width: 200, align: "left" }, | |||
{ label: '其他作者', name: 'OtherAuthor', width: 200, align: "left" }, | |||
//{ label: '出版日期', name: 'Pubdate', width: 200, align: "left" }, | |||
{ label: '出版社', name: 'Publisher', width: 200, align: "left" }, | |||
{ label: '版次', name: 'Edition', width: 200, align: "left" }, | |||
{ label: '印次', name: 'Impression', width: 200, align: "left" }, | |||
{ label: '创建人', name: 'CreateTime', width: 200, align: "left" }, | |||
{ label: '创建用户', name: 'CrateUserID', width: 200, align: "left" }, | |||
{ label: '修改人', name: 'UpTime', width: 200, align: "left" }, | |||
{ label: '修改用户', name: 'UpUserID', width: 200, align: "left" }, | |||
{ label: '当前数量', name: 'FinallyNum', width: 200, align: "left" }, | |||
{ label: '备注', name: 'Remark', width: 200, align: "left" }, | |||
], | |||
mainId: 'ID', | |||
isPage: true, | |||
sidx: 'CreateTime desc' | |||
}); | |||
page.search(); | |||
}, | |||
search: function (param) { | |||
param = param || {}; | |||
param.SqlParameter = 'and IsDel = 0 '; | |||
$('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); | |||
} | |||
}; | |||
refreshGirdData = function () { | |||
$('#gridtable').jfGridSet('reload'); | |||
}; | |||
page.init(); | |||
} |
@@ -0,0 +1,30 @@ | |||
@{ | |||
ViewBag.Title = "教材库存表"; | |||
Layout = "~/Views/Shared/_Index.cshtml"; | |||
} | |||
<div class="lr-layout"> | |||
<div class="lr-layout-center "> | |||
<div class="lr-layout-wrap lr-layout-wrap-notitle "> | |||
<div class="lr-layout-tool"> | |||
<div class="lr-layout-tool-left"> | |||
<div class="lr-layout-tool-item"> | |||
<input id="txt_Keyword" type="text" class="form-control" placeholder="请输入要查询关键字" /> | |||
</div> | |||
<div class="lr-layout-tool-item"> | |||
<a id="btn_Search" class="btn btn-primary btn-sm"><i class="fa fa-search"></i> 查询</a> | |||
</div> | |||
</div> | |||
<div class="lr-layout-tool-right"> | |||
<div class=" btn-group btn-group-sm"> | |||
<a id="lr_refresh" class="btn btn-default"><i class="fa fa-refresh"></i></a> | |||
</div> | |||
<div class=" btn-group btn-group-sm" learun-authorize="yes"> | |||
<a id="lr_view" class="btn btn-default"><i class="fa fa-pencil-square-o"></i> 明细查看</a> | |||
</div> | |||
</div> | |||
</div> | |||
<div class="lr-layout-body" id="gridtable"></div> | |||
</div> | |||
</div> | |||
</div> | |||
@Html.AppendJsFile("/Areas/EducationalAdministration/Views/TextBookInOut/IndexInOut.js") |
@@ -0,0 +1,92 @@ | |||
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) | |||
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
* 创建人:超级管理员 | |||
* 日 期:2022-03-02 10:37 | |||
* 描 述:教材库存表 | |||
*/ | |||
var refreshGirdData; | |||
var bootstrap = function ($, learun) { | |||
"use strict"; | |||
var page = { | |||
init: function () { | |||
page.initGird(); | |||
page.bind(); | |||
}, | |||
bind: function () { | |||
// 查询 | |||
$('#btn_Search').on('click', function () { | |||
var keyword = $('#txt_Keyword').val(); | |||
page.search({ keyword: keyword }); | |||
}); | |||
$('#LessonNo').lrDataSourceSelect({ code: 'LessonInfo', value: 'lessonno', text: 'lessonname' }); | |||
// 刷新 | |||
$('#lr_refresh').on('click', function () { | |||
location.reload(); | |||
}); | |||
// 查看 | |||
$('#lr_view').on('click', function () { | |||
var keyValue = $('#gridtable').jfGridValue('ID'); | |||
if (learun.checkrow(keyValue)) { | |||
learun.layerForm({ | |||
id: 'formview', | |||
title: '查看', | |||
url: top.$.rootUrl + '/EducationalAdministration/TextBookInOut/FormUse?keyValue=' + keyValue, | |||
width: 1000, | |||
height: 700, | |||
btn: null, | |||
}); | |||
} | |||
}); | |||
}, | |||
initGird: function () { | |||
$('#gridtable').lrAuthorizeJfGrid({ | |||
url: top.$.rootUrl + '/EducationalAdministration/TextBookInOut/GetPageList', | |||
headData: [ | |||
{ label: '库存单号', name: 'BookCode', width: 200, align: "left" }, | |||
{ | |||
label: "课程", name: "LessonNo", width: 150, align: "left", | |||
formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getAsync('custmerData', { | |||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'LessonInfo', | |||
key: value, | |||
keyId: 'lessonno', | |||
callback: function (_data) { | |||
callback(_data['lessonname']); | |||
} | |||
}); | |||
} | |||
}, | |||
{ label: '教材名称', name: 'TextBookName', width: 200, align: "left" }, | |||
{ label: '教材号', name: 'TextBookNo', width: 200, align: "left" }, | |||
{ label: '出版号', name: 'PublishNo', width: 200, align: "left" }, | |||
{ label: '第一作者', name: 'FirstAuthor', width: 200, align: "left" }, | |||
{ label: '其他作者', name: 'OtherAuthor', width: 200, align: "left" }, | |||
//{ label: '出版日期', name: 'Pubdate', width: 200, align: "left" }, | |||
{ label: '出版社', name: 'Publisher', width: 200, align: "left" }, | |||
{ label: '版次', name: 'Edition', width: 200, align: "left" }, | |||
{ label: '印次', name: 'Impression', width: 200, align: "left" }, | |||
{ label: '创建人', name: 'CreateTime', width: 200, align: "left" }, | |||
{ label: '创建用户', name: 'CrateUserID', width: 200, align: "left" }, | |||
{ label: '修改人', name: 'UpTime', width: 200, align: "left" }, | |||
{ label: '修改用户', name: 'UpUserID', width: 200, align: "left" }, | |||
{ label: '当前数量', name: 'FinallyNum', width: 200, align: "left" }, | |||
{ label: '备注', name: 'Remark', width: 200, align: "left" }, | |||
], | |||
mainId: 'ID', | |||
isPage: true, | |||
sidx: 'CreateTime desc' | |||
}); | |||
page.search(); | |||
}, | |||
search: function (param) { | |||
param = param || {}; | |||
param.SqlParameter = 'and IsDel = 0 '; | |||
$('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); | |||
} | |||
}; | |||
refreshGirdData = function () { | |||
$('#gridtable').jfGridSet('reload'); | |||
}; | |||
page.init(); | |||
} |
@@ -0,0 +1,86 @@ | |||
@{ | |||
ViewBag.Title = "教材订单管理"; | |||
Layout = "~/Views/Shared/_Form.cshtml"; | |||
} | |||
@Html.AppendCssFile("/Views/LR_Content/plugin/layerselect/lr-layerselect.css") | |||
@Html.AppendJsFile("/Views/LR_Content/plugin/layerselect/lr-layerselect.js") | |||
<div class="lr-form-wrap"> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookIndent"> | |||
<div class="lr-form-item-title">专业部<font face="宋体">*</font></div> | |||
<div id="DeptNo" isvalid="yes" checkexpession="NotNull"></div> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookIndent"> | |||
<div class="lr-form-item-title">专业<font face="宋体">*</font></div> | |||
<div id="MajorNo" isvalid="yes" checkexpession="NotNull"></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="TextBookIndent"> | |||
<div class="lr-form-item-title">课程<font face="宋体">*</font></div> | |||
<div id="LessonNo" isvalid="yes" checkexpession="NotNull"></div> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookIndent"> | |||
<div class="lr-form-item-title">学年<font face="宋体">*</font></div> | |||
<div id="AcademicYearNo" isvalid="yes" checkexpession="NotNull"></div> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookIndent"> | |||
<div class="lr-form-item-title">学期<font face="宋体">*</font></div> | |||
<div id="Semester" isvalid="yes" checkexpession="NotNull"></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="TextBookIndent"> | |||
<div class="lr-form-item-title">所选书籍<font face="宋体">*</font></div> | |||
<div id="TextBookName" isvalid="yes" checkexpession="NotNull" readonly></div> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookIndent"> | |||
<div class="lr-form-item-title">书籍</div> | |||
<input id="PublishNo" type="text" class="form-control" readonly /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookIndent"> | |||
<div class="lr-form-item-title">单价</div> | |||
<input id="Price" type="text" class="form-control" readonly /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookIndent"> | |||
<div class="lr-form-item-title">作者</div> | |||
<input id="FirstAuthor" type="text" class="form-control" readonly /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookIndent"> | |||
<div class="lr-form-item-title">其他作者</div> | |||
<input id="OtherAuthor" type="text" class="form-control" readonly /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookIndent"> | |||
<div class="lr-form-item-title">出版社</div> | |||
<input id="Publisher" type="text" class="form-control" readonly /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookIndent"> | |||
<div class="lr-form-item-title">版次</div> | |||
<input id="Edition" type="text" class="form-control" readonly /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="TextBookIndent"> | |||
<div class="lr-form-item-title">订购数量</div> | |||
<input id="OrderNum" type="number" class="form-control" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="TextBookIndent"> | |||
<div class="lr-form-item-title">备注</div> | |||
<textarea id="Remark" class="form-control" style="height:100px;"></textarea> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="TextBookIndent" style="display: none; "> | |||
<div class="lr-form-item-title">当前信息</div> | |||
<input id="CreateTime" type="text" readonly class="form-control currentInfo lr-currentInfo-time" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="TextBookIndent" style="display: none; "> | |||
<div class="lr-form-item-title">当前信息</div> | |||
<input id="CreateUserID" type="text" readonly class="form-control currentInfo lr-currentInfo-user" /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookIndent" style="display: none; "> | |||
<div class="lr-form-item-title">状态</div> | |||
<input id="Status" type="text" class="form-control" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">明细操作</div> | |||
<input id="detailadd" type="button" class="btn btn-success" value="新增明细" /> | |||
<input id="detailedit" type="button" class="btn btn-warning" value="编辑明细" /> | |||
<input id="detaildel" type="button" class="btn btn-danger" value="移除明细" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item lr-form-item-grid"> | |||
<div id="TextBookIndentDetail"></div> | |||
</div> | |||
</div> | |||
@Html.AppendJsFile("/Areas/EducationalAdministration/Views/TextBookIndent/Form.js") |
@@ -0,0 +1,273 @@ | |||
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) | |||
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
* 创建人:超级管理员 | |||
* 日 期:2022-02-18 14:27 | |||
* 描 述:教材订单管理 | |||
*/ | |||
var acceptClick; | |||
var keyValue = request('keyValue'); | |||
// 设置权限 | |||
var setAuthorize; | |||
// 设置表单数据 | |||
var setFormData; | |||
// 验证数据是否填写完整 | |||
var validForm; | |||
// 保存数据 | |||
var save; | |||
var selectedRow; | |||
var refreshGirdData; | |||
var tempdatra = new Array(); | |||
var order = 0; | |||
var bootstrap = function ($, learun) { | |||
"use strict"; | |||
// 设置权限 | |||
setAuthorize = function (data) { | |||
}; | |||
var page = { | |||
init: function () { | |||
$('.lr-form-wrap').lrscroll(); | |||
$("#detailadd").on('click', function () { | |||
selectedRow = null; | |||
learun.layerForm({ | |||
id: 'formTextBookIndentDetail', | |||
title: '新增明细', | |||
url: top.$.rootUrl + '/EducationalAdministration/TextBookIndent/FormDetail', | |||
width: 600, | |||
height: 350, | |||
callBack: function (id) { | |||
return top[id].acceptClick(refreshGirdData); | |||
} | |||
}); | |||
}); | |||
$("#detailedit").on('click', function () { | |||
var keyValue = $('#TextBookIndentDetail').jfGridValue('ID'); | |||
selectedRow = $('#TextBookIndentDetail').jfGridGet('rowdata'); | |||
if (learun.checkrow(keyValue)) { | |||
learun.layerForm({ | |||
id: 'formTextBookIndentDetail', | |||
title: '编辑明细', | |||
url: top.$.rootUrl + '/EducationalAdministration/TextBookIndent/FormDetail?keyValue=' + keyValue, | |||
width: 600, | |||
height: 350, | |||
callBack: function (id) { | |||
return top[id].acceptClick(refreshGirdData); | |||
} | |||
}); | |||
} | |||
}); | |||
$("#detaildel").on('click', function () { | |||
var keyValue = $('#TextBookIndentDetail').jfGridValue('ID'); | |||
if (learun.checkrow(keyValue)) { | |||
learun.layerConfirm('是否确认删除该项!', function (res, index) { | |||
if (res) { | |||
order = 0; | |||
$.each(tempdatra, function (key, val) { | |||
if (tempdatra[key].ID === keyValue) { | |||
// order -= tempdatra[key].TeachSum + tempdatra[key].StuSum; | |||
tempdatra.splice(key, 1); | |||
} else { | |||
order += (parseInt(tempdatra[key].TeachSum) + parseInt(tempdatra[key].StuSum)); | |||
} | |||
}); | |||
$("#OrderNum").val(order); | |||
$('#TextBookIndentDetail').jfGridSet('refreshdata', tempdatra.sort(sortNumber)); | |||
top.layer.close(index); | |||
} | |||
}); | |||
} | |||
}); | |||
page.bind(); | |||
page.initData(); | |||
}, | |||
bind: function () { | |||
$('#DeptNo').lrDataSourceSelect({ code: 'CdDeptInfo', value: 'deptno', text: 'deptname' }); | |||
$('#MajorNo').lrDataSourceSelect({ code: 'CdMajorInfo', value: 'majorname', text: 'majorname' }); | |||
$('#LessonNo').lrDataSourceSelect({ code: 'LessonInfo', value: 'lessonno', text: 'lessonname' }); | |||
$('#AcademicYearNo').lrselect({ | |||
placeholder: "请选择学年", | |||
allowSearch: true, | |||
url: top.$.rootUrl + '/EducationalAdministration/TextBookIndent/GetAcademicYear', | |||
value: 'value', | |||
text: 'text' | |||
}); | |||
//学期 | |||
$('#Semester').lrselect({ | |||
placeholder: "请选择学期", | |||
allowSearch: true, | |||
url: top.$.rootUrl + '/EducationalAdministration/EADateArrange/GetSemester', | |||
value: 'value', | |||
text: 'text' | |||
}); | |||
$('#TextBookIndentDetail').jfGrid({ | |||
headData: [ | |||
{ | |||
label: "班级", name: "ClassNo", 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: 'TeachSum', width: 80, align: 'left' }, | |||
{ label: '学生人数', name: 'StuSum', width: 80, align: 'left' }, | |||
{ label: '备注', name: 'Remark', width: 100, align: 'left' }, | |||
], | |||
height: 400, | |||
mainId: 'ID,IndentID', | |||
reloadSelected: false, | |||
}); | |||
$('#TextBookName').lrGirdSelect({ | |||
url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=TextBookInfo', | |||
param: { strWhere: " IsDel = '0' and IsValid ='true' " }, | |||
height: 800, | |||
width: 1100, | |||
selectWord: 'textbookname', | |||
value: 'textbookname', | |||
text: 'textbookname', | |||
headData: | |||
[ | |||
{ label: "教材号", name: "publishno", width: 150, align: "left" }, | |||
{ label: "教材名称", name: "textbookname", width: 150, align: "left" }, | |||
{ label: "作者", name: "firstauthor", width: 150, align: "left" }, | |||
{ label: "其他作者", name: "otherauthor", width: 100, align: "left" }, | |||
{ label: "出版社", name: "publisher", width: 100, align: "left" }, | |||
{ | |||
label: "教材类型", name: "textbooktype", width: 100, align: "left", | |||
formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getAsync('dataItem', { | |||
key: value, | |||
code: 'TextBookType', | |||
callback: function (_data) { | |||
callback(_data.text); | |||
} | |||
}); | |||
} | |||
}, | |||
{ | |||
label: "教材性质", name: "textbooknature", width: 100, align: "left", | |||
formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getAsync('dataItem', { | |||
key: value, | |||
code: 'TextBookNature', | |||
callback: function (_data) { | |||
callback(_data.text); | |||
} | |||
}); | |||
} | |||
}, | |||
{ label: "价格", name: "price", width: 50, align: "left" }, | |||
{ label: "版次", name: "edition", width: 100, align: "left" }, | |||
{ label: "印次", name: "impression", width: 100, align: "left" }, | |||
], | |||
select: function (item) { | |||
////赋值 | |||
$("#Price").val(item.price); | |||
$("#PublishNo").val(item.publishno); | |||
$("#FirstAuthor").val(item.firstauthor); | |||
$("#TextBookName").val(item.textbookname); | |||
$("#OtherAuthor").val(item.otherauthor); | |||
$("#Publisher").val(item.publisher); | |||
$("#Edition").val(item.edition); | |||
} | |||
}); | |||
$('#Status').val(0); | |||
$('#CreateTime').val(learun.formatDate(new Date(), 'yyyy-MM-dd hh:mm:ss')); | |||
$('#CreateUserID')[0].lrvalue = learun.clientdata.get(['userinfo']).userId; | |||
$('#CreateUserID').val(learun.clientdata.get(['userinfo']).realName); | |||
}, | |||
initData: function () { | |||
if (!!keyValue) { | |||
$.lrSetForm(top.$.rootUrl + '/EducationalAdministration/TextBookIndent/GetFormData?keyValue=' + keyValue, function (data) { | |||
for (var id in data) { | |||
if (!!data[id].length && data[id].length > 0) { | |||
$('#' + id).jfGridSet('refreshdata', data[id]); | |||
tempdatra = data[id]; | |||
} | |||
else { | |||
$('[data-table="' + id + '"]').lrSetFormData(data[id]); | |||
//if (data[id].AAPrice) { | |||
// pricecount = data[id].AAPrice; | |||
//} | |||
} | |||
} | |||
}); | |||
} | |||
} | |||
}; | |||
refreshGirdData = function (temprow) { | |||
var ifnewrow = true; | |||
$.each(tempdatra, function (key, val) { | |||
if (tempdatra[key].ID === temprow.ID) { | |||
tempdatra[key] = temprow; | |||
ifnewrow = false; | |||
} | |||
}); | |||
if (ifnewrow) { | |||
tempdatra.push(temprow); | |||
} | |||
//订购数量 | |||
order = 0; | |||
for (var i = 0; i < tempdatra.length; i++) { | |||
order += (parseInt(tempdatra[i].TeachSum) + parseInt(tempdatra[i].StuSum)); | |||
} | |||
$("#OrderNum").val(order); | |||
$('#TextBookIndentDetail').jfGridSet('refreshdata', tempdatra.sort(sortNumber)); | |||
}; | |||
function sortNumber(a, b) { | |||
return a.StuSum - b.StuSum; | |||
} | |||
// 设置表单数据 | |||
setFormData = function (processId, param, callback) { | |||
if (!!processId) { | |||
$.lrSetForm(top.$.rootUrl + '/EducationalAdministration/TextBookIndent/GetFormDataByProcessId?processId=' + processId, function (data) { | |||
for (var id in data) { | |||
if (!!data[id] && data[id].length > 0) { | |||
$('#' + id).jfGridSet('refreshdata', data[id]); | |||
} | |||
else { | |||
if (id == 'TextBookIndent' && data[id]) { | |||
keyValue = data[id].ID; | |||
} | |||
$('[data-table="' + id + '"]').lrSetFormData(data[id]); | |||
} | |||
} | |||
}); | |||
} | |||
} | |||
// 验证数据是否填写完整 | |||
validForm = function () { | |||
if (!$('.lr-form-wrap').lrValidform()) { | |||
return false; | |||
} | |||
var datas = $('#TextBookIndentDetail').jfGridGet('rowdatas'); | |||
if (datas == null || datas.length == 0) { | |||
learun.alert.warning("申请未包含明细!请先新增明细!"); | |||
return false; | |||
} | |||
return true; | |||
}; | |||
// 保存数据 | |||
save = function (processId, callBack, i) { | |||
var postData = {}; | |||
var formData = $('[data-table="TextBookIndent"]').lrGetFormData(); | |||
if (!!processId) { | |||
formData.processId = processId; | |||
} | |||
postData.strEntity = JSON.stringify(formData); | |||
postData.strTextBookIndentDetailList = JSON.stringify($('#TextBookIndentDetail').jfGridGet('rowdatas')); | |||
$.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/TextBookIndent/SaveForm?keyValue=' + keyValue, postData, function (res) { | |||
// 保存成功后才回调 | |||
if (!!callBack) { | |||
callBack(res, formData, i); | |||
} | |||
}); | |||
}; | |||
page.init(); | |||
} |
@@ -0,0 +1,23 @@ | |||
@{ | |||
ViewBag.Title = "TextBookIndentDetail"; | |||
Layout = "~/Views/Shared/_Form.cshtml"; | |||
} | |||
<div class="lr-form-wrap" id="form"> | |||
<div class="col-xs-6 lr-form-item"> | |||
<div class="lr-form-item-title">班级<font face="宋体">*</font></div> | |||
<div id="ClassNo" isvalid="yes" checkexpession="NotNull"></div> | |||
</div> | |||
<div class="col-xs-6 lr-form-item"> | |||
<div class="lr-form-item-title">教师人数<font face="宋体">*</font></div> | |||
<input id="TeachSum" type="number" class="form-control" isvalid="yes" checkexpession="NotNull" /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item"> | |||
<div class="lr-form-item-title">学生人数<font face="宋体">*</font></div> | |||
<input id="StuSum" type="number" class="form-control" isvalid="yes" checkexpession="NotNull" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">备注</div> | |||
<textarea id="Remark" class="form-control" style="height:100px;"></textarea> | |||
</div> | |||
</div> | |||
@Html.AppendJsFile("/Areas/EducationalAdministration/Views/TextBookIndent/FormDetail.js") |
@@ -0,0 +1,105 @@ | |||
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) | |||
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
* 创建人:超级管理员 | |||
* 日 期:2022-02-27 09:35 | |||
* 描 述:TextBookIndentDetail | |||
*/ | |||
var acceptClick; | |||
var keyValue = request('keyValue'); | |||
var selectedRow; | |||
var bootstrap = function ($, learun) { | |||
"use strict"; | |||
selectedRow = top["layer_formTextBookIndent"].selectedRow; | |||
var page = { | |||
init: function () { | |||
$('.lr-form-wrap').lrscroll(); | |||
page.bind(); | |||
page.initData(); | |||
}, | |||
bind: function () { | |||
$('#ClassNo').lrDataSourceSelect({ code: 'bjsj', value: 'classno', text: 'classname' }); | |||
//$("#ID").lrlayerselect({ | |||
// dataUrl: top.$.rootUrl + '/EducationalAdministration/TextBookIndent/GetList', | |||
// dataTreeId: 'ID', | |||
// dataValueId: 'ID', | |||
// dataTextId: 'ID', | |||
// grid: [ | |||
// { | |||
// label: "班级", name: "ClassNo", 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: 'TeachSum', width: 80, align: 'left' }, | |||
// { label: '学生人数', name: 'StuSum', width: 80, align: 'left' }, | |||
// { label: '备注', name: 'Remark', width: 100, align: 'left' }, | |||
// ], | |||
// select: function (values, texts) { | |||
// if (values && values.length > 0) { | |||
// //绑定 | |||
// //$("#AAITId").attr("readonly", "readonly"); | |||
// //$("#AAICode").attr("readonly", "readonly"); | |||
// //$("#AAIName").attr("readonly", "readonly"); | |||
// //$("#AAIUnit").attr("readonly", "readonly"); | |||
// //$("#AAIHasDetail").attr("readonly", "readonly"); | |||
// $.lrSetForm(top.$.rootUrl + '/TextBookIndentDetail/TextBookIndent/GetFormData?keyValue=' + values[0], function (data) { | |||
// console.log("data" + data.extBookIndentDetailList); | |||
// data = data.extBookIndentDetailList; | |||
// console.log("data" + data) | |||
// $('#ID').lrselectSet(data.IndentId); | |||
// $('#ClassNo').val(data.ClassNo); | |||
// $('#TeachSum').val(data.TeachSum); | |||
// $('#StuSum').lrselectSet(data.StuSum); | |||
// //$('#AAIHasDetail').lrselectSet(data.HasDetail); | |||
// //$('#AAIEName').val(data.AEName); | |||
// //$('#AAIModel').val(data.AModel); | |||
// //$('#AAIManufacturer').val(data.AManufacturer); | |||
// //$('#AAISpecification').val(data.ASpecification); | |||
// }); | |||
// } | |||
// }, | |||
// unknowselect: function () { | |||
// $('#ID').lrselectSet(""); | |||
// $('#ClassNo').val(""); | |||
// $('#TeachSum').val(""); | |||
// $('#StuSum').lrselectSet(""); | |||
// }, | |||
// isMultiple: false | |||
//}); | |||
}, | |||
initData: function () { | |||
if (!!keyValue) { | |||
if (!!selectedRow) { | |||
$('#form').lrSetFormData(selectedRow); | |||
//$("#ID").find('span').text(selectedRow.IndentId); | |||
} | |||
} | |||
} | |||
}; | |||
// 保存数据 | |||
acceptClick = function (callBack) { | |||
if (!$('body').lrValidform()) { | |||
return false; | |||
} | |||
var postData = $('body').lrGetFormData(); | |||
if (!!keyValue) { | |||
if (!!selectedRow) { | |||
postData.ID = selectedRow.ID; | |||
} | |||
} else { | |||
postData.ID = learun.newGuid(); | |||
} | |||
if (!!callBack) { | |||
callBack(postData); | |||
return true; | |||
} | |||
}; | |||
page.init(); | |||
} |
@@ -0,0 +1,74 @@ | |||
@{ | |||
ViewBag.Title = "教材订单管理"; | |||
Layout = "~/Views/Shared/_Form.cshtml"; | |||
} | |||
@Html.AppendCssFile("/Views/LR_Content/plugin/layerselect/lr-layerselect.css") | |||
@Html.AppendJsFile("/Views/LR_Content/plugin/layerselect/lr-layerselect.js") | |||
<div class="lr-form-wrap"> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookIndent"> | |||
<div class="lr-form-item-title">专业部<font face="宋体">*</font></div> | |||
<div id="DeptNo" isvalid="yes" checkexpession="NotNull" readonly ></div> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookIndent"> | |||
<div class="lr-form-item-title">专业<font face="宋体">*</font></div> | |||
<div id="MajorNo" isvalid="yes" checkexpession="NotNull" readonly ></div> | |||
</div> | |||
<div class="col-xs-4 lr-form-item" data-table="TextBookIndent"> | |||
<div class="lr-form-item-title">课程<font face="宋体">*</font></div> | |||
<div id="LessonNo" isvalid="yes" checkexpession="NotNull" readonly ></div> | |||
</div> | |||
<div class="col-xs-4 lr-form-item" data-table="TextBookIndent"> | |||
<div class="lr-form-item-title">学年<font face="宋体">*</font></div> | |||
<div id="AcademicYearNo" isvalid="yes" checkexpession="NotNull" readonly ></div> | |||
</div> | |||
<div class="col-xs-4 lr-form-item" data-table="TextBookIndent"> | |||
<div class="lr-form-item-title">学期<font face="宋体">*</font></div> | |||
<div id="Semester" isvalid="yes" checkexpession="NotNull" readonly ></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="TextBookIndent"> | |||
<div class="lr-form-item-title">所选书籍<font face="宋体">*</font></div> | |||
<div id="TextBookName" isvalid="yes" checkexpession="NotNull" readonly ></div> | |||
</div> | |||
<div class="col-xs-4 lr-form-item" data-table="TextBookIndent"> | |||
<div class="lr-form-item-title">书籍</div> | |||
<input id="PublishNo" type="text" class="form-control" readonly /> | |||
</div> | |||
<div class="col-xs-4 lr-form-item" data-table="TextBookIndent"> | |||
<div class="lr-form-item-title">作者</div> | |||
<input id="FirstAuthor" type="text" class="form-control" readonly /> | |||
</div> | |||
<div class="col-xs-4 lr-form-item" data-table="TextBookIndent"> | |||
<div class="lr-form-item-title">其他作者</div> | |||
<input id="OtherAuthor" type="text" class="form-control" readonly /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="TextBookIndent"> | |||
<div class="lr-form-item-title">订购数量</div> | |||
<input id="OrderNum" type="number" class="form-control" readonly /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="TextBookIndent"> | |||
<div class="lr-form-item-title">备注</div> | |||
<textarea id="Remark" class="form-control" style="height:100px;" readonly ></textarea> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="TextBookIndent" style="display: none; "> | |||
<div class="lr-form-item-title">当前信息</div> | |||
<input id="CreateTime" type="text" readonly class="form-control currentInfo lr-currentInfo-time" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="TextBookIndent" style="display: none; "> | |||
<div class="lr-form-item-title">当前信息</div> | |||
<input id="CreateUserID" type="text" readonly class="form-control currentInfo lr-currentInfo-user" /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookIndent" style="display: none; "> | |||
<div class="lr-form-item-title">状态</div> | |||
<input id="Status" type="text" class="form-control" /> | |||
</div> | |||
@*<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">明细操作</div> | |||
<input id="detailadd" type="button" class="btn btn-success" value="新增明细" /> | |||
<input id="detailedit" type="button" class="btn btn-warning" value="编辑明细" /> | |||
<input id="detaildel" type="button" class="btn btn-danger" value="移除明细" /> | |||
</div>*@ | |||
<div class="col-xs-12 lr-form-item lr-form-item-grid"> | |||
<div id="TextBookIndentDetail"></div> | |||
</div> | |||
</div> | |||
@Html.AppendJsFile("/Areas/EducationalAdministration/Views/TextBookIndent/FormLook.js") |
@@ -0,0 +1,270 @@ | |||
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) | |||
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
* 创建人:超级管理员 | |||
* 日 期:2022-02-18 14:27 | |||
* 描 述:教材订单管理 | |||
*/ | |||
var acceptClick; | |||
var keyValue = request('keyValue'); | |||
// 设置权限 | |||
var setAuthorize; | |||
// 设置表单数据 | |||
var setFormData; | |||
// 验证数据是否填写完整 | |||
var validForm; | |||
// 保存数据 | |||
var save; | |||
var selectedRow; | |||
var refreshGirdData; | |||
var tempdatra = new Array(); | |||
var order = 0; | |||
var bootstrap = function ($, learun) { | |||
"use strict"; | |||
// 设置权限 | |||
setAuthorize = function (data) { | |||
}; | |||
var page = { | |||
init: function () { | |||
$('.lr-form-wrap').lrscroll(); | |||
$("#detailadd").on('click', function () { | |||
selectedRow = null; | |||
learun.layerForm({ | |||
id: 'formTextBookIndentDetail', | |||
title: '新增明细', | |||
url: top.$.rootUrl + '/EducationalAdministration/TextBookIndent/FormDetail', | |||
width: 600, | |||
height: 350, | |||
callBack: function (id) { | |||
return top[id].acceptClick(refreshGirdData); | |||
} | |||
}); | |||
}); | |||
$("#detailedit").on('click', function () { | |||
var keyValue = $('#TextBookIndentDetail').jfGridValue('ID'); | |||
selectedRow = $('#TextBookIndentDetail').jfGridGet('rowdata'); | |||
if (learun.checkrow(keyValue)) { | |||
learun.layerForm({ | |||
id: 'formTextBookIndentDetail', | |||
title: '编辑明细', | |||
url: top.$.rootUrl + '/EducationalAdministration/TextBookIndent/FormDetail?keyValue=' + keyValue, | |||
width: 600, | |||
height: 350, | |||
callBack: function (id) { | |||
return top[id].acceptClick(refreshGirdData); | |||
} | |||
}); | |||
} | |||
}); | |||
$("#detaildel").on('click', function () { | |||
var keyValue = $('#TextBookIndentDetail').jfGridValue('ID'); | |||
if (learun.checkrow(keyValue)) { | |||
learun.layerConfirm('是否确认删除该项!', function (res, index) { | |||
if (res) { | |||
order = 0; | |||
$.each(tempdatra, function (key, val) { | |||
if (tempdatra[key].ID === keyValue) { | |||
// order -= tempdatra[key].TeachSum + tempdatra[key].StuSum; | |||
tempdatra.splice(key, 1); | |||
} else { | |||
order += (parseInt(tempdatra[key].TeachSum) + parseInt(tempdatra[key].StuSum)); | |||
} | |||
}); | |||
$("#OrderNum").val(order); | |||
$('#TextBookIndentDetail').jfGridSet('refreshdata', tempdatra.sort(sortNumber)); | |||
top.layer.close(index); | |||
} | |||
}); | |||
} | |||
}); | |||
page.bind(); | |||
page.initData(); | |||
}, | |||
bind: function () { | |||
$('#DeptNo').lrDataSourceSelect({ code: 'CdDeptInfo', value: 'deptno', text: 'deptname' }); | |||
$('#MajorNo').lrDataSourceSelect({ code: 'CdMajorInfo', value: 'majorname', text: 'majorname' }); | |||
$('#LessonNo').lrDataSourceSelect({ code: 'LessonInfo', value: 'lessonno', text: 'lessonname' }); | |||
$('#AcademicYearNo').lrselect({ | |||
placeholder: "请选择学年", | |||
allowSearch: true, | |||
url: top.$.rootUrl + '/EducationalAdministration/TextBookIndent/GetAcademicYear', | |||
value: 'value', | |||
text: 'text' | |||
}); | |||
//学期 | |||
$('#Semester').lrselect({ | |||
placeholder: "请选择学年", | |||
allowSearch: true, | |||
url: top.$.rootUrl + '/EducationalAdministration/EADateArrange/GetSemester', | |||
value: 'value', | |||
text: 'text' | |||
}); | |||
$('#TextBookIndentDetail').jfGrid({ | |||
headData: [ | |||
{ | |||
label: "班级", name: "ClassNo", 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: 'TeachSum', width: 80, align: 'left' }, | |||
{ label: '学生人数', name: 'StuSum', width: 80, align: 'left' }, | |||
{ label: '备注', name: 'Remark', width: 100, align: 'left' }, | |||
], | |||
height: 400, | |||
mainId: 'ID,IndentID', | |||
reloadSelected: false, | |||
}); | |||
$('#TextBookName').lrGirdSelect({ | |||
url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=TextBookInfo', | |||
param: { strWhere: " IsDel = '0' and IsValid ='true' " }, | |||
height: 800, | |||
width: 1100, | |||
selectWord: 'textbookname', | |||
value: 'textbookname', | |||
text: 'textbookname', | |||
headData: | |||
[ | |||
{ label: "教材号", name: "publishno", width: 150, align: "left" }, | |||
{ label: "教材名称", name: "textbookname", width: 150, align: "left" }, | |||
{ label: "作者", name: "firstauthor", width: 150, align: "left" }, | |||
{ label: "其他作者", name: "otherauthor", width: 100, align: "left" }, | |||
{ label: "出版社", name: "publisher", width: 100, align: "left" }, | |||
{ | |||
label: "教材类型", name: "textbooktype", width: 100, align: "left", | |||
formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getAsync('dataItem', { | |||
key: value, | |||
code: 'TextBookType', | |||
callback: function (_data) { | |||
callback(_data.text); | |||
} | |||
}); | |||
} | |||
}, | |||
{ | |||
label: "教材性质", name: "textbooknature", width: 100, align: "left", | |||
formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getAsync('dataItem', { | |||
key: value, | |||
code: 'TextBookNature', | |||
callback: function (_data) { | |||
callback(_data.text); | |||
} | |||
}); | |||
} | |||
}, | |||
{ label: "价格", name: "price", width: 50, align: "left" }, | |||
{ label: "版次", name: "edition", width: 100, align: "left" }, | |||
{ label: "印次", name: "impression", width: 100, align: "left" }, | |||
], | |||
select: function (item) { | |||
////赋值 | |||
$("#PublishNo").val(item.publishno); | |||
$("#FirstAuthor").val(item.firstauthor); | |||
$("#TextBookName").val(item.textbookname); | |||
$("#OtherAuthor").val(item.otherauthor); | |||
} | |||
}); | |||
$('#Status').val(0); | |||
$('#CreateTime').val(learun.formatDate(new Date(), 'yyyy-MM-dd hh:mm:ss')); | |||
$('#CreateUserID')[0].lrvalue = learun.clientdata.get(['userinfo']).userId; | |||
$('#CreateUserID').val(learun.clientdata.get(['userinfo']).realName); | |||
}, | |||
initData: function () { | |||
if (!!keyValue) { | |||
$.lrSetForm(top.$.rootUrl + '/EducationalAdministration/TextBookIndent/GetFormData?keyValue=' + keyValue, function (data) { | |||
for (var id in data) { | |||
if (!!data[id].length && data[id].length > 0) { | |||
$('#' + id).jfGridSet('refreshdata', data[id]); | |||
tempdatra = data[id]; | |||
} | |||
else { | |||
$('[data-table="' + id + '"]').lrSetFormData(data[id]); | |||
//if (data[id].AAPrice) { | |||
// pricecount = data[id].AAPrice; | |||
//} | |||
} | |||
} | |||
}); | |||
} | |||
} | |||
}; | |||
refreshGirdData = function (temprow) { | |||
var ifnewrow = true; | |||
$.each(tempdatra, function (key, val) { | |||
if (tempdatra[key].ID === temprow.ID) { | |||
tempdatra[key] = temprow; | |||
ifnewrow = false; | |||
} | |||
}); | |||
if (ifnewrow) { | |||
tempdatra.push(temprow); | |||
} | |||
//订购数量 | |||
order = 0; | |||
for (var i = 0; i < tempdatra.length; i++) { | |||
order += (parseInt(tempdatra[i].TeachSum) + parseInt(tempdatra[i].StuSum)); | |||
} | |||
$("#OrderNum").val(order); | |||
$('#TextBookIndentDetail').jfGridSet('refreshdata', tempdatra.sort(sortNumber)); | |||
}; | |||
function sortNumber(a, b) { | |||
return a.StuSum - b.StuSum; | |||
} | |||
// 设置表单数据 | |||
setFormData = function (processId, param, callback) { | |||
if (!!processId) { | |||
$.lrSetForm(top.$.rootUrl + '/EducationalAdministration/TextBookIndent/GetFormDataByProcessId?processId=' + processId, function (data) { | |||
for (var id in data) { | |||
if (!!data[id] && data[id].length > 0) { | |||
$('#' + id).jfGridSet('refreshdata', data[id]); | |||
} | |||
else { | |||
if (id == 'TextBookIndent' && data[id]) { | |||
keyValue = data[id].ID; | |||
} | |||
$('[data-table="' + id + '"]').lrSetFormData(data[id]); | |||
} | |||
} | |||
}); | |||
} | |||
} | |||
// 验证数据是否填写完整 | |||
validForm = function () { | |||
if (!$('.lr-form-wrap').lrValidform()) { | |||
return false; | |||
} | |||
var datas = $('#TextBookIndentDetail').jfGridGet('rowdatas'); | |||
if (datas == null || datas.length == 0) { | |||
learun.alert.warning("申请未包含明细!请先新增明细!"); | |||
return false; | |||
} | |||
return true; | |||
}; | |||
// 保存数据 | |||
save = function (processId, callBack, i) { | |||
var postData = {}; | |||
var formData = $('[data-table="TextBookIndent"]').lrGetFormData(); | |||
if (!!processId) { | |||
formData.processId = processId; | |||
} | |||
postData.strEntity = JSON.stringify(formData); | |||
postData.strTextBookIndentDetailList = JSON.stringify($('#TextBookIndentDetail').jfGridGet('rowdatas')); | |||
$.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/TextBookIndent/SaveForm?keyValue=' + keyValue, postData, function (res) { | |||
// 保存成功后才回调 | |||
if (!!callBack) { | |||
callBack(res, formData, i); | |||
} | |||
}); | |||
}; | |||
page.init(); | |||
} |
@@ -0,0 +1,67 @@ | |||
@{ | |||
ViewBag.Title = "教材订单管理"; | |||
Layout = "~/Views/Shared/_Form.cshtml"; | |||
} | |||
<div class="lr-form-wrap" id="form"> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookIndent"> | |||
<div class="lr-form-item-title">专业部<font face="宋体">*</font></div> | |||
<div id="DeptNo" isvalid="yes" checkexpession="NotNull" readonly></div> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookIndent"> | |||
<div class="lr-form-item-title">专业<font face="宋体">*</font></div> | |||
<div id="MajorNo" isvalid="yes" checkexpession="NotNull" readonly></div> | |||
</div> | |||
<div class="col-xs-4 lr-form-item" data-table="TextBookIndent"> | |||
<div class="lr-form-item-title">课程<font face="宋体">*</font></div> | |||
<div id="LessonNo" isvalid="yes" checkexpession="NotNull" readonly></div> | |||
</div> | |||
<div class="col-xs-4 lr-form-item" data-table="TextBookIndent"> | |||
<div class="lr-form-item-title">学年<font face="宋体">*</font></div> | |||
<div id="AcademicYearNo" isvalid="yes" checkexpession="NotNull" readonly></div> | |||
</div> | |||
<div class="col-xs-4 lr-form-item" data-table="TextBookIndent"> | |||
<div class="lr-form-item-title">学期<font face="宋体">*</font></div> | |||
<div id="Semester" isvalid="yes" checkexpession="NotNull" readonly></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="TextBookIndent"> | |||
<div class="lr-form-item-title">所选书籍<font face="宋体">*</font></div> | |||
@*<div id="TextBookName" isvalid="yes" checkexpession="NotNull" readonly></div>*@ | |||
<input id="TextBookName" type="text" class="form-control" readonly /> | |||
</div> | |||
<div class="col-xs-4 lr-form-item" data-table="TextBookIndent"> | |||
<div class="lr-form-item-title">书籍</div> | |||
<input id="PublishNo" type="text" class="form-control" readonly /> | |||
</div> | |||
<div class="col-xs-4 lr-form-item" data-table="TextBookIndent"> | |||
<div class="lr-form-item-title">作者</div> | |||
<input id="FirstAuthor" type="text" class="form-control" readonly /> | |||
</div> | |||
<div class="col-xs-4 lr-form-item" data-table="TextBookIndent"> | |||
<div class="lr-form-item-title">其他作者</div> | |||
<input id="OtherAuthor" type="text" class="form-control" readonly /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="TextBookIndent"> | |||
<div class="lr-form-item-title">订购数量</div> | |||
<input id="OrderNum" type="number" class="form-control" readonly /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="TextBookIndent"> | |||
<div class="lr-form-item-title">备注</div> | |||
<textarea id="Remark" class="form-control" style="height:100px;" readonly></textarea> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="TextBookIndent" style="display: none; "> | |||
<div class="lr-form-item-title">当前信息</div> | |||
<input id="CreateTime" type="text" readonly class="form-control currentInfo lr-currentInfo-time" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="TextBookIndent" style="display: none; "> | |||
<div class="lr-form-item-title">当前信息</div> | |||
<input id="CreateUserID" type="text" readonly class="form-control currentInfo lr-currentInfo-user" /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookIndent" style="display: none; "> | |||
<div class="lr-form-item-title">状态</div> | |||
<input id="Status" type="text" class="form-control" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item lr-form-item-grid"> | |||
<div id="TextBookIndentDetail"></div> | |||
</div> | |||
</div> | |||
@Html.AppendJsFile("/Areas/EducationalAdministration/Views/TextBookIndent/FormView.js") |
@@ -0,0 +1,140 @@ | |||
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) | |||
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
* 创建人:超级管理员 | |||
* 日 期:2022-02-18 14:27 | |||
* 描 述:教材订单管理 | |||
*/ | |||
var acceptClick; | |||
var keyValue = request('keyValue'); | |||
// 设置权限 | |||
var setAuthorize; | |||
// 设置表单数据 | |||
var setFormData; | |||
// 验证数据是否填写完整 | |||
var validForm; | |||
// 保存数据 | |||
var save; | |||
var bootstrap = function ($, learun) { | |||
"use strict"; | |||
// 设置权限 | |||
setAuthorize = function (data) { | |||
if (!!data) { | |||
for (var field in data) { | |||
if (data[field].isLook != 1) {// 如果没有查看权限就直接移除 | |||
$('#' + data[field].fieldId).parent().remove(); | |||
} | |||
else { | |||
if (data[field].isEdit != 1) { | |||
$('#' + data[field].fieldId).attr('disabled', 'disabled'); | |||
if ($('#' + data[field].fieldId).hasClass('lrUploader-wrap')) { | |||
$('#' + data[field].fieldId).css({ 'padding-right': '58px' }); | |||
$('#' + data[field].fieldId).find('.btn-success').remove(); | |||
} | |||
} | |||
} | |||
} | |||
} | |||
}; | |||
var page = { | |||
init: function () { | |||
$('.lr-form-wrap').lrscroll(); | |||
page.bind(); | |||
page.initData(); | |||
}, | |||
bind: function () { | |||
$('#DeptNo').lrDataSourceSelect({ code: 'CdDeptInfo', value: 'deptno', text: 'deptname' }); | |||
$('#MajorNo').lrDataSourceSelect({ code: 'CdMajorInfo', value: 'majorname', text: 'majorname' }); | |||
$('#LessonNo').lrDataSourceSelect({ code: 'LessonInfo', value: 'lessonno', text: 'lessonname' }); | |||
$('#AcademicYearNo').lrselect({ | |||
placeholder: "请选择学年", | |||
allowSearch: true, | |||
url: top.$.rootUrl + '/EducationalAdministration/TextBookIndent/GetAcademicYear', | |||
value: 'value', | |||
text: 'text' | |||
}); | |||
//学期 | |||
$('#Semester').lrselect({ | |||
placeholder: "请选择学年", | |||
allowSearch: true, | |||
url: top.$.rootUrl + '/EducationalAdministration/EADateArrange/GetSemester', | |||
value: 'value', | |||
text: 'text' | |||
}); | |||
$('#TextBookIndentDetail').jfGrid({ | |||
headData: [ | |||
{ | |||
label: "班级", name: "ClassNo", 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: 'TeachSum', width: 80, align: 'left' }, | |||
{ label: '学生人数', name: 'StuSum', width: 80, align: 'left' }, | |||
{ label: '备注', name: 'Remark', width: 100, align: 'left' }, | |||
], | |||
height: 400, | |||
mainId: 'ID,IndentID', | |||
reloadSelected: false, | |||
}); | |||
}, | |||
initData: function () { | |||
if (!!keyValue) { | |||
$.lrSetForm(top.$.rootUrl + '/EducationalAdministration/TextBookIndent/GetFormData?keyValue=' + keyValue, function (data) { | |||
for (var id in data) { | |||
if (!!data[id].length && data[id].length > 0) { | |||
$('#' + id).jfGridSet('refreshdata', data[id]); | |||
} | |||
else { | |||
$('[data-table="' + id + '"]').lrSetFormData(data[id]); | |||
} | |||
} | |||
}); | |||
} | |||
} | |||
}; | |||
// 设置表单数据 | |||
setFormData = function (processId, param, callback) { | |||
if (!!processId) { | |||
$.lrSetForm(top.$.rootUrl + '/EducationalAdministration/TextBookIndent/GetFormDataByProcessId?processId=' + processId, function (data) { | |||
for (var id in data) { | |||
if (!!data[id] && data[id].length > 0) { | |||
$('#' + id).jfGridSet('refreshdata', data[id]); | |||
} | |||
else { | |||
if (id == 'TextBookIndent' && data[id]) { | |||
keyValue = data[id].ID; | |||
} | |||
$('[data-table="' + id + '"]').lrSetFormData(data[id]); | |||
} | |||
} | |||
}); | |||
} | |||
callback && callback(); | |||
} | |||
// 验证数据是否填写完整 | |||
validForm = function () { | |||
if (!$('body').lrValidform()) { | |||
return false; | |||
} | |||
return true; | |||
}; | |||
// 保存数据 | |||
save = function (processId, callBack, i) { | |||
var formData = {}; | |||
var res = {}; | |||
res.code = 200; | |||
if (!!processId) { | |||
formData.AAProcessId = processId; | |||
} | |||
callBack(res, i); | |||
}; | |||
page.init(); | |||
} |
@@ -0,0 +1,61 @@ | |||
@{ | |||
ViewBag.Title = "教材订单管理"; | |||
Layout = "~/Views/Shared/_Index.cshtml"; | |||
} | |||
<div class="lr-layout " > | |||
<div class="lr-layout-center"> | |||
<div class="lr-layout-wrap lr-layout-wrap-notitle "> | |||
<div class="lr-layout-tool"> | |||
<div class="lr-layout-tool-left"> | |||
<div class="lr-layout-tool-item"> | |||
<div id="datesearch"></div> | |||
</div> | |||
<div class="lr-layout-tool-item"> | |||
<div id="multiple_condition_query"> | |||
<div class="lr-query-formcontent"> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">专业部</div> | |||
<div id="DeptNo"></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">专业</div> | |||
<div id="MajorNo"></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">课程</div> | |||
<div id="LessonNo"></div> | |||
</div> | |||
<div class="col-xs-6 lr-form-item"> | |||
<div class="lr-form-item-title">学年</div> | |||
<div id="AcademicYearNo"></div> | |||
</div> | |||
<div class="col-xs-6 lr-form-item"> | |||
<div class="lr-form-item-title">学期</div> | |||
<div id="Semester"></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">书号</div> | |||
<input id="PublishNo" type="text" class="form-control" /> | |||
</div> | |||
</div> | |||
</div> | |||
</div> | |||
</div> | |||
<div class="lr-layout-tool-right"> | |||
<div class=" btn-group btn-group-sm"> | |||
<a id="lr_refresh" class="btn btn-default"><i class="fa fa-refresh"></i></a> | |||
</div> | |||
<div class=" btn-group btn-group-sm" learun-authorize="yes"> | |||
<a id="lr_add" class="btn btn-default"><i class="fa fa-plus"></i> 新增</a> | |||
<a id="lr_edit" class="btn btn-default"><i class="fa fa-pencil-square-o"></i> 编辑</a> | |||
<a id="lr_delete" class="btn btn-default"><i class="fa fa-trash-o"></i> 删除</a> | |||
<a id="lr_submit" class="btn btn-default"><i class="fa fa-plus"></i> 提交</a> | |||
<a id="lr_look" class="btn btn-default"><i class="fa fa-plus"></i> 查看</a> | |||
</div> | |||
</div> | |||
</div> | |||
<div class="lr-layout-body" id="gridtable"></div> | |||
</div> | |||
</div> | |||
</div> | |||
@Html.AppendJsFile("/Areas/EducationalAdministration/Views/TextBookIndent/Index.js") |
@@ -0,0 +1,288 @@ | |||
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) | |||
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
* 创建人:超级管理员 | |||
* 日 期:2022-02-18 14:27 | |||
* 描 述:教材订单管理 | |||
*/ | |||
var refreshGirdData; | |||
var bootstrap = function ($, learun) { | |||
"use strict"; | |||
var startTime; | |||
var endTime; | |||
var processId = ''; | |||
var page = { | |||
init: function () { | |||
page.initGird(); | |||
page.bind(); | |||
}, | |||
bind: function () { | |||
// 时间搜索框 | |||
$('#datesearch').lrdate({ | |||
dfdata: [ | |||
{ name: '今天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00') }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } }, | |||
{ name: '近7天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'd', -6) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } }, | |||
{ name: '近1个月', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'm', -1) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } }, | |||
{ name: '近3个月', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'm', -3) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } } | |||
], | |||
// 月 | |||
mShow: false, | |||
premShow: false, | |||
// 季度 | |||
jShow: false, | |||
prejShow: false, | |||
// 年 | |||
ysShow: false, | |||
yxShow: false, | |||
preyShow: false, | |||
yShow: false, | |||
// 默认 | |||
dfvalue: '1', | |||
selectfn: function (begin, end) { | |||
startTime = begin; | |||
endTime = end; | |||
page.search(); | |||
} | |||
}); | |||
$('#multiple_condition_query').lrMultipleQuery(function (queryJson) { | |||
page.search(queryJson); | |||
}, 250, 400); | |||
$('#DeptNo').lrDataSourceSelect({ code: 'CdDeptInfo', value: 'deptno', text: 'deptname' }); | |||
$('#MajorNo').lrDataSourceSelect({ code: 'CdMajorInfo', value: 'majorname', text: 'majorname' }); | |||
$('#LessonNo').lrDataSourceSelect({ code: 'LessonInfo', value: 'lessonno', text: 'lessonname' }); | |||
$('#ClassNo').lrDataSourceSelect({ code: 'LessonInfo', value: 'lessonno', text: 'lessonname' }); | |||
$('#AcademicYearNo').lrselect({ | |||
placeholder: "请选择学年", | |||
allowSearch: true, | |||
url: top.$.rootUrl + '/EducationalAdministration/TextBookIndent/GetAcademicYear', | |||
value: 'value', | |||
text: 'text' | |||
}); | |||
//学期 | |||
$('#Semester').lrselect({ | |||
placeholder: "请选择学年", | |||
allowSearch: true, | |||
url: top.$.rootUrl + '/EducationalAdministration/EADateArrange/GetSemester', | |||
value: 'value', | |||
text: 'text' | |||
}); | |||
// 刷新 | |||
$('#lr_refresh').on('click', function () { | |||
location.reload(); | |||
}); | |||
// 新增 | |||
$('#lr_add').on('click', function () { | |||
learun.layerForm({ | |||
id: 'formTextBookIndent', | |||
title: '新增', | |||
url: top.$.rootUrl + '/EducationalAdministration/TextBookIndent/Form', | |||
width: 1000, | |||
height: 700, | |||
callBack: function (id) { | |||
var res = false; | |||
// 验证数据 | |||
res = top[id].validForm(); | |||
// 保存数据 | |||
if (res) { | |||
//processId = learun.newGuid(); | |||
//res = top[id].save(processId, refreshGirdData); | |||
res = top[id].save('', function () { | |||
page.search(); | |||
}); | |||
} | |||
return res; | |||
} | |||
}); | |||
}); | |||
// 编辑 | |||
$('#lr_edit').on('click', function () { | |||
var keyValue = $('#gridtable').jfGridValue('ID'); | |||
if (learun.checkrow(keyValue)) { | |||
var Status = $('#gridtable').jfGridValue('Status'); | |||
if (Status != 0) { | |||
learun.alert.warning("当前项目已提交,不可编辑!"); | |||
return; | |||
} | |||
learun.layerForm({ | |||
id: 'formTextBookIndent', | |||
title: '编辑', | |||
url: top.$.rootUrl + '/EducationalAdministration/TextBookIndent/Form?keyValue=' + keyValue, | |||
width: 1000, | |||
height: 700, | |||
callBack: function (id) { | |||
var res = false; | |||
// 验证数据 | |||
res = top[id].validForm(); | |||
// 保存数据 | |||
if (res) { | |||
res = top[id].save('', function () { | |||
page.search(); | |||
}); | |||
} | |||
return res; | |||
} | |||
}); | |||
} | |||
}); | |||
// 删除 | |||
$('#lr_delete').on('click', function () { | |||
var keyValue = $('#gridtable').jfGridValue('ID'); | |||
var Status = $('#gridtable').jfGridValue('Status'); | |||
if (Status != 0) { | |||
learun.alert.warning("当前项目已提交,不可删除!"); | |||
return; | |||
} | |||
if (learun.checkrow(keyValue)) { | |||
learun.layerConfirm('是否确认删除该项!', function (res) { | |||
if (res) { | |||
learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/TextBookIndent/DeleteForm', { keyValue: keyValue }, function () { | |||
refreshGirdData(); | |||
}); | |||
} | |||
}); | |||
} | |||
}); | |||
// 提交 | |||
$('#lr_submit').on('click', function () { | |||
var keyValue = $('#gridtable').jfGridValue('ID'); | |||
if (learun.checkrow(keyValue)) { | |||
var Status = $('#gridtable').jfGridValue('Status'); | |||
if (Status != 0) { | |||
learun.alert.warning("当前项目已提交,请耐心等待审批!"); | |||
return; | |||
} | |||
learun.layerConfirm('是否确认提交该项!', function (res) { | |||
if (res) { | |||
processId = learun.newGuid(); | |||
learun.postForm(top.$.rootUrl + '/EducationalAdministration/TextBookIndent/ModifyStatus', { keyValue: keyValue, processId: processId }, function (res) { | |||
if (res.code == '200') { | |||
// 发起流程 | |||
var postData = { | |||
schemeCode: 'TextBookIndent',// 填写流程对应模板编号 | |||
processId: processId, | |||
level: '1', | |||
}; | |||
learun.httpAsync('Post', top.$.rootUrl + '/LR_NewWorkFlow/NWFProcess/CreateFlow', postData, function (data) { | |||
learun.loading(false); | |||
}); | |||
} | |||
refreshGirdData(); | |||
}); | |||
} | |||
}); | |||
} | |||
}); | |||
// 查看 | |||
$('#lr_look').on('click', function () { | |||
var keyValue = $('#gridtable').jfGridValue('ID'); | |||
if (learun.checkrow(keyValue)) { | |||
learun.layerForm({ | |||
id: 'formview', | |||
title: '查看', | |||
url: top.$.rootUrl + '/EducationalAdministration/TextBookIndent/FormView?keyValue=' + keyValue, | |||
width: 1000, | |||
height: 700, | |||
btn: null, | |||
}); | |||
} | |||
}); | |||
}, | |||
// 初始化列表 | |||
initGird: function () { | |||
$('#gridtable').jfGrid({ | |||
url: top.$.rootUrl + '/EducationalAdministration/TextBookIndent/GetPageList', | |||
headData: [ | |||
//{ label: "主键", name: "ID", width: 200, align: "left" }, | |||
{ | |||
label: "专业部", name: "DeptNo", 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: "MajorNo", width: 120, align: "left", | |||
formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getAsync('custmerData', { | |||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo', | |||
key: value, | |||
keyId: 'majorname', | |||
callback: function (_data) { | |||
callback(_data['majorname']); | |||
} | |||
}); | |||
} | |||
}, | |||
{ | |||
label: "课程", name: "LessonNo", width: 150, align: "left", | |||
formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getAsync('custmerData', { | |||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'LessonInfo', | |||
key: value, | |||
keyId: 'lessonno', | |||
callback: function (_data) { | |||
callback(_data['lessonname']); | |||
} | |||
}); | |||
} | |||
}, | |||
{ label: "学年", name: "AcademicYearNo", width: 100, align: "left" }, | |||
{ label: "学期", name: "Semester", width: 100, align: "left" }, | |||
{ label: "教材名称", name: "TextBookName", width: 200, align: "left" }, | |||
{ label: "书号(物料号)", name: "PublishNo", width: 150, align: "left" }, | |||
{ label: "作者", name: "FirstAuthor", width: 100, align: "left" }, | |||
{ label: "其他作者", name: "OtherAuthor", width: 150, align: "left" }, | |||
{ label: "出版社", name: "Publisher", width: 100, align: "left" }, | |||
{ label: "版次", name: "Edition", width: 100, align: "left" }, | |||
{ label: "单价", name: "Price", width: 100, align: "left" }, | |||
{ label: "订购数量", name: "OrderNum", width: 100, align: "left" }, | |||
{ label: "备注", name: "Remark", width: 200, align: "left" }, | |||
{ | |||
label: "状态", name: "Status", width: 100, align: "left", | |||
formatter: function (cellvalue) { | |||
if (cellvalue == '0') { | |||
return '<span class=\"label label-success\">草稿</span>'; | |||
} else if (cellvalue == '1') { | |||
return '<span class=\"label label-danger\">审批中</span>'; | |||
} else if (cellvalue == '2') { | |||
return '<span class=\"label label-info\">审批通过</span>'; | |||
} | |||
} | |||
}, | |||
{ label: "录入时间", name: "CreateTime", width: 100, align: "left" }, | |||
{ | |||
label: "创建用户", name: "CreateUserID", width: 100, align: "left", | |||
formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getAsync('user', { | |||
key: value, | |||
callback: function (_data) { | |||
callback(_data.name); | |||
} | |||
}); | |||
} | |||
}, | |||
], | |||
mainId: 'ID', | |||
sidx: 'CreateTime desc,Status desc', | |||
isPage: true | |||
}); | |||
}, | |||
search: function (param) { | |||
param = param || {}; | |||
param.StartTime = startTime; | |||
param.EndTime = endTime; | |||
$('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); | |||
} | |||
}; | |||
refreshGirdData = function () { | |||
page.search(); | |||
}; | |||
page.init(); | |||
} |
@@ -0,0 +1,39 @@ | |||
@{ | |||
ViewBag.Title = "TextBookIndentDetail"; | |||
Layout = "~/Views/Shared/_Index.cshtml"; | |||
} | |||
<div class="lr-layout lr-layout-left-center" id="lr_layout"> | |||
<div class="lr-layout-left"> | |||
<div class="lr-layout-wrap"> | |||
<div class="lr-layout-title">树形目录</div> | |||
<div id="tree" class="lr-layout-body"></div> | |||
</div> | |||
</div> | |||
<div class="lr-layout-center"> | |||
<div class="lr-layout-wrap"> | |||
<div class="lr-layout-title">标题</div> | |||
<div class="lr-layout-tool"> | |||
<div class="lr-layout-tool-left"> | |||
<div class="lr-layout-tool-item"> | |||
<input id="txt_Keyword" type="text" class="form-control" placeholder="请输入要查询关键字" /> | |||
</div> | |||
<div class="lr-layout-tool-item"> | |||
<a id="btn_Search" class="btn btn-primary btn-sm"><i class="fa fa-search"></i> 查询</a> | |||
</div> | |||
</div> | |||
<div class="lr-layout-tool-right"> | |||
<div class=" btn-group btn-group-sm"> | |||
<a id="lr_refresh" class="btn btn-default"><i class="fa fa-refresh"></i></a> | |||
</div> | |||
<div class=" btn-group btn-group-sm" learun-authorize="yes"> | |||
<a id="lr_add" class="btn btn-default"><i class="fa fa-plus"></i> 新增</a> | |||
<a id="lr_edit" class="btn btn-default"><i class="fa fa-pencil-square-o"></i> 编辑</a> | |||
<a id="lr_delete" class="btn btn-default"><i class="fa fa-trash-o"></i> 删除</a> | |||
</div> | |||
</div> | |||
</div> | |||
<div class="lr-layout-body" id="gridtable"></div> | |||
</div> | |||
</div> | |||
</div> | |||
@Html.AppendJsFile("/Areas/EducationalAdministration/Views/TextBookIndentDetail/Index.js") |
@@ -0,0 +1,105 @@ | |||
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) | |||
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
* 创建人:超级管理员 | |||
* 日 期:2022-02-27 09:35 | |||
* 描 述:TextBookIndentDetail | |||
*/ | |||
var selectedRow; | |||
var refreshGirdData; | |||
var bootstrap = function ($, learun) { | |||
"use strict"; | |||
var page = { | |||
init: function () { | |||
page.initGird(); | |||
page.bind(); | |||
}, | |||
bind: function () { | |||
// 查询 | |||
$('#btn_Search').on('click', function () { | |||
var keyword = $('#txt_Keyword').val(); | |||
page.search({ keyword: keyword }); | |||
}); | |||
$('#ClassNo').lrDataSourceSelect({ code: 'LessonInfo', value: 'lessonno', text: 'lessonname' }); | |||
// 刷新 | |||
$('#lr_refresh').on('click', function () { | |||
location.reload(); | |||
}); | |||
// 新增 | |||
$('#lr_add').on('click', function () { | |||
selectedRow = null; | |||
learun.layerForm({ | |||
id: 'form', | |||
title: '新增', | |||
url: top.$.rootUrl + '/EducationalAdministration/TextBookIndentDetail/Form', | |||
width: 700, | |||
height: 400, | |||
callBack: function (id) { | |||
return top[id].acceptClick(refreshGirdData); | |||
} | |||
}); | |||
}); | |||
// 编辑 | |||
$('#lr_edit').on('click', function () { | |||
var keyValue = $('#gridtable').jfGridValue('ID'); | |||
selectedRow = $('#gridtable').jfGridGet('rowdata'); | |||
if (learun.checkrow(keyValue)) { | |||
learun.layerForm({ | |||
id: 'form', | |||
title: '编辑', | |||
url: top.$.rootUrl + '/EducationalAdministration/TextBookIndentDetail/Form?keyValue=' + keyValue, | |||
width: 700, | |||
height: 400, | |||
callBack: function (id) { | |||
return top[id].acceptClick(refreshGirdData); | |||
} | |||
}); | |||
} | |||
}); | |||
// 删除 | |||
$('#lr_delete').on('click', function () { | |||
var keyValue = $('#gridtable').jfGridValue('ID'); | |||
if (learun.checkrow(keyValue)) { | |||
learun.layerConfirm('是否确认删除该项!', function (res) { | |||
if (res) { | |||
learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/TextBookIndentDetail/DeleteForm', { keyValue: keyValue}, function () { | |||
}); | |||
} | |||
}); | |||
} | |||
}); | |||
}, | |||
initGird: function () { | |||
$('#gridtable').lrAuthorizeJfGrid({ | |||
url: top.$.rootUrl + '/EducationalAdministration/TextBookIndentDetail/GetPageList', | |||
headData: [ | |||
{ label: 'ID', name: 'ID', width: 200, align: "left" }, | |||
{ label: 'IndentId', name: 'IndentId', width: 200, align: "left" }, | |||
{ label: 'DeptNo', name: 'DeptNo', width: 200, align: "left" }, | |||
{ label: 'MajorNo', name: 'MajorNo', width: 200, align: "left" }, | |||
{ label: 'ClassNo', name: 'ClassNo', width: 200, align: "left" }, | |||
{ label: 'TeachSum', name: 'TeachSum', width: 200, align: "left" }, | |||
{ label: 'StuSum', name: 'StuSum', width: 200, align: "left" }, | |||
{ label: 'Price', name: 'Price', width: 200, align: "left" }, | |||
{ label: 'BookNo', name: 'BookNo', width: 200, align: "left" }, | |||
{ label: 'BooName', name: 'BooName', width: 200, align: "left" }, | |||
{ label: '出版号', name: 'PublishNo', width: 200, align: "left" }, | |||
{ label: 'Remark', name: 'Remark', width: 200, align: "left" }, | |||
{ label: 'CreateTime', name: 'CreateTime', width: 200, align: "left" }, | |||
{ label: 'CreateUserID', name: 'CreateUserID', width: 200, align: "left" }, | |||
{ label: 'LessonNo', name: 'LessonNo', width: 200, align: "left" }, | |||
], | |||
mainId:'ID', | |||
isPage: true | |||
}); | |||
page.search(); | |||
}, | |||
search: function (param) { | |||
param = param || {}; | |||
$('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); | |||
} | |||
}; | |||
refreshGirdData = function () { | |||
$('#gridtable').jfGridSet('reload'); | |||
}; | |||
page.init(); | |||
} |
@@ -0,0 +1,79 @@ | |||
@{ | |||
ViewBag.Title = "教材信息管理"; | |||
Layout = "~/Views/Shared/_Form.cshtml"; | |||
} | |||
<div class="lr-form-wrap" id="form"> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookInfo"> | |||
<div class="lr-form-item-title">教材号<font face="宋体">*</font></div> | |||
<input id="TextBookNo" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookInfo"> | |||
<div class="lr-form-item-title">教材名称<font face="宋体">*</font></div> | |||
<input id="TextBookName" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookInfo"> | |||
<div class="lr-form-item-title">出版号<font face="宋体">*</font></div> | |||
<input id="PublishNo" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" /> | |||
</div> | |||
@*<div class="col-xs-6 lr-form-item" data-table="TextBookInfo" > | |||
<div class="lr-form-item-title">专业部<font face="宋体">*</font></div> | |||
<div id="DeptNo" isvalid="yes" checkexpession="NotNull" ></div> | |||
</div>*@ | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookInfo"> | |||
<div class="lr-form-item-title">第一作者<font face="宋体">*</font></div> | |||
<input id="FirstAuthor" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookInfo"> | |||
<div class="lr-form-item-title">其他作者</div> | |||
<input id="OtherAuthor" type="text" class="form-control" /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookInfo"> | |||
<div class="lr-form-item-title">出版日期<font face="宋体">*</font></div> | |||
<input id="Pubdate" type="text" class="form-control lr-input-wdatepicker" onfocus="WdatePicker({ dateFmt:'yyyy-MM-dd',onpicked: function () { $('#Pubdate').trigger('change'); } })" isvalid="yes" checkexpession="NotNull" /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookInfo"> | |||
<div class="lr-form-item-title">出版社<font face="宋体">*</font></div> | |||
<input id="Publisher" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookInfo"> | |||
<div class="lr-form-item-title">教材类型<font face="宋体">*</font></div> | |||
<div id="TextBookType" isvalid="yes" checkexpession="NotNull"></div> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookInfo"> | |||
<div class="lr-form-item-title">教材性质<font face="宋体">*</font></div> | |||
<div id="TextBookNature" isvalid="yes" checkexpession="NotNull"></div> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookInfo"> | |||
<div class="lr-form-item-title">价格</div> | |||
<input id="Price" type="text" class="form-control" isvalid="no" checkexpession="PositiveFloatint" /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookInfo"> | |||
<div class="lr-form-item-title">版次</div> | |||
<input id="Edition" type="text" class="form-control" /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookInfo"> | |||
<div class="lr-form-item-title">印次</div> | |||
<input id="Impression" type="text" class="form-control" /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookInfo"> | |||
<div class="lr-form-item-title">是否有练习册</div> | |||
<div id="IsWorkBook"></div> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookInfo"> | |||
<div class="lr-form-item-title">是否有教参教辅</div> | |||
<div id="IsTeachConsult"></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="TextBookInfo"> | |||
<div class="lr-form-item-title">内容简介</div> | |||
<textarea id="Description" class="form-control" style="height:100px;"></textarea> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookInfo" style="display: none; "> | |||
<div class="lr-form-item-title">当前信息</div> | |||
<input id="CreateUserID" type="text" readonly class="form-control currentInfo lr-currentInfo-user" /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookInfo" style="display: none; "> | |||
<div class="lr-form-item-title">当前信息</div> | |||
<input id="Createdate" type="text" readonly class="form-control currentInfo lr-currentInfo-time" /> | |||
</div> | |||
</div> | |||
@Html.AppendJsFile("/Areas/EducationalAdministration/Views/TextBookInfo/Form.js") |
@@ -0,0 +1,58 @@ | |||
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) | |||
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
* 创建人:超级管理员 | |||
* 日 期:2022-01-24 12:19 | |||
* 描 述:教材信息管理 | |||
*/ | |||
var acceptClick; | |||
var keyValue = request('keyValue'); | |||
var bootstrap = function ($, learun) { | |||
"use strict"; | |||
var page = { | |||
init: function () { | |||
$('.lr-form-wrap').lrscroll(); | |||
page.bind(); | |||
page.initData(); | |||
}, | |||
bind: function () { | |||
//$('#DeptNo').lrDataSourceSelect({ code: 'CdDeptInfo', value: 'deptno', text: 'deptname' }); | |||
$('#TextBookType').lrDataItemSelect({ code: 'TextBookType' }); | |||
$('#TextBookNature').lrDataItemSelect({ code: 'TextBookNature' }); | |||
$('#IsWorkBook').lrDataItemSelect({ code: 'YesOrNoBit' }); | |||
$('#IsTeachConsult').lrDataItemSelect({ code: 'YesOrNoBit' }); | |||
$('#CreateUserID')[0].lrvalue = learun.clientdata.get(['userinfo']).userId; | |||
$('#CreateUserID').val(learun.clientdata.get(['userinfo']).realName); | |||
$('#Createdate').val(learun.formatDate(new Date(), 'yyyy-MM-dd hh:mm:ss')); | |||
}, | |||
initData: function () { | |||
if (!!keyValue) { | |||
$.lrSetForm(top.$.rootUrl + '/EducationalAdministration/TextBookInfo/GetFormData?keyValue=' + keyValue, function (data) { | |||
for (var id in data) { | |||
if (!!data[id].length && data[id].length > 0) { | |||
$('#' + id).jfGridSet('refreshdata', data[id]); | |||
} | |||
else { | |||
$('[data-table="' + id + '"]').lrSetFormData(data[id]); | |||
} | |||
} | |||
}); | |||
} | |||
} | |||
}; | |||
// 保存数据 | |||
acceptClick = function (callBack) { | |||
if (!$('body').lrValidform()) { | |||
return false; | |||
} | |||
var postData = { | |||
strEntity: JSON.stringify($('body').lrGetFormData()) | |||
}; | |||
$.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/TextBookInfo/SaveForm?keyValue=' + keyValue, postData, function (res) { | |||
// 保存成功后才回调 | |||
if (!!callBack) { | |||
callBack(); | |||
} | |||
}); | |||
}; | |||
page.init(); | |||
} |
@@ -0,0 +1,50 @@ | |||
@{ | |||
ViewBag.Title = "教材信息管理"; | |||
Layout = "~/Views/Shared/_Index.cshtml"; | |||
} | |||
<div class="lr-layout " > | |||
<div class="lr-layout-center"> | |||
<div class="lr-layout-wrap lr-layout-wrap-notitle "> | |||
<div class="lr-layout-tool"> | |||
<div class="lr-layout-tool-left"> | |||
<div class="lr-layout-tool-item"> | |||
<div id="multiple_condition_query"> | |||
<div class="lr-query-formcontent"> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">教材名称</div> | |||
<input id="TextBookName" type="text" class="form-control" /> | |||
</div> | |||
@*<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">专业部</div> | |||
<div id="DeptNo"></div> | |||
</div>*@ | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">教材类型</div> | |||
<div id="TextBookType"></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">教材性质</div> | |||
<div id="TextBookNature"></div> | |||
</div> | |||
</div> | |||
</div> | |||
</div> | |||
</div> | |||
<div class="lr-layout-tool-right"> | |||
<div class=" btn-group btn-group-sm"> | |||
<a id="lr_refresh" class="btn btn-default"><i class="fa fa-refresh"></i></a> | |||
</div> | |||
<div class=" btn-group btn-group-sm" learun-authorize="yes"> | |||
<a id="lr_add" class="btn btn-default"><i class="fa fa-plus"></i> 新增</a> | |||
<a id="lr_edit" class="btn btn-default"><i class="fa fa-pencil-square-o"></i> 编辑</a> | |||
<a id="lr_delete" class="btn btn-default"><i class="fa fa-trash-o"></i> 删除</a> | |||
<a id="lr_print" class="btn btn-default"><i class="fa fa-print"></i> 打印</a> | |||
<a id="lr_enabled" class="btn btn-default"><i class="fa fa-lock"></i> 启用</a> | |||
<a id="lr_disabled" class="btn btn-default"><i class="fa fa-unlock"></i> 禁用</a></div> | |||
</div> | |||
</div> | |||
<div class="lr-layout-body" id="gridtable"></div> | |||
</div> | |||
</div> | |||
</div> | |||
@Html.AppendJsFile("/Areas/EducationalAdministration/Views/TextBookInfo/Index.js") |
@@ -0,0 +1,243 @@ | |||
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) | |||
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
* 创建人:超级管理员 | |||
* 日 期:2022-01-24 12:19 | |||
* 描 述:教材信息管理 | |||
*/ | |||
var refreshGirdData; | |||
var bootstrap = function ($, learun) { | |||
"use strict"; | |||
var page = { | |||
init: function () { | |||
page.initGird(); | |||
page.bind(); | |||
}, | |||
bind: function () { | |||
$('#multiple_condition_query').lrMultipleQuery(function (queryJson) { | |||
page.search(queryJson); | |||
}, 220, 400); | |||
//$('#DeptNo').lrDataSourceSelect({ code: 'CdDeptInfo', value: 'deptno', text: 'deptname' }); | |||
$('#TextBookType').lrDataItemSelect({ code: 'TextBookType' }); | |||
$('#TextBookNature').lrDataItemSelect({ code: 'TextBookNature' }); | |||
// 刷新 | |||
$('#lr_refresh').on('click', function () { | |||
location.reload(); | |||
}); | |||
// 新增 | |||
$('#lr_add').on('click', function () { | |||
learun.layerForm({ | |||
id: 'form', | |||
title: '新增', | |||
url: top.$.rootUrl + '/EducationalAdministration/TextBookInfo/Form', | |||
width: 800, | |||
height: 500, | |||
callBack: function (id) { | |||
return top[id].acceptClick(refreshGirdData); | |||
} | |||
}); | |||
}); | |||
// 编辑 | |||
$('#lr_edit').on('click', function () { | |||
var keyValue = $('#gridtable').jfGridValue('ID'); | |||
if (learun.checkrow(keyValue)) { | |||
if (keyValue.indexOf(',') != -1) { | |||
learun.alert.warning("只能选择一条记录进行编辑!"); | |||
return; | |||
} | |||
var IsValid = $('#gridtable').jfGridValue('IsValid'); | |||
if (IsValid == "true") { | |||
learun.alert.warning("选中记录中包含已启用项目,已启用项不可编辑!"); | |||
return; | |||
} | |||
learun.layerForm({ | |||
id: 'form', | |||
title: '编辑', | |||
url: top.$.rootUrl + '/EducationalAdministration/TextBookInfo/Form?keyValue=' + keyValue, | |||
width: 800, | |||
height: 500, | |||
callBack: function (id) { | |||
return top[id].acceptClick(refreshGirdData); | |||
} | |||
}); | |||
} | |||
}); | |||
// 删除 | |||
$('#lr_delete').on('click', function () { | |||
var keyValue = $('#gridtable').jfGridValue('ID'); | |||
if (learun.checkrow(keyValue)) { | |||
var IsValid = $('#gridtable').jfGridValue('IsValid'); | |||
if (IsValid.indexOf('true') != -1) { | |||
learun.alert.warning("选中记录中包含已启用项目,已启用项不能删除!"); | |||
return; | |||
} | |||
learun.layerConfirm('是否确认删除该项!', function (res) { | |||
if (res) { | |||
learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/TextBookInfo/DeleteForm', { keyValue: keyValue }, function () { | |||
refreshGirdData(); | |||
}); | |||
} | |||
}); | |||
} | |||
}); | |||
// 打印 | |||
$('#lr_print').on('click', function () { | |||
$('#gridtable').jqprintTable(); | |||
}); | |||
//启用 | |||
$('#lr_enabled').on('click', function () { | |||
var keyValue = $('#gridtable').jfGridValue('ID'); | |||
if (learun.checkrow(keyValue)) { | |||
var IsValid = $('#gridtable').jfGridValue('IsValid'); | |||
if (IsValid.indexOf('true') != -1) { | |||
learun.alert.warning("选中记录中包含已启用项!"); | |||
return; | |||
} | |||
learun.layerConfirm('是否确认启用选中项?', function (res) { | |||
if (res) { | |||
learun.postForm(top.$.rootUrl + '/EducationalAdministration/TextBookInfo/EnableEntity', { keyValue: keyValue, IsValid: '1' }, function () { | |||
refreshGirdData(); | |||
}); | |||
} | |||
}); | |||
} | |||
}); | |||
//禁用 | |||
$('#lr_disabled').on('click', function () { | |||
var keyValue = $('#gridtable').jfGridValue('ID'); | |||
if (learun.checkrow(keyValue)) { | |||
var IsValid = $('#gridtable').jfGridValue('IsValid'); | |||
if (IsValid.indexOf('false') != -1) { | |||
learun.alert.warning("选中记录中包含已启用项!"); | |||
return; | |||
} | |||
learun.layerConfirm('是否确认禁用选中项?', function (res) { | |||
if (res) { | |||
learun.postForm(top.$.rootUrl + '/EducationalAdministration/TextBookInfo/DisableEntity', { keyValue: keyValue, IsValid: '0' }, function () { | |||
refreshGirdData(); | |||
}); | |||
} | |||
}); | |||
} | |||
}); | |||
}, | |||
// 初始化列表 | |||
initGird: function () { | |||
$('#gridtable').lrAuthorizeJfGrid({ | |||
url: top.$.rootUrl + '/EducationalAdministration/TextBookInfo/GetPageList', | |||
headData: [ | |||
{ label: "教材号", name: "TextBookNo", width: 150, align: "left" }, | |||
{ label: "教材名称", name: "TextBookName", width: 150, align: "left" }, | |||
{ label: "出版号", name: "PublishNo", width: 100, align: "left" }, | |||
{ | |||
label: "专业部", name: "DeptNo", 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: "FirstAuthor", width: 100, align: "left" }, | |||
{ label: "其他作者", name: "OtherAuthor", width: 100, align: "left" }, | |||
{ | |||
label: "出版日期", name: "Pubdate", width: 80, align: "left", | |||
formatter: function (value) { | |||
return learun.formatDate(value, 'yyyy-MM-dd'); | |||
} | |||
}, | |||
{ label: "出版社", name: "Publisher", width: 100, align: "left" }, | |||
{ | |||
label: "教材类型", name: "TextBookType", width: 100, align: "left", | |||
formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getAsync('dataItem', { | |||
key: value, | |||
code: 'TextBookType', | |||
callback: function (_data) { | |||
callback(_data.text); | |||
} | |||
}); | |||
} | |||
}, | |||
{ | |||
label: "教材性质", name: "TextBookNature", width: 100, align: "left", | |||
formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getAsync('dataItem', { | |||
key: value, | |||
code: 'TextBookNature', | |||
callback: function (_data) { | |||
callback(_data.text); | |||
} | |||
}); | |||
} | |||
}, | |||
{ label: "价格", name: "Price", width: 60, align: "left" }, | |||
{ label: "版次", name: "Edition", width: 100, align: "left" }, | |||
{ label: "印次", name: "Impression", width: 100, align: "left" }, | |||
{ | |||
label: "是否有练习册", name: "IsWorkBook", width: 100, align: "left", | |||
formatter: function (cellvalue) { | |||
return cellvalue == true ? "<span class=\"label label-success\">是</span>" : | |||
"<span class=\"label label-danger\">否</span>"; | |||
} | |||
}, | |||
{ | |||
label: "是否有教参教辅", name: "IsTeachConsult", width: 100, align: "left", | |||
formatter: function (cellvalue) { | |||
return cellvalue == true ? "<span class=\"label label-success\">是</span>" : | |||
"<span class=\"label label-danger\">否</span>"; | |||
} | |||
}, | |||
{ label: "内容简介", name: "Description", width: 100, align: "left" }, | |||
{ | |||
label: "录入用户", name: "CreateUserID", width: 100, align: "left", | |||
formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getAsync('user', { | |||
key: value, | |||
callback: function (_data) { | |||
callback(_data.name); | |||
} | |||
}); | |||
} | |||
}, | |||
{ label: "录入时间", name: "Createdate", width: 100, align: "left" }, | |||
{ | |||
label: "修改用户", name: "UpdateUserID", width: 100, align: "left", | |||
formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getAsync('user', { | |||
key: value, | |||
callback: function (_data) { | |||
callback(_data.name); | |||
} | |||
}); | |||
} | |||
}, | |||
{ label: "修改时间", name: "Updatetime", width: 100, align: "left" }, | |||
{ | |||
label: "是否有效", name: "IsValid", width: 80, align: "center", | |||
formatter: function (cellvalue) { | |||
return cellvalue == true ? "<i class=\"fa fa-toggle-on\"></i>" : "<i class=\"fa fa-toggle-off\"></i>"; | |||
} | |||
} | |||
], | |||
mainId: 'ID', | |||
isPage: true, | |||
isMultiselect: true, | |||
sidx: 'Createdate asc' | |||
}); | |||
page.search(); | |||
}, | |||
search: function (param) { | |||
param = param || {}; | |||
param.SqlParameter = " and Isdel = '0' "; | |||
$('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); | |||
} | |||
}; | |||
refreshGirdData = function () { | |||
$('#gridtable').jfGridSet('reload'); | |||
}; | |||
page.init(); | |||
} |
@@ -0,0 +1,55 @@ | |||
@{ | |||
ViewBag.Title = "教材库存表"; | |||
Layout = "~/Views/Shared/_Form.cshtml"; | |||
} | |||
<div class="lr-form-wrap"> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookInOut"> | |||
<div class="lr-form-item-title">库存单</div> | |||
<input id="BookCode" type="text" class="form-control" readonly /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookInOut"> | |||
<div class="lr-form-item-title">课程</div> | |||
<div id="LessonNo" isvalid="yes" checkexpession="NotNull" readonly></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="TextBookInOut"> | |||
<div class="lr-form-item-title">所选书籍</div> | |||
<input id="TextBookName" type="text" class="form-control" readonly /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookInOut"> | |||
<div class="lr-form-item-title">出版号</div> | |||
<input id="PublishNo" type="text" class="form-control" readonly /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookInOut"> | |||
<div class="lr-form-item-title">作者</div> | |||
<input id="FirstAuthor" type="text" class="form-control" readonly /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookInOut"> | |||
<div class="lr-form-item-title">其他作者</div> | |||
<input id="OtherAuthor" type="text" class="form-control" readonly /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookInOut"> | |||
<div class="lr-form-item-title">出版社</div> | |||
<input id="Publisher" type="text" class="form-control" readonly /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookInOut"> | |||
<div class="lr-form-item-title">版次</div> | |||
<input id="Edition" type="text" class="form-control" readonly /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookInOut"> | |||
<div class="lr-form-item-title">当前库存</div> | |||
<input id="FinallyNum" type="text" class="form-control" readonly /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="TextBookInOut"> | |||
<div class="lr-form-item-title">备注</div> | |||
<textarea id="Remark" class="form-control" style="height: 100px;" readonly></textarea> | |||
</div> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">明细操作</div> | |||
<input id="detailadd" type="button" class="btn btn-success" value="添加出库单" /> | |||
<input id="detaildel" type="button" class="btn btn-danger" value="移除出库单" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item lr-form-item-grid"> | |||
<div id="TextBookOut"></div> | |||
</div> | |||
</div> | |||
@Html.AppendJsFile("/Areas/EducationalAdministration/Views/TextBookOut/Form.js") |
@@ -0,0 +1,202 @@ | |||
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) | |||
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
* 创建人:超级管理员 | |||
* 日 期:2022-03-02 10:37 | |||
* 描 述:教材库存表 | |||
*/ | |||
var acceptClick; | |||
var keyValue = request('keyValue'); | |||
// 设置权限 | |||
var setAuthorize; | |||
// 设置表单数据 | |||
var setFormData; | |||
// 验证数据是否填写完整 | |||
var validForm; | |||
// 保存数据 | |||
var save; | |||
var selectedRow; | |||
var refreshGirdData; | |||
var tempdatra = new Array(); | |||
var bootstrap = function ($, learun) { | |||
"use strict"; | |||
// 设置权限 | |||
setAuthorize = function (data) { | |||
}; | |||
var page = { | |||
init: function () { | |||
$('.lr-form-wrap').lrscroll(); | |||
$("#detailadd").on('click', function () { | |||
selectedRow = null; | |||
learun.layerForm({ | |||
id: 'formTextBookIn', | |||
title: '申请出库', | |||
url: top.$.rootUrl + '/EducationalAdministration/TextBookOut/FormOut', | |||
width: 800, | |||
height: 500, | |||
callBack: function (id) { | |||
return top[id].acceptClick(refreshGirdData); | |||
} | |||
}); | |||
}); | |||
$("#detaildel").on('click', function () { | |||
var keyValue = $('#TextBookOut').jfGridValue('ID'); | |||
if (learun.checkrow(keyValue)) { | |||
learun.layerConfirm('是否确认删除该项!', function (res, index) { | |||
if (res) { | |||
$.each(tempdatra, function (key, val) { | |||
if (tempdatra[key].ID === keyValue) { | |||
tempdatra.splice(key, 1); | |||
} | |||
}); | |||
$('#TextBookOut').jfGridSet('refreshdata', tempdatra); | |||
learun.layerClose(window.name); | |||
top.layer.close(index); | |||
} | |||
}); | |||
} | |||
}); | |||
page.bind(); | |||
page.initData(); | |||
}, | |||
bind: function () { | |||
$('#LessonNo').lrDataSourceSelect({ code: 'LessonInfo', value: 'lessonno', text: 'lessonname' }); | |||
$('#TextBookOut').jfGrid({ | |||
headData: [ | |||
{ label: '出库单', name: 'BookCode', width: 180, align: 'left' }, | |||
{ | |||
label: "专业部", name: "DeptNo", 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: "MajorNo", width: 120, 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: "LessonNo", width: 150, align: "left", | |||
formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getAsync('custmerData', { | |||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'LessonInfo', | |||
key: value, | |||
keyId: 'lessonno', | |||
callback: function (_data) { | |||
callback(_data['lessonname']); | |||
} | |||
}); | |||
} | |||
}, | |||
{ | |||
label: "班级", name: "ClassNo", 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: 'AcademicYearNo', width: 80, align: 'left' }, | |||
{ label: '学期', name: 'Semester', width: 80, align: 'left' }, | |||
{ label: '领用人', name: 'Recipient', width: 100, align: 'left' }, | |||
{ label: '出库数量', name: 'Variate', width: 100, align: 'left' }, | |||
{ label: '出库时间', name: 'CreateTime', width: 200, align: 'left' }, | |||
{ label: '出库用户', name: 'CrateUserID', width: 100, align: 'left' }, | |||
{ label: '备注', name: 'Remark', width: 100, align: 'left' }, | |||
], | |||
height: 400, | |||
mainId: 'CreateTime desc', | |||
reloadSelected: false, | |||
}); | |||
}, | |||
initData: function () { | |||
if (!!keyValue) { | |||
$.lrSetForm(top.$.rootUrl + '/EducationalAdministration/TextBookOut/GetFormDataEdit?keyValue=' + keyValue, function (data) { | |||
for (var id in data) { | |||
if (!!data[id].length && data[id].length > 0) { | |||
$('#' + id).jfGridSet('refreshdata', data[id]); | |||
} | |||
else { | |||
$('[data-table="' + id + '"]').lrSetFormData(data[id]); | |||
} | |||
} | |||
}); | |||
} | |||
} | |||
}; | |||
refreshGirdData = function (temprow) { | |||
var ifnewrow = true; | |||
$.each(tempdatra, function (key, val) { | |||
if (tempdatra[key].BookCode === temprow.InOutBook) { | |||
tempdatra[key] = temprow; | |||
ifnewrow = false; | |||
} | |||
}); | |||
if (ifnewrow) { | |||
tempdatra.push(temprow); | |||
} | |||
$('#TextBookOut').jfGridSet('refreshdata', tempdatra); | |||
}; | |||
// 设置表单数据 | |||
setFormData = function (processId, param, callback) { | |||
if (!!processId) { | |||
$.lrSetForm(top.$.rootUrl + '/EducationalAdministration/TextBookOut/GetFormDataByProcessId?processId=' + processId, function (data) { | |||
for (var id in data) { | |||
if (!!data[id] && data[id].length > 0) { | |||
$('#' + id).jfGridSet('refreshdata', data[id]); | |||
} | |||
else { | |||
if (id == 'TextBookOut' && data[id]) { | |||
keyValue = data[id].ID; | |||
} | |||
$('[data-table="' + id + '"]').lrSetFormData(data[id]); | |||
} | |||
} | |||
}); | |||
} | |||
} | |||
// 验证数据是否填写完整 | |||
validForm = function () { | |||
var datas = $('#TextBookOut').jfGridGet('rowdatas'); | |||
if (datas == null || datas.length == 0) { | |||
learun.alert.warning("申请未包含出库申请!请先添加入库申请!"); | |||
return false; | |||
} | |||
return true; | |||
}; | |||
// 保存数据 | |||
save = function (callBack) { | |||
var postData = {}; | |||
var formData = $('[data-table="TextBookInOut"]').lrGetFormData(); | |||
postData.strEntity = JSON.stringify(formData); | |||
postData.strTextBookOutList = JSON.stringify($('#TextBookOut').jfGridGet('rowdatas')); | |||
$.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/TextBookOut/SaveForm?keyValue=' + keyValue, postData, function (res) { | |||
// 保存成功后才回调 | |||
if (!!callBack) { | |||
callBack(); | |||
} | |||
}); | |||
}; | |||
page.init(); | |||
} |
@@ -0,0 +1,54 @@ | |||
@{ | |||
ViewBag.Title = "教材库存表"; | |||
Layout = "~/Views/Shared/_Form.cshtml"; | |||
} | |||
<div class="lr-form-wrap"> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookInOut"> | |||
<div class="lr-form-item-title">库存单</div> | |||
<input id="BookCode" type="text" class="form-control" readonly /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookInOut"> | |||
<div class="lr-form-item-title">课程</div> | |||
<div id="LessonNo" isvalid="yes" checkexpession="NotNull" readonly></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="TextBookInOut"> | |||
<div class="lr-form-item-title">所选书籍</div> | |||
<input id="TextBookName" type="text" class="form-control" readonly /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookInOut"> | |||
<div class="lr-form-item-title">出版号</div> | |||
<input id="PublishNo" type="text" class="form-control" readonly /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookInOut"> | |||
<div class="lr-form-item-title">作者</div> | |||
<input id="FirstAuthor" type="text" class="form-control" readonly /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookInOut"> | |||
<div class="lr-form-item-title">其他作者</div> | |||
<input id="OtherAuthor" type="text" class="form-control" readonly /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookInOut"> | |||
<div class="lr-form-item-title">出版社</div> | |||
<input id="Publisher" type="text" class="form-control" readonly /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookInOut"> | |||
<div class="lr-form-item-title">版次</div> | |||
<input id="Edition" type="text" class="form-control" readonly /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookInOut"> | |||
<div class="lr-form-item-title">当前库存</div> | |||
<input id="FinallyNum" type="text" class="form-control" readonly /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="TextBookInOut"> | |||
<div class="lr-form-item-title">备注</div> | |||
<textarea id="Remark" class="form-control" style="height: 100px;" readonly></textarea> | |||
</div> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">明细操作</div> | |||
<input id="detaildel" type="button" class="btn btn-danger" value="删除入库单" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item lr-form-item-grid"> | |||
<div id="TextBookOut"></div> | |||
</div> | |||
</div> | |||
@Html.AppendJsFile("/Areas/EducationalAdministration/Views/TextBookOut/FormDelete.js") |
@@ -0,0 +1,162 @@ | |||
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) | |||
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
* 创建人:超级管理员 | |||
* 日 期:2022-03-02 10:37 | |||
* 描 述:教材库存表 | |||
*/ | |||
var acceptClick; | |||
var keyValue = request('keyValue'); | |||
// 设置权限 | |||
var setAuthorize; | |||
// 设置表单数据 | |||
var setFormData; | |||
// 验证数据是否填写完整 | |||
var selectedRow; | |||
var refreshGirdData; | |||
var tempdatra = new Array(); | |||
var bootstrap = function ($, learun) { | |||
"use strict"; | |||
// 设置权限 | |||
setAuthorize = function (data) { | |||
}; | |||
var page = { | |||
init: function () { | |||
//$('.lr-form-wrap').lrscroll(); | |||
page.bind(); | |||
page.initData(); | |||
}, | |||
bind: function () { | |||
$('#LessonNo').lrDataSourceSelect({ code: 'LessonInfo', value: 'lessonno', text: 'lessonname' }); | |||
$('#TextBookOut').jfGrid({ | |||
headData: [ | |||
{ label: '出库单', name: 'BookCode', width: 180, align: 'left' }, | |||
{ | |||
label: "专业部", name: "DeptNo", 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: "MajorNo", width: 120, 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: "LessonNo", width: 150, align: "left", | |||
formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getAsync('custmerData', { | |||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'LessonInfo', | |||
key: value, | |||
keyId: 'lessonno', | |||
callback: function (_data) { | |||
callback(_data['lessonname']); | |||
} | |||
}); | |||
} | |||
}, | |||
{ | |||
label: "班级", name: "ClassNo", 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: 'AcademicYearNo', width: 80, align: 'left' }, | |||
{ label: '学期', name: 'Semester', width: 80, align: 'left' }, | |||
{ label: '领用人', name: 'Recipient', width: 100, align: 'left' }, | |||
{ label: '出库数量', name: 'Variate', width: 100, align: 'left' }, | |||
{ label: '出库时间', name: 'CreateTime', width: 200, align: 'left' }, | |||
{ label: '出库用户', name: 'CrateUserID', width: 100, align: 'left' }, | |||
{ label: '备注', name: 'Remark', width: 100, align: 'left' }, | |||
], | |||
height: 400, | |||
mainId: 'CreateTime desc', | |||
reloadSelected: false, | |||
}); | |||
$("#detaildel").on('click', function () { | |||
var NewkeyValue = $('#TextBookOut').jfGridValue('ID'); | |||
if (learun.checkrow(NewkeyValue)) { | |||
learun.layerConfirm('是否确认删除该项!', function (res, index) { | |||
if (res) { | |||
learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/TextBookOut/DeleteForm', { keyValue: NewkeyValue }, function () { | |||
var index = top.layer.getFrameIndex(window.name); | |||
console.log('index', index); | |||
top.layer.close(index); | |||
}); | |||
} | |||
}); | |||
} | |||
}); | |||
}, | |||
initData: function () { | |||
if (!!keyValue) { | |||
$.lrSetForm(top.$.rootUrl + '/EducationalAdministration/TextBookOut/GetFormData?keyValue=' + keyValue, function (data) { | |||
for (var id in data) { | |||
if (!!data[id].length && data[id].length > 0) { | |||
$('#' + id).jfGridSet('refreshdata', data[id]); | |||
} | |||
else { | |||
$('[data-table="' + id + '"]').lrSetFormData(data[id]); | |||
} | |||
} | |||
}); | |||
} | |||
} | |||
}; | |||
refreshGirdData = function (temprow) { | |||
var ifnewrow = true; | |||
$.each(tempdatra, function (key, val) { | |||
if (tempdatra[key].BookCode === temprow.InOutBook) { | |||
tempdatra[key] = temprow; | |||
ifnewrow = false; | |||
} | |||
}); | |||
if (ifnewrow) { | |||
tempdatra.push(temprow); | |||
} | |||
$('#TextBookOut').jfGridSet('refreshdata', tempdatra); | |||
}; | |||
// 设置表单数据 | |||
setFormData = function (processId, param, callback) { | |||
if (!!processId) { | |||
$.lrSetForm(top.$.rootUrl + '/EducationalAdministration/TextBookOut/GetFormDataByProcessId?processId=' + processId, function (data) { | |||
for (var id in data) { | |||
if (!!data[id] && data[id].length > 0) { | |||
$('#' + id).jfGridSet('refreshdata', data[id]); | |||
} | |||
else { | |||
if (id == 'TextBookOut' && data[id]) { | |||
keyValue = data[id].ID; | |||
} | |||
$('[data-table="' + id + '"]').lrSetFormData(data[id]); | |||
} | |||
} | |||
}); | |||
} | |||
callback && callback(); | |||
} | |||
page.init(); | |||
} |
@@ -0,0 +1,58 @@ | |||
@{ | |||
ViewBag.Title = "TextBookOut"; | |||
Layout = "~/Views/Shared/_Form.cshtml"; | |||
} | |||
<script> | |||
var OutBookCode = "@ViewBag.BookCode"; | |||
</script> | |||
<div class="lr-form-wrap" id="form"> | |||
<div class="col-xs-12 lr-form-item" data-table="TextBookIn"> | |||
<div class="lr-form-item-title">出库单<font face="宋体">*</font></div> | |||
<input id="BookCode" type="text" class="form-control" readonly="readonly" /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookOut"> | |||
<div class="lr-form-item-title">学年<font face="宋体">*</font></div> | |||
<div id="AcademicYearNo" isvalid="yes" checkexpession="NotNull"></div> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookOut"> | |||
<div class="lr-form-item-title">学期<font face="宋体">*</font></div> | |||
<div id="Semester" isvalid="yes" checkexpession="NotNull"></div> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookOut"> | |||
<div class="lr-form-item-title">专业部<font face="宋体">*</font></div> | |||
<div id="DeptNo" isvalid="yes" checkexpession="NotNull"></div> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookOut"> | |||
<div class="lr-form-item-title">专业<font face="宋体">*</font></div> | |||
<div id="MajorNo" isvalid="yes" checkexpession="NotNull"></div> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookOut"> | |||
<div class="lr-form-item-title">班级<font face="宋体">*</font></div> | |||
<div id="ClassNo" isvalid="yes" checkexpession="NotNull"></div> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookOut"> | |||
<div class="lr-form-item-title">课程<font face="宋体">*</font></div> | |||
<div id="LessonNo" isvalid="yes" checkexpession="NotNull"></div> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookOut"> | |||
<div class="lr-form-item-title">数量<font face="宋体">*</font></div> | |||
<input id="Variate" type="number" class="form-control" isvalid="yes" checkexpession="PositiveInteger" /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookOut"> | |||
<div class="lr-form-item-title">领用人<font face="宋体">*</font></div> | |||
<input id="Recipient" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="BC_ShopPurchaseRecord"> | |||
<div class="lr-form-item-title">经办人<font face="宋体">*</font></div> | |||
<input id="CrateUserID" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="BC_ShopPurchaseRecord"> | |||
<div class="lr-form-item-title">出库时间<font face="宋体">*</font></div> | |||
<input id="CreateTime" type="text" class="form-control lr-input-wdatepicker" isvalid="yes" checkexpession="DateTime" onfocus="WdatePicker({ dateFmt:'yyyy-MM-dd HH:mm:ss',onpicked: function () { $('#CreateTime').trigger('change'); } })" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="TextBookOut"> | |||
<div class="lr-form-item-title">备注</div> | |||
<textarea id="Remark" class="form-control" style="height: 100px;"></textarea> | |||
</div> | |||
</div> | |||
@Html.AppendJsFile("/Areas/EducationalAdministration/Views/TextBookOut/FormOut.js") |
@@ -0,0 +1,122 @@ | |||
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) | |||
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
* 创建人:超级管理员 | |||
* 日 期:2022-03-05 11:17 | |||
* 描 述:TextBookOut | |||
*/ | |||
var acceptClick; | |||
var keyValue = request('keyValue'); | |||
var bootstrap = function ($, learun) { | |||
"use strict"; | |||
var page = { | |||
init: function () { | |||
$('.lr-form-wrap').lrscroll(); | |||
page.bind(); | |||
page.initData(); | |||
}, | |||
bind: function () { | |||
$('#AcademicYearNo').lrselect({ | |||
placeholder: "请选择学年", | |||
allowSearch: true, | |||
url: top.$.rootUrl + '/EducationalAdministration/ClassInfo/GenerateNearByYear', | |||
value: 'value', | |||
text: 'text' | |||
}); | |||
//学期 | |||
$('#Semester').lrselect({ | |||
placeholder: "请选择学期", | |||
allowSearch: true, | |||
url: top.$.rootUrl + '/EducationalAdministration/EADateArrange/GetSemester', | |||
value: 'value', | |||
text: 'text' | |||
}); | |||
$('#DeptNo').lrselect({ | |||
allowSearch: true, | |||
value: "deptno", | |||
text: "deptname", | |||
url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdDeptInfo', | |||
select: function (item) { | |||
if (item) { | |||
$('#MajorNo').lrselectRefresh({ | |||
allowSearch: true, | |||
url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo', | |||
param: { strWhere: "DeptNo='" + item.deptno + "' AND CheckMark=1" } | |||
}); | |||
} else { | |||
$('#MajorNo').lrselectRefresh({ | |||
allowSearch: true, | |||
url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo', | |||
param: { strWhere: "1=1 AND CheckMark=1" } | |||
}); | |||
} | |||
} | |||
}); | |||
$('#MajorNo').lrselect({ | |||
allowSearch: true, | |||
url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo', | |||
value: "majorno", | |||
text: "majorname", | |||
param: { strWhere: "1=1 AND CheckMark=1" }, | |||
select: function (item) { | |||
if (item) { | |||
$('#ClassNo').lrselectRefresh({ | |||
allowSearch: true, | |||
url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj', | |||
param: { strWhere: "majorno='" + item.majorno + "' AND CheckMark=1" } | |||
}); | |||
} else { | |||
$('#ClassNo').lrselectRefresh({ | |||
allowSearch: true, | |||
url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj', | |||
param: { strWhere: "1=1 AND CheckMark=1" } | |||
}); | |||
} | |||
} | |||
}); | |||
$('#ClassNo').lrselect({ | |||
allowSearch: true, | |||
url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj', | |||
param: { strWhere: "1=1 AND CheckMark=1" }, | |||
value: "classno", | |||
text: "classname" | |||
}); | |||
$('#LessonNo').lrDataSourceSelect({ code: 'LessonInfo', value: 'lessonno', text: 'lessonname' }); | |||
}, | |||
initData: function () { | |||
if (!!keyValue) { | |||
$.lrSetForm(top.$.rootUrl + '/EducationalAdministration/TextBookOut/GetFormData?keyValue=' + keyValue, function (data) { | |||
for (var id in data) { | |||
if (!!data[id].length && data[id].length > 0) { | |||
$('#' + id).jfGridSet('refreshdata', data[id]); | |||
} | |||
else { | |||
$('[data-table="' + id + '"]').lrSetFormData(data[id]); | |||
} | |||
} | |||
}); | |||
} else { | |||
$("#BookCode").val(OutBookCode); | |||
} | |||
} | |||
}; | |||
// 保存数据 | |||
acceptClick = function (callBack) { | |||
if (!$('body').lrValidform()) { | |||
return false; | |||
} | |||
var postData = $('body').lrGetFormData(); | |||
if (!!keyValue) { | |||
if (!!selectedRow) { | |||
postData.ID = selectedRow.ID; | |||
} | |||
} else { | |||
postData.ID = learun.newGuid(); | |||
} | |||
if (!!callBack) { | |||
callBack(postData); | |||
return true; | |||
} | |||
}; | |||
page.init(); | |||
} |
@@ -0,0 +1,50 @@ | |||
@{ | |||
ViewBag.Title = "教材库存表"; | |||
Layout = "~/Views/Shared/_Form.cshtml"; | |||
} | |||
<div class="lr-form-wrap"> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookInOut"> | |||
<div class="lr-form-item-title">库存单</div> | |||
<input id="BookCode" type="text" class="form-control" readonly /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookInOut"> | |||
<div class="lr-form-item-title">课程</div> | |||
<div id="LessonNo" isvalid="yes" checkexpession="NotNull" readonly></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="TextBookInOut"> | |||
<div class="lr-form-item-title">所选书籍</div> | |||
<input id="TextBookName" type="text" class="form-control" readonly /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookInOut"> | |||
<div class="lr-form-item-title">出版号</div> | |||
<input id="PublishNo" type="text" class="form-control" readonly /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookInOut"> | |||
<div class="lr-form-item-title">作者</div> | |||
<input id="FirstAuthor" type="text" class="form-control" readonly /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookInOut"> | |||
<div class="lr-form-item-title">其他作者</div> | |||
<input id="OtherAuthor" type="text" class="form-control" readonly /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookInOut"> | |||
<div class="lr-form-item-title">出版社</div> | |||
<input id="Publisher" type="text" class="form-control" readonly /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookInOut"> | |||
<div class="lr-form-item-title">版次</div> | |||
<input id="Edition" type="text" class="form-control" readonly /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookInOut"> | |||
<div class="lr-form-item-title">当前库存</div> | |||
<input id="FinallyNum" type="text" class="form-control" readonly /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="TextBookInOut"> | |||
<div class="lr-form-item-title">备注</div> | |||
<textarea id="Remark" class="form-control" style="height: 100px;" readonly></textarea> | |||
</div> | |||
<div class="col-xs-12 lr-form-item lr-form-item-grid"> | |||
<div id="TextBookOut"></div> | |||
</div> | |||
</div> | |||
@Html.AppendJsFile("/Areas/EducationalAdministration/Views/TextBookOut/FormView.js") |
@@ -0,0 +1,174 @@ | |||
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) | |||
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
* 创建人:超级管理员 | |||
* 日 期:2022-03-02 10:37 | |||
* 描 述:教材库存表 | |||
*/ | |||
var acceptClick; | |||
var keyValue = request('keyValue'); | |||
// 设置权限 | |||
var setAuthorize; | |||
// 设置表单数据 | |||
var setFormData; | |||
// 验证数据是否填写完整 | |||
var validForm; | |||
// 保存数据 | |||
var save; | |||
var selectedRow; | |||
var refreshGirdData; | |||
var tempdatra = new Array(); | |||
var bootstrap = function ($, learun) { | |||
"use strict"; | |||
// 设置权限 | |||
setAuthorize = function (data) { | |||
}; | |||
var page = { | |||
init: function () { | |||
$('.lr-form-wrap').lrscroll(); | |||
page.bind(); | |||
page.initData(); | |||
}, | |||
bind: function () { | |||
$('#LessonNo').lrDataSourceSelect({ code: 'LessonInfo', value: 'lessonno', text: 'lessonname' }); | |||
$('#TextBookOut').jfGrid({ | |||
headData: [ | |||
{ label: '出库单', name: 'BookCode', width: 180, align: 'left' }, | |||
{ | |||
label: "专业部", name: "DeptNo", 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: "MajorNo", width: 120, 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: "LessonNo", width: 150, align: "left", | |||
formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getAsync('custmerData', { | |||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'LessonInfo', | |||
key: value, | |||
keyId: 'lessonno', | |||
callback: function (_data) { | |||
callback(_data['lessonname']); | |||
} | |||
}); | |||
} | |||
}, | |||
{ | |||
label: "班级", name: "ClassNo", 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: 'AcademicYearNo', width: 80, align: 'left' }, | |||
{ label: '学期', name: 'Semester', width: 80, align: 'left' }, | |||
{ label: '领用人', name: 'Recipient', width: 100, align: 'left' }, | |||
{ label: '出库数量', name: 'Variate', width: 100, align: 'left' }, | |||
{ label: '出库时间', name: 'CreateTime', width: 200, align: 'left' }, | |||
{ label: '出库用户', name: 'CrateUserID', width: 100, align: 'left' }, | |||
{ label: '备注', name: 'Remark', width: 100, align: 'left' }, | |||
], | |||
height: 400, | |||
mainId: 'CreateTime desc', | |||
reloadSelected: false, | |||
}); | |||
}, | |||
initData: function () { | |||
if (!!keyValue) { | |||
$.lrSetForm(top.$.rootUrl + '/EducationalAdministration/TextBookOut/GetFormData?keyValue=' + keyValue, function (data) { | |||
for (var id in data) { | |||
if (!!data[id].length && data[id].length > 0) { | |||
$('#' + id).jfGridSet('refreshdata', data[id]); | |||
tempdatra = data[id]; | |||
} | |||
else { | |||
$('[data-table="' + id + '"]').lrSetFormData(data[id]); | |||
} | |||
} | |||
}); | |||
} | |||
} | |||
}; | |||
refreshGirdData = function (temprow) { | |||
var ifnewrow = true; | |||
$.each(tempdatra, function (key, val) { | |||
if (tempdatra[key].ID === temprow.ID) { | |||
tempdatra[key] = temprow; | |||
ifnewrow = false; | |||
} | |||
}); | |||
if (ifnewrow) { | |||
tempdatra.push(temprow); | |||
} | |||
$('#TextBookOut').jfGridSet('refreshdata', tempdatra); | |||
}; | |||
// 设置表单数据 | |||
setFormData = function (processId, param, callback) { | |||
if (!!processId) { | |||
$.lrSetForm(top.$.rootUrl + '/EducationalAdministration/TextBookOut/GetFormData?processId=' + processId, function (data) { | |||
for (var id in data) { | |||
if (!!data[id] && data[id].length > 0) { | |||
$('#' + id).jfGridSet('refreshdata', data[id]); | |||
} | |||
else { | |||
if (id == 'TextBookOut' && data[id]) { | |||
keyValue = data[id].ID; | |||
} | |||
$('[data-table="' + id + '"]').lrSetFormData(data[id]); | |||
} | |||
} | |||
}); | |||
} | |||
callback && callback(); | |||
} | |||
// 验证数据是否填写完整 | |||
validForm = function () { | |||
var datas = $('#TextBookOut').jfGridGet('rowdatas'); | |||
if (datas == null || datas.length == 0) { | |||
learun.alert.warning("申请未包含出库申请!请先添加入库申请!"); | |||
return false; | |||
} | |||
return true; | |||
}; | |||
// 保存数据 | |||
save = function (callBack) { | |||
var postData = {}; | |||
var formData = $('[data-table="TextBookInOut"]').lrGetFormData(); | |||
postData.strEntity = JSON.stringify(formData); | |||
postData.strTextBookOutList = JSON.stringify($('#TextBookOut').jfGridGet('rowdatas')); | |||
$.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/TextBookOut/SaveForm?keyValue=' + keyValue, postData, function (res) { | |||
// 保存成功后才回调 | |||
if (!!callBack) { | |||
callBack(); | |||
} | |||
}); | |||
}; | |||
page.init(); | |||
} |
@@ -0,0 +1,39 @@ | |||
@{ | |||
ViewBag.Title = "TextBookOut"; | |||
Layout = "~/Views/Shared/_Index.cshtml"; | |||
} | |||
<div class="lr-layout "> | |||
<div class="lr-layout-center"> | |||
<div class="lr-layout-wrap lr-layout-wrap-notitle "> | |||
<div class="lr-layout-tool"> | |||
<div class="lr-layout-tool-left"> | |||
<div class="lr-layout-tool-item"> | |||
<div id="datesearch"></div> | |||
</div> | |||
<div class="lr-layout-tool-item"> | |||
<div id="multiple_condition_query"> | |||
<div class="lr-query-formcontent"> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">关键字查询</div> | |||
<input id="keyword" type="text" class="form-control" placeholder="请输入要查询关键字" /> | |||
</div> | |||
</div> | |||
</div> | |||
</div> | |||
</div> | |||
<div class="lr-layout-tool-right"> | |||
<div class=" btn-group btn-group-sm"> | |||
<a id="lr_refresh" class="btn btn-default"><i class="fa fa-refresh"></i></a> | |||
</div> | |||
<div class=" btn-group btn-group-sm" learun-authorize="yes"> | |||
<a id="lr_edit" class="btn btn-default"><i class="fa fa-pencil-square-o"></i> 教材出库</a> | |||
<a id="lr_view" class="btn btn-default"><i class="fa fa-pencil-square-o"></i> 明细查看</a> | |||
<a id="lr_delete" class="btn btn-default"><i class="fa fa-trash-o"></i> 明细删除</a> | |||
</div> | |||
</div> | |||
</div> | |||
<div class="lr-layout-body" id="gridtable"></div> | |||
</div> | |||
</div> | |||
</div> | |||
@Html.AppendJsFile("/Areas/EducationalAdministration/Views/TextBookOut/Index.js") |
@@ -0,0 +1,163 @@ | |||
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) | |||
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
* 创建人:超级管理员 | |||
* 日 期:2022-03-05 11:17 | |||
* 描 述:TextBookOut | |||
*/ | |||
var refreshGirdData; | |||
var bootstrap = function ($, learun) { | |||
"use strict"; | |||
var startTime; | |||
var endTime; | |||
var page = { | |||
init: function () { | |||
page.initGird(); | |||
page.bind(); | |||
}, | |||
bind: function () { | |||
// 时间搜索框 | |||
$('#datesearch').lrdate({ | |||
dfdata: [ | |||
{ name: '今天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00') }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } }, | |||
{ name: '近7天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'd', -6) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } }, | |||
{ name: '近1个月', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'm', -1) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } }, | |||
{ name: '近3个月', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'm', -3) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } } | |||
], | |||
// 月 | |||
mShow: false, | |||
premShow: false, | |||
// 季度 | |||
jShow: false, | |||
prejShow: false, | |||
// 年 | |||
ysShow: false, | |||
yxShow: false, | |||
preyShow: false, | |||
yShow: false, | |||
// 默认 | |||
dfvalue: '1', | |||
selectfn: function (begin, end) { | |||
startTime = begin; | |||
endTime = end; | |||
page.search(); | |||
} | |||
}); | |||
$('#multiple_condition_query').lrMultipleQuery(function (queryJson) { | |||
page.search(queryJson); | |||
}, 100, 400); | |||
$('#DeptNo').lrDataSourceSelect({ code: 'CdDeptInfo',value: 'deptno',text: 'deptname' }); | |||
$('#MajorNo').lrDataSourceSelect({ code: 'CdMajorInfo',value: 'majorno',text: 'majorname' }); | |||
$('#ClassNo').lrDataSourceSelect({ code: 'bjsj',value: 'classno',text: 'classname' }); | |||
$('#LessonNo').lrDataSourceSelect({ code: 'LessonInfo',value: 'lessonno',text: 'lessonname' }); | |||
// 刷新 | |||
$('#lr_refresh').on('click', function () { | |||
location.reload(); | |||
}); | |||
// 出库 | |||
$('#lr_edit').on('click', function () { | |||
var keyValue = $('#gridtable').jfGridValue('ID'); | |||
if (learun.checkrow(keyValue)) { | |||
learun.layerForm({ | |||
id: 'form', | |||
title: '出库', | |||
url: top.$.rootUrl + '/EducationalAdministration/TextBookOut/Form?keyValue=' + keyValue, | |||
width: 1000, | |||
height: 800, | |||
callBack: function (id) { | |||
var res = false; | |||
// 验证数据 | |||
res = top[id].validForm(); | |||
// 保存数据 | |||
if (res) { | |||
res = top[id].save('', function () { | |||
page.search(); | |||
}); | |||
} | |||
return res; | |||
} | |||
}); | |||
} | |||
}); | |||
// 查看 | |||
$('#lr_view').on('click', function () { | |||
var keyValue = $('#gridtable').jfGridValue('ID'); | |||
if (learun.checkrow(keyValue)) { | |||
learun.layerForm({ | |||
id: 'formview', | |||
title: '查看', | |||
url: top.$.rootUrl + '/EducationalAdministration/TextBookOut/FormView?keyValue=' + keyValue, | |||
width: 1000, | |||
height: 700, | |||
btn: null, | |||
}); | |||
} | |||
}); | |||
// 删除 | |||
$('#lr_delete').on('click', function () { | |||
var keyValue = $('#gridtable').jfGridValue('ID'); | |||
if (learun.checkrow(keyValue)) { | |||
learun.layerForm({ | |||
id: 'formdelete', | |||
title: '删除明细', | |||
url: top.$.rootUrl + '/EducationalAdministration/TextBookOut/FormDelete?keyValue=' + keyValue, | |||
width: 1000, | |||
height: 700, | |||
btn: null, | |||
}); | |||
} | |||
}); | |||
}, | |||
// 初始化列表 | |||
initGird: function () { | |||
$('#gridtable').lrAuthorizeJfGrid({ | |||
url: top.$.rootUrl + '/EducationalAdministration/TextBookInOut/GetPageList', | |||
headData: [ | |||
{ label: '库存单号', name: 'BookCode', width: 200, align: "left" }, | |||
{ | |||
label: "课程", name: "LessonNo", width: 150, align: "left", | |||
formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getAsync('custmerData', { | |||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'LessonInfo', | |||
key: value, | |||
keyId: 'lessonno', | |||
callback: function (_data) { | |||
callback(_data['lessonname']); | |||
} | |||
}); | |||
} | |||
}, | |||
{ label: '教材名称', name: 'TextBookName', width: 200, align: "left" }, | |||
{ label: '教材号', name: 'TextBookNo', width: 200, align: "left" }, | |||
{ label: '出版号', name: 'PublishNo', width: 200, align: "left" }, | |||
{ label: '第一作者', name: 'FirstAuthor', width: 200, align: "left" }, | |||
{ label: '其他作者', name: 'OtherAuthor', width: 200, align: "left" }, | |||
{ label: '出版社', name: 'Publisher', width: 200, align: "left" }, | |||
{ label: '版次', name: 'Edition', width: 200, align: "left" }, | |||
{ label: '印次', name: 'Impression', width: 200, align: "left" }, | |||
{ label: '创建人', name: 'CreateTime', width: 200, align: "left" }, | |||
{ label: '创建用户', name: 'CrateUserID', width: 200, align: "left" }, | |||
{ label: '修改人', name: 'UpTime', width: 200, align: "left" }, | |||
{ label: '修改用户', name: 'UpUserID', width: 200, align: "left" }, | |||
{ label: '当前数量', name: 'FinallyNum', width: 200, align: "left" }, | |||
{ label: '备注', name: 'Remark', width: 200, align: "left" }, | |||
], | |||
mainId: 'ID', | |||
isPage: true, | |||
sidx: 'CreateTime desc' | |||
}); | |||
page.search(); | |||
}, | |||
search: function (param) { | |||
param = param || {}; | |||
param.StartTime = startTime; | |||
param.EndTime = endTime; | |||
param.SqlParameter = ' and IsSubmit =1 '; | |||
$('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); | |||
} | |||
}; | |||
refreshGirdData = function () { | |||
$('#gridtable').jfGridSet('reload'); | |||
}; | |||
page.init(); | |||
} |
@@ -0,0 +1,84 @@ | |||
@{ | |||
ViewBag.Title = "教材征订管理"; | |||
Layout = "~/Views/Shared/_Form.cshtml"; | |||
} | |||
<div class="lr-form-wrap" id="form"> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookSolSub"> | |||
<div class="lr-form-item-title">专业部</div> | |||
<div id="DeptNo" readonly></div> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookSolSub"> | |||
<div class="lr-form-item-title">专业</div> | |||
<div id="MajorNo" readonly></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="TextBookSolSub"> | |||
<div class="lr-form-item-title">课程</div> | |||
<div id="LessonNo" readonly></div> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookSolSub"> | |||
<div class="lr-form-item-title">学年</div> | |||
<div id="AcademicYearNo" readonly></div> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookSolSub"> | |||
<div class="lr-form-item-title">学期</div> | |||
<div id="Semester" readonly></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="TextBookSolSub"> | |||
<div class="lr-form-item-title">所选书籍</div> | |||
<input id="TextBookName" type="text" class="form-control" readonly /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookSolSub"> | |||
<div class="lr-form-item-title">书籍</div> | |||
<input id="PublishNo" type="text" class="form-control" readonly /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookSolSub"> | |||
<div class="lr-form-item-title">单价</div> | |||
<input id="Price" type="text" class="form-control" readonly /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookSolSub"> | |||
<div class="lr-form-item-title">作者</div> | |||
<input id="FirstAuthor" type="text" class="form-control" readonly /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookSolSub"> | |||
<div class="lr-form-item-title">其他作者</div> | |||
<input id="OtherAuthor" type="text" class="form-control" readonly /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookSolSub"> | |||
<div class="lr-form-item-title">出版社</div> | |||
<input id="Publisher" type="text" class="form-control" readonly /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookSolSub"> | |||
<div class="lr-form-item-title">版次</div> | |||
<input id="Edition" type="text" class="form-control" readonly /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="TextBookSolSub"> | |||
<div class="lr-form-item-title">订购数量</div> | |||
<input id="OrderNum" type="number" class="form-control" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="TextBookSolSub"> | |||
<div class="lr-form-item-title">备注</div> | |||
<textarea id="Remark" class="form-control" style="height:100px;" readonly></textarea> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="TextBookSolSub" style="display: none; "> | |||
<div class="lr-form-item-title">当前信息</div> | |||
<input id="CreateTime" type="text" readonly class="form-control currentInfo lr-currentInfo-time" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="TextBookSolSub" style="display: none; "> | |||
<div class="lr-form-item-title">当前信息</div> | |||
<input id="CreateUserID" type="text" readonly class="form-control currentInfo lr-currentInfo-user" /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="TextBookSolSub" style="display: none; "> | |||
<div class="lr-form-item-title">状态</div> | |||
<input id="Status" type="text" class="form-control" /> | |||
</div> | |||
@*<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">明细操作</div> | |||
<input id="detailadd" type="button" class="btn btn-success" value="新增明细" /> | |||
<input id="detailedit" type="button" class="btn btn-warning" value="编辑明细" /> | |||
<input id="detaildel" type="button" class="btn btn-danger" value="移除明细" /> | |||
</div>*@ | |||
<div class="col-xs-12 lr-form-item lr-form-item-grid"> | |||
<div id="TextBookSolSubDetail"></div> | |||
</div> | |||
</div> | |||
@Html.AppendJsFile("/Areas/EducationalAdministration/Views/TextBookSolSub/Form.js") |
@@ -0,0 +1,96 @@ | |||
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) | |||
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
* 创建人:超级管理员 | |||
* 日 期:2022-03-01 17:26 | |||
* 描 述:教材征订管理 | |||
*/ | |||
var acceptClick; | |||
var keyValue = request('keyValue'); | |||
var bootstrap = function ($, learun) { | |||
"use strict"; | |||
var page = { | |||
init: function () { | |||
$('.lr-form-wrap').lrscroll(); | |||
page.bind(); | |||
page.initData(); | |||
}, | |||
bind: function () { | |||
$('#DeptNo').lrDataSourceSelect({ code: 'CdDeptInfo', value: 'deptno', text: 'deptname' }); | |||
$('#MajorNo').lrDataSourceSelect({ code: 'CdMajorInfo', value: 'majorname', text: 'majorname' }); | |||
$('#LessonNo').lrDataSourceSelect({ code: 'LessonInfo', value: 'lessonno', text: 'lessonname' }); | |||
$('#AcademicYearNo').lrselect({ | |||
placeholder: "请选择学年", | |||
allowSearch: true, | |||
url: top.$.rootUrl + '/EducationalAdministration/TextBookIndent/GetAcademicYear', | |||
value: 'value', | |||
text: 'text' | |||
}); | |||
//学期 | |||
$('#Semester').lrselect({ | |||
placeholder: "请选择学期", | |||
allowSearch: true, | |||
url: top.$.rootUrl + '/EducationalAdministration/EADateArrange/GetSemester', | |||
value: 'value', | |||
text: 'text' | |||
}); | |||
$('#TextBookSolSubDetail').jfGrid({ | |||
headData: [ | |||
{ | |||
label: "班级", name: "ClassNo", 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: 'TeachSum', width: 80, align: 'left' }, | |||
{ label: '学生人数', name: 'StuSum', width: 80, align: 'left' }, | |||
{ label: '备注', name: 'Remark', width: 100, align: 'left' }, | |||
], | |||
height: 400, | |||
mainId: 'ID,IndentID', | |||
reloadSelected: false, | |||
}); | |||
$('#CreateTime').val(learun.formatDate(new Date(), 'yyyy-MM-dd hh:mm:ss')); | |||
$('#CreateUserID')[0].lrvalue = learun.clientdata.get(['userinfo']).userId; | |||
$('#CreateUserID').val(learun.clientdata.get(['userinfo']).realName); | |||
}, | |||
initData: function () { | |||
if (!!keyValue) { | |||
$.lrSetForm(top.$.rootUrl + '/EducationalAdministration/TextBookSolSub/GetFormData?keyValue=' + keyValue, function (data) { | |||
for (var id in data) { | |||
if (!!data[id].length && data[id].length > 0) { | |||
$('#' + id ).jfGridSet('refreshdata', data[id]); | |||
} | |||
else { | |||
$('[data-table="' + id + '"]').lrSetFormData(data[id]); | |||
} | |||
} | |||
}); | |||
} | |||
} | |||
}; | |||
// 保存数据 | |||
acceptClick = function (callBack) { | |||
if (!$('body').lrValidform()) { | |||
return false; | |||
} | |||
var postData = { | |||
strEntity: JSON.stringify($('body').lrGetFormData()) | |||
}; | |||
$.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/TextBookSolSub/SaveForm?keyValue=' + keyValue, postData, function (res) { | |||
// 保存成功后才回调 | |||
if (!!callBack) { | |||
callBack(); | |||
} | |||
}); | |||
}; | |||
page.init(); | |||
} |
@@ -0,0 +1,57 @@ | |||
@{ | |||
ViewBag.Title = "教材征订管理"; | |||
Layout = "~/Views/Shared/_Index.cshtml"; | |||
} | |||
<div class="lr-layout " > | |||
<div class="lr-layout-center"> | |||
<div class="lr-layout-wrap lr-layout-wrap-notitle "> | |||
<div class="lr-layout-tool"> | |||
<div class="lr-layout-tool-left"> | |||
<div class="lr-layout-tool-item"> | |||
<div id="multiple_condition_query"> | |||
<div class="lr-query-formcontent"> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">专业部</div> | |||
<div id="DeptNo"></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">专业</div> | |||
<div id="MajorNo"></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">课程</div> | |||
<div id="LessonNo"></div> | |||
</div> | |||
<div class="col-xs-6 lr-form-item"> | |||
<div class="lr-form-item-title">学年</div> | |||
<div id="AcademicYearNo"></div> | |||
</div> | |||
<div class="col-xs-6 lr-form-item"> | |||
<div class="lr-form-item-title">学期</div> | |||
<div id="Semester"></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">书号</div> | |||
<input id="PublishNo" type="text" class="form-control" /> | |||
</div> | |||
</div> | |||
</div> | |||
</div> | |||
</div> | |||
<div class="lr-layout-tool-right"> | |||
<div class=" btn-group btn-group-sm"> | |||
<a id="lr_refresh" class="btn btn-default"><i class="fa fa-refresh"></i></a> | |||
</div> | |||
<div class=" btn-group btn-group-sm" learun-authorize="yes"> | |||
<a id="lr_view" class="btn btn-default"><i class="fa fa-plus"></i> 查看</a> | |||
<a id="lr_edit" class="btn btn-default"><i class="fa fa-pencil-square-o"></i> 编辑</a> | |||
@*<a id="lr_delete" class="btn btn-default"><i class="fa fa-trash-o"></i> 删除</a>*@ | |||
<a id="lr_print" class="btn btn-default"><i class="fa fa-print"></i> 打印</a> | |||
</div> | |||
</div> | |||
</div> | |||
<div class="lr-layout-body" id="gridtable"></div> | |||
</div> | |||
</div> | |||
</div> | |||
@Html.AppendJsFile("/Areas/EducationalAdministration/Views/TextBookSolSub/Index.js") |
@@ -0,0 +1,188 @@ | |||
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) | |||
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
* 创建人:超级管理员 | |||
* 日 期:2022-03-01 17:26 | |||
* 描 述:教材征订管理 | |||
*/ | |||
var refreshGirdData; | |||
var bootstrap = function ($, learun) { | |||
"use strict"; | |||
var page = { | |||
init: function () { | |||
page.initGird(); | |||
page.bind(); | |||
}, | |||
bind: function () { | |||
$('#multiple_condition_query').lrMultipleQuery(function (queryJson) { | |||
page.search(queryJson); | |||
}, 250, 400); | |||
$('#DeptNo').lrDataSourceSelect({ code: 'CdDeptInfo', value: 'deptno', text: 'deptname' }); | |||
$('#MajorNo').lrDataSourceSelect({ code: 'CdMajorInfo', value: 'majorname', text: 'majorname' }); | |||
$('#LessonNo').lrDataSourceSelect({ code: 'LessonInfo', value: 'lessonno', text: 'lessonname' }); | |||
$('#ClassNo').lrDataSourceSelect({ code: 'LessonInfo', value: 'lessonno', text: 'lessonname' }); | |||
$('#AcademicYearNo').lrselect({ | |||
placeholder: "请选择学年", | |||
allowSearch: true, | |||
url: top.$.rootUrl + '/EducationalAdministration/TextBookIndent/GetAcademicYear', | |||
value: 'value', | |||
text: 'text' | |||
}); | |||
//学期 | |||
$('#Semester').lrselect({ | |||
placeholder: "请选择学年", | |||
allowSearch: true, | |||
url: top.$.rootUrl + '/EducationalAdministration/EADateArrange/GetSemester', | |||
value: 'value', | |||
text: 'text' | |||
}); | |||
// 刷新 | |||
$('#lr_refresh').on('click', function () { | |||
location.reload(); | |||
}); | |||
// 编辑 | |||
$('#lr_edit').on('click', function () { | |||
var keyValue = $('#gridtable').jfGridValue('ID'); | |||
if (learun.checkrow(keyValue)) { | |||
learun.layerForm({ | |||
id: 'form', | |||
title: '编辑', | |||
url: top.$.rootUrl + '/EducationalAdministration/TextBookSolSub/Form?keyValue=' + keyValue, | |||
width: 1000, | |||
height: 700, | |||
callBack: function (id) { | |||
return top[id].acceptClick(refreshGirdData); | |||
} | |||
}); | |||
} | |||
}); | |||
// 删除 | |||
$('#lr_delete').on('click', function () { | |||
var keyValue = $('#gridtable').jfGridValue('ID'); | |||
if (learun.checkrow(keyValue)) { | |||
learun.layerConfirm('是否确认删除该项!', function (res) { | |||
if (res) { | |||
learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/TextBookSolSub/DeleteForm', { keyValue: keyValue}, function () { | |||
refreshGirdData(); | |||
}); | |||
} | |||
}); | |||
} | |||
}); | |||
// 查看 | |||
$('#lr_view').on('click', function () { | |||
var keyValue = $('#gridtable').jfGridValue('ID'); | |||
if (learun.checkrow(keyValue)) { | |||
learun.layerForm({ | |||
id: 'formview', | |||
title: '查看', | |||
url: top.$.rootUrl + '/EducationalAdministration/TextBookSolSub/Form?keyValue=' + keyValue, | |||
width: 1000, | |||
height: 700, | |||
btn: null, | |||
}); | |||
} | |||
}); | |||
// 打印 | |||
$('#lr_print').on('click', function () { | |||
$('#gridtable').jqprintTable(); | |||
}); | |||
}, | |||
// 初始化列表 | |||
initGird: function () { | |||
$('#gridtable').jfGrid({ | |||
url: top.$.rootUrl + '/EducationalAdministration/TextBookSolSub/GetPageList', | |||
headData: [ | |||
//{ label: "主键", name: "ID", width: 200, align: "left" }, | |||
{ | |||
label: "专业部", name: "DeptNo", 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: "MajorNo", width: 120, align: "left", | |||
formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getAsync('custmerData', { | |||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo', | |||
key: value, | |||
keyId: 'majorname', | |||
callback: function (_data) { | |||
callback(_data['majorname']); | |||
} | |||
}); | |||
} | |||
}, | |||
{ | |||
label: "课程", name: "LessonNo", width: 150, align: "left", | |||
formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getAsync('custmerData', { | |||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'LessonInfo', | |||
key: value, | |||
keyId: 'lessonno', | |||
callback: function (_data) { | |||
callback(_data['lessonname']); | |||
} | |||
}); | |||
} | |||
}, | |||
{ label: "学年", name: "AcademicYearNo", width: 100, align: "left" }, | |||
{ label: "学期", name: "Semester", width: 100, align: "left" }, | |||
{ label: "教材名称", name: "TextBookName", width: 200, align: "left" }, | |||
{ label: "书号(物料号)", name: "PublishNo", width: 150, align: "left" }, | |||
{ label: "作者", name: "FirstAuthor", width: 100, align: "left" }, | |||
{ label: "其他作者", name: "OtherAuthor", width: 150, align: "left" }, | |||
{ label: "出版社", name: "Publisher", width: 100, align: "left" }, | |||
{ label: "版次", name: "Edition", width: 100, align: "left" }, | |||
{ label: "单价", name: "Price", width: 100, align: "left" }, | |||
{ label: "订购数量", name: "OrderNum", width: 100, align: "left" }, | |||
{ label: "备注", name: "Remark", width: 200, align: "left" }, | |||
//{ | |||
// label: "状态", name: "Status", width: 100, align: "left", | |||
// formatter: function (cellvalue) { | |||
// if (cellvalue == '0') { | |||
// return '<span class=\"label label-success\">草稿</span>'; | |||
// } else if (cellvalue == '1') { | |||
// return '<span class=\"label label-danger\">审批中</span>'; | |||
// } else if (cellvalue == '2') { | |||
// return '<span class=\"label label-info\">审批通过</span>'; | |||
// } | |||
// } | |||
//}, | |||
{ label: "录入时间", name: "CreateTime", width: 100, align: "left" }, | |||
{ | |||
label: "创建用户", name: "CreateUserID", width: 100, align: "left", | |||
formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getAsync('user', { | |||
key: value, | |||
callback: function (_data) { | |||
callback(_data.name); | |||
} | |||
}); | |||
} | |||
}, | |||
], | |||
mainId: 'ID', | |||
sidx: 'CreateTime desc,Status desc', | |||
isPage: true | |||
}); | |||
page.search(); | |||
}, | |||
search: function (param) { | |||
param = param || {}; | |||
$('#gridtable').jfGridSet('reload',{ queryJson: JSON.stringify(param) }); | |||
} | |||
}; | |||
refreshGirdData = function () { | |||
$('#gridtable').jfGridSet('reload'); | |||
}; | |||
page.init(); | |||
} |
@@ -0,0 +1,11 @@ | |||
@{ | |||
ViewBag.Title = "教材征订管理明细"; | |||
Layout = "~/Views/Shared/_Form.cshtml"; | |||
} | |||
<div class="lr-form-wrap" id="form"> | |||
<div class="col-xs-12 lr-form-item" data-table="TextBookSolSubDetail" > | |||
<div class="lr-form-item-title">文本框</div> | |||
<input id="TeachSum" type="text" class="form-control" /> | |||
</div> | |||
</div> | |||
@Html.AppendJsFile("/Areas/EducationalAdministration/Views/TextBookSolSubDetail/Form.js") |
@@ -0,0 +1,50 @@ | |||
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) | |||
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
* 创建人:超级管理员 | |||
* 日 期:2022-03-02 09:29 | |||
* 描 述:教材征订管理明细 | |||
*/ | |||
var acceptClick; | |||
var keyValue = request('keyValue'); | |||
var bootstrap = function ($, learun) { | |||
"use strict"; | |||
var page = { | |||
init: function () { | |||
$('.lr-form-wrap').lrscroll(); | |||
page.bind(); | |||
page.initData(); | |||
}, | |||
bind: function () { | |||
}, | |||
initData: function () { | |||
if (!!keyValue) { | |||
$.lrSetForm(top.$.rootUrl + '/EducationalAdministration/TextBookSolSubDetail/GetFormData?keyValue=' + keyValue, function (data) { | |||
for (var id in data) { | |||
if (!!data[id].length && data[id].length > 0) { | |||
$('#' + id ).jfGridSet('refreshdata', data[id]); | |||
} | |||
else { | |||
$('[data-table="' + id + '"]').lrSetFormData(data[id]); | |||
} | |||
} | |||
}); | |||
} | |||
} | |||
}; | |||
// 保存数据 | |||
acceptClick = function (callBack) { | |||
if (!$('body').lrValidform()) { | |||
return false; | |||
} | |||
var postData = { | |||
strEntity: JSON.stringify($('body').lrGetFormData()) | |||
}; | |||
$.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/TextBookSolSubDetail/SaveForm?keyValue=' + keyValue, postData, function (res) { | |||
// 保存成功后才回调 | |||
if (!!callBack) { | |||
callBack(); | |||
} | |||
}); | |||
}; | |||
page.init(); | |||
} |
@@ -0,0 +1,27 @@ | |||
@{ | |||
ViewBag.Title = "教材征订管理明细"; | |||
Layout = "~/Views/Shared/_Index.cshtml"; | |||
} | |||
<div class="lr-layout " > | |||
<div class="lr-layout-center"> | |||
<div class="lr-layout-wrap lr-layout-wrap-notitle "> | |||
<div class="lr-layout-tool"> | |||
<div class="lr-layout-tool-left"> | |||
</div> | |||
<div class="lr-layout-tool-right"> | |||
<div class=" btn-group btn-group-sm"> | |||
<a id="lr_refresh" class="btn btn-default"><i class="fa fa-refresh"></i></a> | |||
</div> | |||
<div class=" btn-group btn-group-sm" learun-authorize="yes"> | |||
<a id="lr_add" class="btn btn-default"><i class="fa fa-plus"></i> 新增</a> | |||
<a id="lr_edit" class="btn btn-default"><i class="fa fa-pencil-square-o"></i> 编辑</a> | |||
<a id="lr_delete" class="btn btn-default"><i class="fa fa-trash-o"></i> 删除</a> | |||
<a id="lr_print" class="btn btn-default"><i class="fa fa-print"></i> 打印</a> | |||
</div> | |||
</div> | |||
</div> | |||
<div class="lr-layout-body" id="gridtable"></div> | |||
</div> | |||
</div> | |||
</div> | |||
@Html.AppendJsFile("/Areas/EducationalAdministration/Views/TextBookSolSubDetail/Index.js") |
@@ -0,0 +1,88 @@ | |||
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) | |||
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
* 创建人:超级管理员 | |||
* 日 期:2022-03-02 09:29 | |||
* 描 述:教材征订管理明细 | |||
*/ | |||
var refreshGirdData; | |||
var bootstrap = function ($, learun) { | |||
"use strict"; | |||
var page = { | |||
init: function () { | |||
page.initGird(); | |||
page.bind(); | |||
}, | |||
bind: function () { | |||
// 刷新 | |||
$('#lr_refresh').on('click', function () { | |||
location.reload(); | |||
}); | |||
// 新增 | |||
$('#lr_add').on('click', function () { | |||
learun.layerForm({ | |||
id: 'form', | |||
title: '新增', | |||
url: top.$.rootUrl + '/EducationalAdministration/TextBookSolSubDetail/Form', | |||
width: 600, | |||
height: 400, | |||
callBack: function (id) { | |||
return top[id].acceptClick(refreshGirdData); | |||
} | |||
}); | |||
}); | |||
// 编辑 | |||
$('#lr_edit').on('click', function () { | |||
var keyValue = $('#gridtable').jfGridValue('ID'); | |||
if (learun.checkrow(keyValue)) { | |||
learun.layerForm({ | |||
id: 'form', | |||
title: '编辑', | |||
url: top.$.rootUrl + '/EducationalAdministration/TextBookSolSubDetail/Form?keyValue=' + keyValue, | |||
width: 600, | |||
height: 400, | |||
callBack: function (id) { | |||
return top[id].acceptClick(refreshGirdData); | |||
} | |||
}); | |||
} | |||
}); | |||
// 删除 | |||
$('#lr_delete').on('click', function () { | |||
var keyValue = $('#gridtable').jfGridValue('ID'); | |||
if (learun.checkrow(keyValue)) { | |||
learun.layerConfirm('是否确认删除该项!', function (res) { | |||
if (res) { | |||
learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/TextBookSolSubDetail/DeleteForm', { keyValue: keyValue}, function () { | |||
refreshGirdData(); | |||
}); | |||
} | |||
}); | |||
} | |||
}); | |||
// 打印 | |||
$('#lr_print').on('click', function () { | |||
$('#gridtable').jqprintTable(); | |||
}); | |||
}, | |||
// 初始化列表 | |||
initGird: function () { | |||
$('#gridtable').lrAuthorizeJfGrid({ | |||
url: top.$.rootUrl + '/EducationalAdministration/TextBookSolSubDetail/GetPageList', | |||
headData: [ | |||
{ label: "文本框", name: "TeachSum", width: 100, align: "left"}, | |||
], | |||
mainId:'ID', | |||
isPage: true | |||
}); | |||
page.search(); | |||
}, | |||
search: function (param) { | |||
param = param || {}; | |||
$('#gridtable').jfGridSet('reload',{ queryJson: JSON.stringify(param) }); | |||
} | |||
}; | |||
refreshGirdData = function () { | |||
$('#gridtable').jfGridSet('reload'); | |||
}; | |||
page.init(); | |||
} |
@@ -1095,6 +1095,32 @@ | |||
<Content Include="Areas\EducationalAdministration\Views\Sys_SendFile\ReadListParty.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\Sys_SendFile\ReadListDocument.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\ClassPlanTeach\Index.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\TextBookIndentDetail\Index.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\TextBookIndent\Form.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\TextBookIndent\FormDetail.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\TextBookIndent\FormLook.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\TextBookIndent\FormView.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\TextBookIndent\Index.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\TextBookInfo\Form.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\TextBookInfo\Index.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\TextBookInOut\Form.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\TextBookInOut\FormUse.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\TextBookInOut\Index.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\TextBookInOut\IndexInOut.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\TextBookIn\Form.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\TextBookIn\FormDelete.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\TextBookIn\FormIn.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\TextBookIn\FormView.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\TextBookIn\Index.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\TextBookOut\Form.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\TextBookOut\FormDelete.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\TextBookOut\FormOut.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\TextBookOut\FormView.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\TextBookOut\Index.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\TextBookSolSubDetail\Form.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\TextBookSolSubDetail\Index.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\TextBookSolSub\Form.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\TextBookSolSub\Index.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\Thermography\IndexResult.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\Thermography\StatisticIndex.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\Thermography\SubmitIndex.js" /> | |||