From bd2a62033edd23c26349c9af980b53ebc4553916 Mon Sep 17 00:00:00 2001 From: dyy <807692433@qq.com> Date: Fri, 1 Apr 2022 14:53:56 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BF=AE=E6=94=B9=E3=80=91=E6=95=99?= =?UTF-8?q?=E5=8A=A1-=E6=95=99=E5=AD=A6=E8=B0=83=E5=BA=A6=EF=BC=9A?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E3=80=81=E6=9F=A5=E7=9C=8B=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E8=B0=83=E5=BA=A6=E6=97=B6=E9=97=B4=E7=9A=84=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=EF=BC=9B=E6=95=99=E5=AD=A6=E8=B0=83=E5=BA=A6=E6=B5=81=E7=A8=8B?= =?UTF-8?q?=E7=9A=84=E4=BF=AE=E6=94=B9=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Views/ArrangeLessonTermAttemper/Form.js | 14 +++++-- .../ArrangeLessonTermAttemper/FormView.js | 25 +++++++------ .../Views/ArrangeLessonTermAttemper/Index.js | 37 +++++++++++++------ .../ArrangeLessonTermAttemperMethod.cs | 20 ++++++---- 4 files changed, 62 insertions(+), 34 deletions(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeLessonTermAttemper/Form.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeLessonTermAttemper/Form.js index fa6eb33c9..46e63e24a 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeLessonTermAttemper/Form.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeLessonTermAttemper/Form.js @@ -223,7 +223,10 @@ var bootstrap = function ($, learun) { $('#NewClassroomNo').siblings('div').html('教室*'); } } - page.query(); + var timer = setTimeout(function () { + page.query(); + clearTimeout(timer); + }, 3000) } }); } @@ -257,7 +260,7 @@ var bootstrap = function ($, learun) { } }; // 设置表单数据 - setFormData = function (processId) { + setFormData = function (processId, param, callback) { if (!!processId) { $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/ArrangeLessonTermAttemper/GetFormDataByProcessId?processId=' + processId, function (data) { for (var id in data) { @@ -299,9 +302,14 @@ var bootstrap = function ($, learun) { $('#NewClassroomNo').siblings('div').html('教室*'); } } + var timer = setTimeout(function () { + page.query(); + clearTimeout(timer); + }, 3000) } }); } + callback && callback(); } // 验证数据是否填写完整 validForm = function () { @@ -338,7 +346,7 @@ var bootstrap = function ($, learun) { $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/ArrangeLessonTermAttemper/SaveForm?keyValue=' + keyValue, postData, function (res) { // 保存成功后才回调 if (!!callBack) { - callBack(res, formData, i); + callBack(res, i); } }); }; diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeLessonTermAttemper/FormView.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeLessonTermAttemper/FormView.js index aa1925fba..e33622b88 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeLessonTermAttemper/FormView.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeLessonTermAttemper/FormView.js @@ -41,6 +41,7 @@ var bootstrap = function ($, learun) { p.TeachClassNo = $('#TeachClassNo').lrselectGet(); p.EmpNo = $('#EmpNo').lrselectGet(); p.ClassroomNo = $('#ClassroomNo').lrselectGet(); + //console.log(p); //if (!!p.F_SchoolId && !!p.AcademicYearNo && !!p.Semester && !!p.DeptNo && !!p.MajorNo && !!p.LessonNo && !!p.TeachClassNo && !!p.EmpNo && !!p.ClassroomNo) { if (!!p.AcademicYearNo && !!p.Semester && !!p.DeptNo && !!p.MajorNo && !!p.LessonNo && !!p.TeachClassNo && !!p.EmpNo && !!p.ClassroomNo) { //调度开始时间 @@ -226,11 +227,11 @@ var bootstrap = function ($, learun) { $('#NewClassroomNo').siblings('div').html('教室*'); } } - page.query(); - if (!!data[id].length && data[id].length > 0) { - $('#AttemperStartTime').lrselectSet(data[id].AttemperStartTime); - $('#AttemperEndTime').lrselectSet(data[id].AttemperEndTime); - } + var timer = setTimeout(function () { + page.query(); + clearTimeout(timer); + },3000) + } }); } @@ -264,7 +265,7 @@ var bootstrap = function ($, learun) { } }; // 设置表单数据 - setFormData = function (processId) { + setFormData = function (processId, param, callback) { if (!!processId) { $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/ArrangeLessonTermAttemper/GetFormDataByProcessId?processId=' + processId, function (data) { for (var id in data) { @@ -308,14 +309,14 @@ var bootstrap = function ($, learun) { $('#NewClassroomNo').siblings('div').html('教室*'); } } - page.query(); - if (!!data[id].length && data[id].length > 0) { - $('#AttemperStartTime').lrselectSet(data[id].AttemperStartTime); - $('#AttemperEndTime').lrselectSet(data[id].AttemperEndTime); - } + var timer = setTimeout(function () { + page.query(); + clearTimeout(timer); + }, 3000) } }); } + callback && callback(); } // 验证数据是否填写完整 validForm = function () { @@ -348,7 +349,7 @@ var bootstrap = function ($, learun) { $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/ArrangeLessonTermAttemper/SaveForm?keyValue=' + keyValue, postData, function (res) { // 保存成功后才回调 if (!!callBack) { - callBack(res, formData, i); + callBack(res, i); } }); }; diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeLessonTermAttemper/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeLessonTermAttemper/Index.js index b390431e8..6b56aca3e 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeLessonTermAttemper/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeLessonTermAttemper/Index.js @@ -408,21 +408,36 @@ var bootstrap = function ($, learun) { } }; refreshGirdData = function (res, postData) { - if (res.code == 200) { + //if (res.code == 200) { + // // 发起流程 + // learun.workflowapi.create({ + // isNew: true, + // schemeCode: 'ArrangeLessonTermAttemper',// 填写流程对应模板编号 + // processId: processId, + // processName: '课程异动申请',// 对应流程名称 + // processLevel: '1', + // description: '', + // formData: JSON.stringify(postData), + // callback: function (res, data) { + // } + // }); + // page.search(); + //} + + if (res && res.code && res.code == 200) { // 发起流程 - learun.workflowapi.create({ - isNew: true, - schemeCode: 'ArrangeLessonTermAttemper',// 填写流程对应模板编号 + + var postData = { + schemeCode: 'ArrangeLessonTermAttemper',// 填写流程对应模板编号 processId: processId, - processName: '课程异动申请',// 对应流程名称 - processLevel: '1', - description: '', - formData: JSON.stringify(postData), - callback: function (res, data) { - } + level: '1', + }; + learun.httpAsync('Post', top.$.rootUrl + '/LR_NewWorkFlow/NWFProcess/CreateFlow', postData, function (data) { + learun.loading(false); }); - page.search(); + } + page.search(); }; page.init(); } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.WorkFlow/NodeMethod/ArrangeLessonTermAttemperMethod.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.WorkFlow/NodeMethod/ArrangeLessonTermAttemperMethod.cs index 5f0ecf4ed..d1e0e9d24 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.WorkFlow/NodeMethod/ArrangeLessonTermAttemperMethod.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.WorkFlow/NodeMethod/ArrangeLessonTermAttemperMethod.cs @@ -7,17 +7,21 @@ using System.Threading.Tasks; namespace Learun.Application.WorkFlow { - public class ArrangeLessonTermAttemperMethod : INodeMethod + public class ArrangeLessonTermAttemperMethod : IWorkFlowMethod { ArrangeLessonTermAttemperIBLL arrangeLessonTermAttemperIBLL = new ArrangeLessonTermAttemperBLL(); - public void Sucess(string processId) + + public void Execute(WfMethodParameter parameter) { - arrangeLessonTermAttemperIBLL.ModifyStatusByProcessId(2, processId); - } - - public void Fail(string processId) - { - arrangeLessonTermAttemperIBLL.ModifyStatusByProcessId(0, processId); + if (parameter.code == "agree") + { + arrangeLessonTermAttemperIBLL.ModifyStatusByProcessId(2, parameter.processId); + } + else + { + arrangeLessonTermAttemperIBLL.ModifyStatusByProcessId(0, parameter.processId); + } } + } }