Просмотр исходного кода

教材订单管理 查看功能

临城职教中职
zhangli 2 лет назад
Родитель
Сommit
adc8e5f810
7 измененных файлов: 375 добавлений и 3 удалений
  1. +10
    -1
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/TextBookIndentController.cs
  2. +1
    -1
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookIndent/Form.cshtml
  3. +74
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookIndent/FormLook.cshtml
  4. +270
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookIndent/FormLook.js
  5. +1
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookIndent/Index.cshtml
  6. +17
    -1
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookIndent/Index.js
  7. +2
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj

+ 10
- 1
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/TextBookIndentController.cs Просмотреть файл

@@ -57,7 +57,16 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
{
return View();
}

/// <summary>
/// 查看
/// <summary>
/// <returns></returns>
[HttpGet]
public ActionResult FormLook()
{
return View();
}
#endregion

#region 获取数据


+ 1
- 1
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookIndent/Form.cshtml Просмотреть файл

@@ -27,7 +27,7 @@
</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"></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>


+ 74
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookIndent/FormLook.cshtml Просмотреть файл

@@ -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")

+ 270
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/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/EADateArrange/GetAcademicYearNo',
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();
}

+ 1
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookIndent/Index.cshtml Просмотреть файл

@@ -50,6 +50,7 @@
<a id="lr_edit" class="btn btn-default"><i class="fa fa-pencil-square-o"></i>&nbsp;编辑</a>
<a id="lr_delete" class="btn btn-default"><i class="fa fa-trash-o"></i>&nbsp;删除</a>
<a id="lr_submit" class="btn btn-default"><i class="fa fa-plus"></i>&nbsp; 提交</a>
<a id="lr_look" class="btn btn-default"><i class="fa fa-plus"></i>&nbsp;查看</a>
</div>
</div>
</div>


+ 17
- 1
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookIndent/Index.js Просмотреть файл

@@ -85,7 +85,7 @@ var bootstrap = function ($, learun) {
if (res) {
//processId = learun.newGuid();
//res = top[id].save(processId, refreshGirdData);
res = top[id].save('', function () {
res = top[id].save('', function () {
page.search();
});
}
@@ -171,6 +171,22 @@ var bootstrap = function ($, learun) {
});
}
});

// 查看
$('#lr_look').on('click', function () {
var keyValue = $('#gridtable').jfGridValue('ID');
if (learun.checkrow(keyValue)) {
learun.layerForm({
id: 'formlook',
title: '查看',
url: top.$.rootUrl + '/EducationalAdministration/TextBookIndent/FormLook?keyValue=' + keyValue,
width: 800,
height: 600,
btn: null,
});
}
});

},
// 初始化列表
initGird: function () {


+ 2
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj Просмотреть файл

@@ -1171,6 +1171,7 @@
<Content Include="Areas\EducationalAdministration\Views\TeachingPlan\FormManageView.js" />
<Content Include="Areas\EducationalAdministration\Views\TeachingPlan\Index.js" />
<Content Include="Areas\EducationalAdministration\Views\TeachingPlan\IndexManage.js" />
<Content Include="Areas\EducationalAdministration\Views\TextBookIndent\FormLook.js" />
<Content Include="Areas\EducationalAdministration\Views\TextBookIndent\FormDetail.js" />
<Content Include="Areas\EducationalAdministration\Views\TextBookIndent\FormView.js" />
<Content Include="Areas\EducationalAdministration\Views\Thermography\IndexResult.js" />
@@ -7589,6 +7590,7 @@
<Content Include="Areas\LogisticsManagement\Views\Accommodation\Unit.cshtml" />
<Content Include="Areas\EducationalAdministration\Views\TextBookIndent\FormDetail.cshtml" />
<Content Include="Areas\EducationalAdministration\Views\TextBookIndent\FormView.cshtml" />
<Content Include="Areas\EducationalAdministration\Views\TextBookIndent\FormLook.cshtml" />
<None Include="Properties\PublishProfiles\CustomProfile.pubxml" />
<None Include="Properties\PublishProfiles\FolderProfile.pubxml" />
<Content Include="Views\Login\Default-beifen.cshtml" />


Загрузка…
Отмена
Сохранить