From c1f112d92c0ec94084a1310ed68c0d15351464a8 Mon Sep 17 00:00:00 2001 From: zhichao lei <442149704@qq.com> Date: Mon, 28 Dec 2020 17:33:26 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=AC=E6=96=87=E9=80=9A=E7=9F=A5=20?= =?UTF-8?q?=E5=8F=AA=E8=83=BD=E5=88=A0=E9=99=A4=E8=8D=89=E7=A8=BF=20=20?= =?UTF-8?q?=E5=92=8C=20=E6=8F=90=E4=BA=A4=E6=8A=A5=E9=94=99=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../LR_OAModule/Views/Notice/FormFlow.cshtml | 4 +- .../LR_OAModule/Views/Notice/FormFlow.js | 65 +++++++++++++++++-- .../LR_OAModule/Views/Notice/IndexFlow.js | 26 +++++--- 3 files changed, 77 insertions(+), 18 deletions(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/Notice/FormFlow.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/Notice/FormFlow.cshtml index 806df9397..f80c7809c 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/Notice/FormFlow.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/Notice/FormFlow.cshtml @@ -18,8 +18,8 @@
-
信息来源
- +
信息来源*
+
来源地址
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/Notice/FormFlow.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/Notice/FormFlow.js index 9088563e8..8cb2bc2fd 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/Notice/FormFlow.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/Notice/FormFlow.js @@ -84,17 +84,68 @@ var bootstrap = function ($, learun) { }; // 保存数据 save = function (processId, callBack, i) { - var formData = $('body').lrGetFormData(); - if (!!processId) { - formData.RProcessId = processId; + + if (!$('#form').lrValidform()) { + return false; } - $.lrSaveForm(top.$.rootUrl + '/LR_OAModule/Notice/SaveForm?keyValue=' + keyValue, formData, function (res) { - // 保存成功后才回调 - if (!!callBack) { - callBack(res, formData, i); + var formData = $('body').lrGetFormData(); + if (!!processId) { + formData.RProcessId = processId; + } + + learun.clientdata.getAsync('dataItem', { + + key: $("#F_CategoryId").lrselectGet(), + code: 'NoticeCategory', + callback: function (_data) { + $("#F_Category").val(_data.text); + + var postData = $('#form').lrGetFormData(keyValue); + postData["F_NewsContent"] = ue.getContent(null, null, true); + $.lrSaveForm(top.$.rootUrl + '/LR_OAModule/Notice/SaveForm?keyValue=' + keyValue, postData, function (res) { + // 保存成功后才回调 + if (!!callBack) { + callBack(res, formData, i); + } + }); } }); + + + + + + //$.lrSaveForm(top.$.rootUrl + '/LR_OAModule/Notice/SaveForm?keyValue=' + keyValue, formData, function (res) { + // // 保存成功后才回调 + // if (!!callBack) { + // callBack(res, formData, i); + // } + //}); }; + + acceptClick = function (callBack) { + if (!$('#form').lrValidform()) { + return false; + } + learun.clientdata.getAsync('dataItem', { + key: $("#F_CategoryId").lrselectGet(), + code: 'NoticeCategory', + callback: function (_data) { + $("#F_Category").val(_data.text); + + var postData = $('#form').lrGetFormData(keyValue); + postData["F_NewsContent"] = ue.getContent(null, null, true); + $.lrSaveForm(top.$.rootUrl + '/LR_OAModule/Notice/SaveForm?keyValue=' + keyValue, postData, function (res) { + // 保存成功后才回调 + if (!!callBack) { + callBack(); + } + }); + } + }); + + + } page.init(); } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/Notice/IndexFlow.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/Notice/IndexFlow.js index 35e94c692..30630a9c9 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/Notice/IndexFlow.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/Notice/IndexFlow.js @@ -94,14 +94,22 @@ var bootstrap = function ($, learun) { // 删除 $('#lr_delete').on('click', function () { var keyValue = $('#gridtable').jfGridValue('F_NewsId'); - if (learun.checkrow(keyValue)) { - learun.layerConfirm('是否确认删除该项!', function (res) { - if (res) { - learun.deleteForm(top.$.rootUrl + '/LR_OAModule/Notice/DeleteForm', { keyValue: keyValue }, function () { - refreshGirdData(); - }); - } - }); + var status = $('#gridtable').jfGridValue('F_Status'); + console.log(status); + if (status.indexOf("1")>0 || status.indexOf("2")>0) { + learun.alert.warning("只能删除草稿!"); + return; + } else { + + if (learun.checkrow(keyValue)) { + learun.layerConfirm('是否确认删除该项!', function (res) { + if (res) { + learun.deleteForm(top.$.rootUrl + '/LR_OAModule/Notice/DeleteForm', { keyValue: keyValue }, function () { + refreshGirdData(); + }); + } + }); + } } }); //  提交 @@ -109,7 +117,7 @@ var bootstrap = function ($, learun) { var keyValue = $('#gridtable').jfGridValue('F_NewsId'); if (learun.checkrow(keyValue)) { var SendFlag = $('#gridtable').jfGridValue('F_Status'); - if (SendFlag == "1" || SendFlag=="2") { + if (SendFlag == "1" || SendFlag == "2") { learun.alert.warning("当前项目已提交,请耐心等待审批!"); return; }