From 95a3c7bb9cd6ad5032eba0ade83961cd64f12f02 Mon Sep 17 00:00:00 2001 From: zhangli <1109134334@qq.com> Date: Tue, 6 Jul 2021 11:21:43 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E7=AE=A1=E7=90=86=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ProjectDataManageController.cs | 18 +++ .../Views/ProjectDataManage/FormView.cshtml | 35 +++++ .../Views/ProjectDataManage/FormView.js | 119 +++++++++++++++++ .../Views/ProjectDataManage/IndexData.cshtml | 1 + .../Views/ProjectDataManage/IndexData.js | 21 ++- .../Views/ProjectDataManage/IndexView.cshtml | 53 ++++++++ .../Views/ProjectDataManage/IndexView.js | 121 ++++++++++++++++++ .../Views/ProjectManage/Index.cshtml | 1 + .../Views/ProjectManage/Index.js | 15 ++- .../Views/ProjectProcessManage/IndexData.js | 4 + .../Learun.Application.Web.csproj | 4 + .../ProjectDataManageService.cs | 24 ++-- 12 files changed, 402 insertions(+), 14 deletions(-) create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/ProjectDataManage/FormView.cshtml create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/ProjectDataManage/FormView.js create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/ProjectDataManage/IndexView.cshtml create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/ProjectDataManage/IndexView.js diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Controllers/ProjectDataManageController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Controllers/ProjectDataManageController.cs index 735c2f187..6eef3b817 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Controllers/ProjectDataManageController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Controllers/ProjectDataManageController.cs @@ -47,7 +47,25 @@ namespace Learun.Application.Web.Areas.LogisticsManagement.Controllers { return View(); } + /// + /// 项目资料查看 + /// + /// + [HttpGet] + public ActionResult IndexView() + { + return View(); + } + /// + /// 项目资料查看 + /// + /// + [HttpGet] + public ActionResult FormView() + { + return View(); + } #endregion #region 获取数据 diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/ProjectDataManage/FormView.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/ProjectDataManage/FormView.cshtml new file mode 100644 index 000000000..62abeb4a9 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/ProjectDataManage/FormView.cshtml @@ -0,0 +1,35 @@ +@{ + ViewBag.Title = "项目资料管理"; + Layout = "~/Views/Shared/_Form.cshtml"; +} +
+
+
项目*
+
+
+
+
项目阶段*
+
+
+
+
项目资料名称*
+ +
+
+
资料文件
+
+
+
+
负责部门
+
+
+
+
负责人
+
+
+
+
备注
+ +
+
+@Html.AppendJsFile("/Areas/LogisticsManagement/Views/ProjectDataManage/FormView.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/ProjectDataManage/FormView.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/ProjectDataManage/FormView.js new file mode 100644 index 000000000..1a75e92ef --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/ProjectDataManage/FormView.js @@ -0,0 +1,119 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日 期:2021-06-21 15:49 + * 描 述:项目资料管理 + */ +var acceptClick; +var keyValue = request('keyValue'); +var PPId = request("PPId");//项目阶段id +var PId = request("PId");//项目Id +var type = request("type");//项目Id +var bootstrap = function ($, learun) { + "use strict"; + var page = { + init: function () { + $('.lr-form-wrap').lrscroll(); + page.bind(); + page.initData(); + }, + bind: function () { + $('#PId').lrselect({ + // 展开最大高度 + maxHeight: 200, + // 是否允许搜索 + allowSearch: true, + // 访问数据接口地址 + url: top.$.rootUrl + '/LogisticsManagement/ProjectManage/GetList', + value: "Id", + text: "Name", + }); + if (!!PId) { + $('#PId').lrselectSet(PId); + } + $('#PPId').lrselect({ + type: 'tree', + // 展开最大高度 + maxHeight: 200, + // 是否允许搜索 + allowSearch: true, + // 访问数据接口地址 + url: top.$.rootUrl + '/LogisticsManagement/ProjectPhaseManage/GetTree', + select: function (item) { + if (item != null && item != undefined) { + + } + } + }); + if (!!PPId) { + $('#PPId').lrselectSet(PPId); + } + $('#Files').lrUploader(); + $('#DepartmentId').lrDataSourceSelect({ + code: 'classdata', + value: 'id', + text: 'name', + select: function (item) { + var DeptCode = $('#DepartmentId').lrselectGet(); + if (DeptCode != null && DeptCode != "" && DeptCode != undefined) { + $('#ManagerId').lrselectRefresh({ + url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=BaseUser', + value: 'f_userid', + text: 'f_realname', + param: { strWhere: " 1=1 and f_departmentid in ('" + DeptCode + "')" }, + maxHeight: 200, + }); + } + } + }); + $('#ManagerId').lrselect({ + url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=BaseUser', + value: 'f_userid', + text: 'f_realname', + param: { strWhere: " 1=2 " }, + maxHeight: 200, + }); + + }, + initData: function () { + if (!!keyValue) { + $.lrSetForm(top.$.rootUrl + '/LogisticsManagement/ProjectDataManage/GetFormData?keyValue=' + keyValue, function (data) { + for (var id in data) { + if (!!data[id].length && data[id].length > 0) { + $('#' + id).jfGridSet('refreshdata', data[id]); + } + else { + $('[data-table="' + id + '"]').lrSetFormData(data[id]); + } + } + + }); + } + } + }; + //// 保存数据 + //acceptClick = function (callBack) { + // if (!$('body').lrValidform()) { + // return false; + // } + // var postData = { + // strEntity: JSON.stringify($('body').lrGetFormData()) + // }; + // if (type == 2) { + // $.lrSaveForm(top.$.rootUrl + '/LogisticsManagement/ProjectDataManage/SaveData?keyValue=' + keyValue, postData, function (res) { + // // 保存成功后才回调 + // if (!!callBack) { + // callBack(); + // } + // }); + // } else { + // $.lrSaveForm(top.$.rootUrl + '/LogisticsManagement/ProjectDataManage/SaveForm?keyValue=' + keyValue, postData, function (res) { + // // 保存成功后才回调 + // if (!!callBack) { + // callBack(); + // } + // }); + // } + //}; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/ProjectDataManage/IndexData.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/ProjectDataManage/IndexData.cshtml index 09e668ffb..b5acd318c 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/ProjectDataManage/IndexData.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/ProjectDataManage/IndexData.cshtml @@ -43,6 +43,7 @@ diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/ProjectDataManage/IndexData.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/ProjectDataManage/IndexData.js index 6fcfe9cba..84e7b2129 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/ProjectDataManage/IndexData.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/ProjectDataManage/IndexData.js @@ -29,6 +29,10 @@ var bootstrap = function ($, learun) { $('#lr_data').on('click', function () { var keyValue = $('#gridtable').jfGridValue('Id'); if (learun.checkrow(keyValue)) { + var Status = $('#gridtable').jfGridValue('Status'); + if (Status != 1) { + return learun.alert.warning('只有进行中状态才可以上传!'); + } learun.layerForm({ id: 'ProjectDataManageIndex', title: '项目资料管理', @@ -42,6 +46,21 @@ var bootstrap = function ($, learun) { }); } }); + //查看项目资料 + $('#lr_dataview').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('Id'); + if (learun.checkrow(keyValue)) { + learun.layerForm({ + id: 'ProjectDataManageIndex', + title: '项目资料查看', + url: top.$.rootUrl + '/LogisticsManagement/ProjectDataManage/IndexView?PId=' + keyValue, + width: 1000, + height: 800, + btn: null + + }); + } + }); }, inittree: function () { // 初始化左侧树形数据 @@ -175,7 +194,7 @@ var bootstrap = function ($, learun) { search: function (param) { param = param || {}; param.PTId = PTId; - param.SqlParameter = " and [Status]=1"; + //param.SqlParameter = " and [Status]=1"; $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); } }; diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/ProjectDataManage/IndexView.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/ProjectDataManage/IndexView.cshtml new file mode 100644 index 000000000..461e076f6 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/ProjectDataManage/IndexView.cshtml @@ -0,0 +1,53 @@ +@{ + /**/ + + ViewBag.Title = "项目资料管理"; + Layout = "~/Views/Shared/_Index.cshtml"; +} +
+
+
+
阶段
+
+
+
+
+
+
+ 未选择阶段 - 列表信息 +
+
+
+
+
+
+
+
资料名称
+ +
+
+
负责部门
+
+
+
+
负责人
+
+
+
+
+
+
+
+
+ +
+
+  查看 +
+
+
+
+
+
+
+@Html.AppendJsFile("/Areas/LogisticsManagement/Views/ProjectDataManage/IndexView.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/ProjectDataManage/IndexView.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/ProjectDataManage/IndexView.js new file mode 100644 index 000000000..b5d443e1d --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/ProjectDataManage/IndexView.js @@ -0,0 +1,121 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日 期:2021-06-21 15:49 + * 描 述:项目资料管理 + */ +var refreshGirdData; +var acceptClick; +var PPId; +var PId = request("PId");//项目Id +var type = request("type");//type==2,上传项目资料 +var bootstrap = function ($, learun) { + "use strict"; + var page = { + init: function () { + page.inittree(); + page.initGird(); + page.bind(); + }, + bind: function () { + $('#multiple_condition_query').lrMultipleQuery(function (queryJson) { + page.search(queryJson); + }, 220, 400); + $('#DepartmentId').lrDepartmentSelect(); + $('#ManagerId').lrUserSelect(0); + // 刷新 + $('#lr_refresh').on('click', function () { + location.reload(); + }); + + // 编辑 + $('#lr_view').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('Id'); + if (learun.checkrow(keyValue)) { + learun.layerForm({ + id: 'ProjectDataManageform', + title: '查看', + url: top.$.rootUrl + '/LogisticsManagement/ProjectDataManage/FormView?keyValue=' + keyValue, + width: 800, + height: 600, + btn: null + }); + } + }); + }, + inittree: function () { + // 初始化左侧树形数据 + $('#dataTree').lrtree({ + url: top.$.rootUrl + '/LogisticsManagement/ProjectPhaseManage/GetTree', + nodeClick: page.treeNodeClick + }); + }, + treeNodeClick: function (item) { + PPId = item.id; + $('#titleinfo').text(item.text); + page.search(); + }, + // 初始化列表 + initGird: function () { + $('#gridtable').jfGrid({ + url: top.$.rootUrl + '/LogisticsManagement/ProjectDataManage/GetPageList', + headData: [ + { label: "项目资料名称", name: "Name", width: 200, align: "left" }, + { + label: "负责部门", name: "DepartmentId", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'classdata', + key: value, + keyId: 'id', + callback: function (_data) { + callback(_data['name']); + } + }); + } + }, + { + label: "负责人", name: "ManagerId", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('user', { + key: value, + callback: function (_data) { + callback(_data.name); + } + }); + } + }, + { + label: "是否上传", name: "FileStatus", width: 130, align: "left", + formatter: function (value) { + return value == '1' ? '' : ''; + } + }, + { label: "上传时间", name: "FileTime", width: 130, align: "left" }, + { label: "备注", name: "Remark", width: 100, align: "left" }, + ], + mainId: 'Id', + isPage: true, + sidx: 'CreateTime desc' + }); + page.search(); + }, + search: function (param) { + param = param || {}; + param.PPId = PPId; + param.PId = PId; + $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); + } + }; + refreshGirdData = function () { + $('#gridtable').jfGridSet('reload'); + }; + // 保存数据 + acceptClick = function (callBack) { + if (!!callBack) { + callBack(); + } + learun.layerClose(window.name); + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/ProjectManage/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/ProjectManage/Index.cshtml index 2562a0618..8147f8af3 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/ProjectManage/Index.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/ProjectManage/Index.cshtml @@ -50,6 +50,7 @@   设置上传项目资料   审核   去审 +   归档 diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/ProjectManage/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/ProjectManage/Index.js index 49bd5c2fe..32a67074e 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/ProjectManage/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/ProjectManage/Index.js @@ -104,6 +104,19 @@ var bootstrap = function ($, learun) { }); } }); + // 归档,将状态改为2 + $('#lr_file').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('Id'); + if (learun.checkrow(keyValue)) { + learun.layerConfirm('是否确认归档该项!', function (res) { + if (res) { + learun.postForm(top.$.rootUrl + '/LogisticsManagement/ProjectManage/UpdateStatus', { keyValue: keyValue, Status: 2 }, function () { + refreshGirdData(); + }); + } + }); + } + }); //设置上传项目资料 $('#lr_data').on('click', function () { @@ -175,7 +188,7 @@ var bootstrap = function ($, learun) { } else if (value == 1) { return '进行中'; } else if (value == 2) { - return '完成'; + return '已完成'; } } }, diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/ProjectProcessManage/IndexData.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/ProjectProcessManage/IndexData.js index bae13f704..94b0a42ea 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/ProjectProcessManage/IndexData.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/ProjectProcessManage/IndexData.js @@ -29,6 +29,10 @@ var bootstrap = function ($, learun) { $('#lr_data').on('click', function () { var keyValue = $('#gridtable').jfGridValue('Id'); if (learun.checkrow(keyValue)) { + var Status = $('#gridtable').jfGridValue('Status'); + if (Status != 1) { + return learun.alert.warning('只有进行中状态才可填写!'); + } learun.layerForm({ id: 'ProjectDataManageIndex', title: '项目进展情况管理', diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj b/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj index de0bb39ef..d185c4128 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj @@ -1207,7 +1207,9 @@ + + @@ -7366,6 +7368,8 @@ + + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/ProjectDataManage/ProjectDataManageService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/ProjectDataManage/ProjectDataManageService.cs index c1af6086c..49d823f51 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/ProjectDataManage/ProjectDataManageService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/ProjectDataManage/ProjectDataManageService.cs @@ -197,18 +197,18 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement { entity.Modify(keyValue); db.Update(entity); - if (!string.IsNullOrEmpty(entity.Files)) - { - //判断当前项目各阶段是否已全部上传 - var list = db.FindList(x => x.PId == entity.PId && !string.IsNullOrEmpty(x.Files) && x.Id != keyValue); - if (list.Count() <= 0) - { - //如果全部已上传,将项目状态改为已完成 - var projectManageEntity = db.FindEntity(x => x.Id == entity.PId); - projectManageEntity.Status = "2"; - db.Update(projectManageEntity); - } - } + //if (!string.IsNullOrEmpty(entity.Files)) + //{ + // //判断当前项目各阶段是否已全部上传 + // var list = db.FindList(x => x.PId == entity.PId && !string.IsNullOrEmpty(x.Files) && x.Id != keyValue); + // if (list.Count() <= 0) + // { + // //如果全部已上传,将项目状态改为已完成 + // var projectManageEntity = db.FindEntity(x => x.Id == entity.PId); + // projectManageEntity.Status = "2"; + // db.Update(projectManageEntity); + // } + //} } else