//************************ //理财规划 //************************ $(function () { //下拉菜单 selectHelper.GetSelect({ url: "/Student/Value/GetFinancialTypeList", Id: "#selectFT", value: "全部" }); $("#selectFT").append(""); var sortName = ""; var sortWay = false; FinancialList(0, "", "", false);//初始化列表 $("#Search").bind("click", function () { Search(); }); //$("#status").unbind("change").bind("change", function () { // var KeyWords = $("#keyWords").val(); // var Status = $(this).val(); // FinancialList(Status, KeyWords); //}); $("#btnCreateDateSort").unbind("click").bind("click", function () { sortName = $(this).attr("tag"); if ($(this).hasClass("sort-top")) { $(this).removeClass("sort-top").addClass("sort-bottom"); sortWay = false; } else { $(this).removeClass("sort-bottom").addClass("sort-top"); sortWay = true; } FinancialList(0, "", sortName, sortWay) }); $("#btnUpdateDateSort").unbind("click").bind("click", function () { sortName = $(this).attr("tag"); if ($(this).hasClass("sort-top")) { $(this).removeClass("sort-top").addClass("sort-bottom"); sortWay = false; } else { $(this).removeClass("sort-bottom").addClass("sort-top"); sortWay = true; } FinancialList(0, "", sortName, sortWay) }) $("#keyWords").unbind("focus").focus(function () { $("#keyWords").val("").css("color", "black"); }); }); //理财规划列表显示 function FinancialList(Status, KeyWords, sortName, sortWay) { if (typeof Status == "undefined") { Status = 0; }; if (typeof KeyWords == "undefined") { KeyWords = ""; } if (typeof sortName == "undefined") { sortName = ""; } if (typeof sortWay == "undefined") { sortWay = false; } pageHelper.Init({ url: "/Student/FinancialPlanning/FinancialPlanningList", type: "POST", pageDiv: "#pages", data: { FinancialTypeId: $('#selectFT').val(), Status: Status, keyword: KeyWords, sortName: sortName, sortWay: sortWay, rId: Math.random(), }, bind: function (data) { var html = ""; if (data.Data.length > 0) { $(data.Data).each(function (index, dom) { //每行html var trHtml = ""; trHtml += ""; trHtml += "
{0}
"; trHtml += "
{1}
"; //建议数编号 trHtml += "
{2}
"; trHtml += "
{3}
"; trHtml += "
{4}
"; trHtml += "
{5}
"; trHtml += "
{6}
"; trHtml += "
{7}
"; trHtml += ""; if (dom.Status == EnumList.ProposalStatus.UnCommitted) {//未提交 //这里因为是只针对不实训来说 trHtml += "预览"; trHtml += "编辑"; if (dom.EndTimeType != "已结束") { trHtml += "提交"; } else if (dom.EndTimeType == "") { trHtml += "提交"; } trHtml += "删除"; } else if (dom.Status == EnumList.ProposalStatus.UnAudited) {//未审核 trHtml += "预览"; } else if (dom.Status == EnumList.ProposalStatus.Audited) {//已审核 trHtml += "预览"; trHtml += "审核报告"; trHtml += "删除"; } trHtml += ""; trHtml += ""; //拼接tbody html += StringHelper.FormatStr(trHtml, dom.ProposalNum, //0建议书编号 dom.ProposalName, //1建议书名称 dom.CustomerName, //2客户姓名 dom.IDNum, //3身份证号 dom.FinancialTypeName == "" ? "--" : dom.FinancialTypeName, //4理财类型 dom.strCreateDate, //5建立日期 dom.strUpdateDate, //6更新日期 dom.StatusName, //7状态 dom.StuCustomerId, //8潜在客户ID dom.TrainExamId, //9考核ID dom.Id, //10建议书id dom.CustomerType, //11客户类型 dom.Status //12建议书状态 ); }); } else { html = "未找到相关记录!"; } $("#FinancialPlanningBody").html(html); } }); } //搜索功能 function Search() { var FinancialTypeId = $('#selectFT').val(); var proposalName = $("#proposalName").val(); var customerName = $("#customerName").val(); var status = $("#status").val(); var keyWords = $("#keyWords").val().replace(/[<>&"]/g, function (c) { return { '<': '<', '>': '>', '&': '&', '"': '"', '"': '"', "'": '′', "'": '′' }[c]; }); if (keyWords == "建议书编号/建议书名称/客户姓名/身份证号") { keyWords = "" } FinancialList(status, keyWords); } //提交 function SubmitPropsal(Id, TrainExamId) { $.ajax({ url: "/Student/TrainExam/CalculateScore", type: "POST", async: false, data: { TrainExamId: TrainExamId, ProposalId: Id, Status: EnumList.ProposalStatus.UnAudited }, success: function (data, txtStatus) { if (txtStatus == "success") { dialogHelper.Success({ content: "提交成功", success: function () { window.location.reload(); } }); } } }); } //删除 function DelPropsal(stuCustomId, ProposalId) { dialogHelper.Confirm({ content: "确定删除?", success: function () { $.ajax({ url: "/Student/FinancialPlanning/FinancialDel", type: "POST", async: false, data: { ProposalId: ProposalId, stuCustomId: stuCustomId, // Status: EnumList.ProposalStatus.Audited }, success: function (data, txtStatus) { if (txtStatus == "success") { dialogHelper.Success({ content: "删除成功!", success: function () { window.location.reload(); } }); } } }); } }); }; //未提交删除 function RealDelPropsal(stuCustomId, ProposalId, CustomerType) { dialogHelper.Confirm({ content: "确定删除?", success: function () { $.ajax({ url: "/Student/FinancialPlanning/RealDelPropsal", type: "POST", async: false, data: { ProposalId: ProposalId, stuCustomId: stuCustomId, CustomerType: CustomerType, // Status: EnumList.ProposalStatus.Audited }, success: function (data, txtStatus) { if (txtStatus == "success") { dialogHelper.Success({ content: "删除成功!", success: function () { window.location.reload(); } }); } } }); } }); }; function PupReport(TrainExamId) { //加载列 GetList(TrainExamId); //弹出层 dialogHelper.Show("popScoreReport", 950, 980); } //审核报告 function GetList(TrainExamId) { pageHelper.Init({ url: "/Student/FinancialPlanning/ScoreResultsList", type: "POST", pageDiv: "#ScorePage", data: { TrainExamId: TrainExamId, rId: Math.random() }, bind: function (data) { var nData = data.Data; var trianName = nData[0].TrainExamName; if (nData[0].TrainExamName == null) { trianName = ""; $("#ExamName").text(""); }; $("#popScoreReport #TrainExamName").text(trianName).attr("title",trianName);//考核名 $("#popScoreReport #UserName").text(nData[0].UserName).attr("title", nData[0].UserName);//考生姓名 $("#popScoreReport #SchoolNum").text(nData[0].SchoolNum).attr("title", nData[0].SchoolNum);//学号 $("#popScoreReport #TotalScore").text(nData[0].UserScore);//分数 // var num = $("#popScoreReport a.cur").html(); var html = ""; $(nData).each(function (index, dom) { //每行html var serial = (index + 1); var trHtml = ""; trHtml += ""; trHtml += "
{0}
"; trHtml += "
{1}
"; trHtml += "
{2}
"; if (dom.ReferAnswer == null || dom.ReferAnswer == "") { trHtml += "
"; } else { trHtml += "
{6}
"; } if (dom.StuAnswer == null || dom.StuAnswer == "") { trHtml += "
"; } else { trHtml += "
{7}
"; } trHtml += "
{3}
"; trHtml += "
{4}
"; trHtml += ""; //拼接tbody html += StringHelper.FormatStr(trHtml, (dom.Serial - 1) * 10 + serial, //0 序号 dom.ModularName, //1 模块 dom.AssessmentPointName, //2 考点 dom.StatusName, //3 状态 dom.Score, //4 得分 dom.Id, //5 Id dom.ReferAnswer, //5参考答案 dom.StuAnswer //6学生答案 ); }); $("#TablePupSorce").html(""); $("#TablePupSorce").html(html); dialogHelper.Reset("popScoreReport"); Casetxt(TrainExamId) } }); }; function Casetxt(TrainExamId) { $.ajax({ url: "/Student/FinancialPlanning/CaseText", type: "POST", async: false, dataType: "json", data: { Id: TrainExamId, }, success: function (data) { $("#txt").html(data.CustomerStory) } }); } //编辑建议书 function EditProposal(TrainExamId, ProposalId, StuCustomerId, Status) { RemarkSystemLogin(); location.href = "/Student/ProposalCustomer/Index?TrainExamId=" + TrainExamId + "&ProposalId=" + ProposalId + "&StuCustomerId=" + StuCustomerId + "&Status=" + Status; }; //预览建议书 function PreviewProposal(ProposalId) { window.location.href = "/Student/ProposalCustomer/PreviewIndex?ProposalId=" + ProposalId; } function selecChange(selVal) { var result = 0; switch (selVal) { case 0: return result; break; case 1: return result = EnumList.ProposalStatus.UnCommitted; //未提交 break; case 2: return result = EnumList.ProposalStatus.UnAudited;//未审核 break; case 3: return result = EnumList.ProposalStatus.Audited;//已审核 break } }