@@ -36,6 +36,16 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
{ | |||
return View(); | |||
} | |||
/// <summary> | |||
/// 表单页 | |||
/// </summary> | |||
/// <returns></returns> | |||
[HttpGet] | |||
public ActionResult FormView() | |||
{ | |||
return View(); | |||
} | |||
#endregion | |||
#region 获取数据 | |||
@@ -85,6 +95,18 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
var data = psychologyInfoIBLL.GetEntity(keyValue); | |||
return Success(data); | |||
} | |||
/// <summary> | |||
/// 获取表单数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
[HttpGet] | |||
[AjaxOnly] | |||
public ActionResult GetFormViewData(string keyValue) | |||
{ | |||
var data = psychologyInfoIBLL.GetEntityForView(keyValue); | |||
return Success(data); | |||
} | |||
#endregion | |||
#region 提交数据 | |||
@@ -0,0 +1,31 @@ | |||
@{ | |||
ViewBag.Title = "心理预约查看"; | |||
Layout = "~/Views/Shared/_Form.cshtml"; | |||
} | |||
<div class="lr-form-wrap" id="form"> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">咨询内容</div> | |||
<textarea id="Concent" class="form-control" readonly></textarea> | |||
</div> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">附件</div> | |||
<div id="Url"></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="PsychologyReplyInfo"> | |||
<div class="lr-form-item-title">最终回复人</div> | |||
<div id="ReplyUser" readonly></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="PsychologyReplyInfo"> | |||
<div class="lr-form-item-title">最终回复内容</div> | |||
<textarea id="ReplyContent" class="form-control" style="height:100px;" readonly></textarea> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="PsychologyReplyInfo"> | |||
<div class="lr-form-item-title">最终回复时间</div> | |||
<input id="ReplyTime" type="text" class="form-control" readonly /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="PsychologyReplyInfo"> | |||
<div class="lr-form-item-title">附件上传</div> | |||
<div id="Urls"></div> | |||
</div> | |||
</div> | |||
@Html.AppendJsFile("/Areas/EducationalAdministration/Views/PsychologyInfo/FormView.js") |
@@ -0,0 +1,64 @@ | |||
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) | |||
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
* 创建人:超级管理员 | |||
* 日 期:2023-03-06 12:18 | |||
* 描 述:心理预约查看 | |||
*/ | |||
var acceptClick; | |||
var keyValue = request('keyValue'); | |||
// 设置权限 | |||
var setAuthorize; | |||
// 设置表单数据 | |||
var setFormData; | |||
var bootstrap = function ($, learun) { | |||
"use strict"; | |||
var selectedRow = learun.frameTab.currentIframe().selectedRow; | |||
var page = { | |||
init: function () { | |||
page.initData(); | |||
page.bind(); | |||
}, | |||
bind: function () { $('#ReplyUser').lrDataSourceSelect({ code: 'TeacherInfo', value: 'f_account', text: 'f_realname' }); | |||
$('#Url').lrUploader({ isUpload: false }); | |||
$('#Urls').lrUploader({ isUpload: false }); | |||
}, | |||
initData: function () { | |||
if (!!keyValue) { | |||
$.lrSetForm(top.$.rootUrl + '/EducationalAdministration/PsychologyInfo/GetFormViewData?keyValue=' + keyValue, function (data) { | |||
$('#form').lrSetFormData(data); | |||
}); | |||
} | |||
} | |||
}; | |||
// 设置表单数据 | |||
setFormData = function (processId) { | |||
if (!!processId) { | |||
$.lrSetForm(top.$.rootUrl + '/EducationalAdministration/PsychologyInfo/GetFormData?keyValue=' + keyValue, function (data) { | |||
$('#form').lrSetFormData(data); | |||
}); | |||
} | |||
} | |||
// 保存数据 | |||
acceptClick = function (callBack) { | |||
if (!$('#form').lrValidform()) { | |||
return false; | |||
} | |||
var user = learun.clientdata.get(['userinfo']); | |||
if (user.Description != "学生") { | |||
learun.alert.warning("当前用户非学生,不可提交!"); | |||
return false; | |||
} | |||
var formdata = $('#form').lrGetFormData(); | |||
formdata.StuNo = user.account; | |||
var postData = { | |||
strEntity: JSON.stringify(formdata) | |||
}; | |||
$.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/PsychologyInfo/SaveForm?keyValue=' + keyValue, postData, function (res) { | |||
// 保存成功后才回调 | |||
if (!!callBack) { | |||
callBack(); | |||
} | |||
}); | |||
}; | |||
page.init(); | |||
} |
@@ -16,6 +16,7 @@ | |||
<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_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> | |||
@@ -46,6 +46,23 @@ var bootstrap = function ($, learun) { | |||
$('#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/PsychologyInfo/FormView?keyValue=' + keyValue, | |||
width: 670, | |||
height: 550, | |||
btn: null, | |||
callBack: function (id) { | |||
return top[id].acceptClick(refreshGirdData); | |||
} | |||
}); | |||
} | |||
}); | |||
// 新增 | |||
$('#lr_add').on('click', function () { | |||
selectedRow = null; | |||
@@ -153,18 +170,6 @@ var bootstrap = function ($, learun) { | |||
}); | |||
} | |||
}, | |||
{ | |||
label: '状态', name: 'State', width: 80, align: "left", | |||
formatter: function (cellvalue, row) { | |||
if (cellvalue == 0) { | |||
return "<span class=\"label label-primary\">草稿</span>"; | |||
} else if (cellvalue == 7) { | |||
return "<span class=\"label label-success\">已回复</span>"; | |||
} else { | |||
return "<span class=\"label label-warning\">待回复</span>"; | |||
} | |||
} | |||
}, | |||
{ | |||
label: '提交日期', name: 'CreateTime', width: 130, align: "left", | |||
formatter: function (cellvalue) { | |||
@@ -205,6 +210,18 @@ var bootstrap = function ($, learun) { | |||
}); | |||
} | |||
}, | |||
{ | |||
label: '状态', name: 'State', width: 80, align: "left", | |||
formatter: function (cellvalue, row) { | |||
if (cellvalue == 0) { | |||
return "<span class=\"label label-primary\">草稿</span>"; | |||
} else if (cellvalue == 7) { | |||
return "<span class=\"label label-success\">已回复</span>"; | |||
} else { | |||
return "<span class=\"label label-warning\">待回复</span>"; | |||
} | |||
} | |||
}, | |||
], | |||
mainId: 'Id', | |||
isPage: true, | |||
@@ -992,6 +992,7 @@ | |||
<Content Include="Areas\EducationalAdministration\Views\Acc_DormitoryChange\FormView.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\CdMajor\FormProvince.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\CdMajor\IndexProvince.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\PsychologyInfo\FormView.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\StuInfoBasic\SoonGraduateIndex.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\YKTStateMent\AnalysisByMonthForStudent.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\YKTStateMent\ManageIndexTeacher.js" /> | |||
@@ -8093,6 +8094,7 @@ | |||
<Content Include="Areas\LR_Desktop\Views\PsychologyReplyInfo\FormFive.cshtml" /> | |||
<Content Include="Areas\LR_Desktop\Views\PsychologyReplyInfo\FormSix.cshtml" /> | |||
<Content Include="Areas\LR_Desktop\Views\PsychologyReplyInfo\FormFiveView.cshtml" /> | |||
<Content Include="Areas\EducationalAdministration\Views\PsychologyInfo\FormView.cshtml" /> | |||
<None Include="Properties\PublishProfiles\CustomProfile.pubxml" /> | |||
<None Include="Properties\PublishProfiles\FolderProfile.pubxml" /> | |||
<Content Include="Views\Login\Default-beifen.cshtml" /> | |||
@@ -91,6 +91,25 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
} | |||
} | |||
public PsychologyInfoEntity GetEntityForView(string keyValue) | |||
{ | |||
try | |||
{ | |||
return psychologyInfoService.GetEntityForView(keyValue); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
#endregion | |||
#region 提交数据 | |||
@@ -34,6 +34,8 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
PsychologyInfoEntity GetEntity(string keyValue); | |||
PsychologyInfoEntity GetEntityForView(string keyValue); | |||
#endregion | |||
#region 提交数据 | |||
@@ -5,6 +5,7 @@ using System; | |||
using System.Collections.Generic; | |||
using System.Data; | |||
using System.Text; | |||
using System.Linq; | |||
namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
{ | |||
@@ -123,7 +124,35 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 学生查看 | |||
/// </summary> | |||
/// <param name="keyValue"></param> | |||
/// <returns></returns> | |||
public PsychologyInfoEntity GetEntityForView(string keyValue) | |||
{ | |||
try | |||
{ | |||
var db = this.BaseRepository().getDbConnection().Database; | |||
var strSql = new StringBuilder(); | |||
strSql.Append(" SELECT t.*,p.ReplyContent,p.Url as Urls,p.ReplyUser,p.ReplyTime,l.F_RealName FROM PsychologyInfo t "); | |||
strSql.Append(" left join PsychologyReplyInfo p on p.PsychologyInfoid=t.id and p.ReplyType = 2"); | |||
strSql.Append($" left join {db}.dbo.LR_Base_User l on l.F_account =p.ReplyUser "); | |||
strSql.Append($" where t.Id='{keyValue}' "); | |||
return this.BaseRepository("CollegeMIS").FindList<PsychologyInfoEntity>(strSql.ToString()).FirstOrDefault(); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
#endregion | |||
#region 提交数据 | |||