From 6131316db2e61c717a6fbd1db774b41b60c933e9 Mon Sep 17 00:00:00 2001 From: username@email.com <yzy2002yzy@163.com> Date: 星期三, 21 九月 2022 09:45:32 +0800 Subject: [PATCH] 优化查询 --- zhengcaioa/zhengcaioa/Views/CooperatecustomCustomer/Index.cshtml | 30 ++++++++++++++- zhengcaioa/zhengcaioa/Controllers/ProjectController.cs | 4 ++ zhengcaioa/zhengcaioa/Views/Project/Select.cshtml | 22 ++++++++++- zhengcaioa/zhengcaioa/Controllers/Customer/CooperatecustomCustomerController.cs | 6 +++ zhengcaioa/zhengcaioa/Views/IntentionCustomer/Index.cshtml | 28 +++++++++++++- zhengcaioa/zhengcaioa/Controllers/Customer/IntentionCustomerController.cs | 4 ++ 6 files changed, 88 insertions(+), 6 deletions(-) diff --git a/zhengcaioa/zhengcaioa/Controllers/Customer/CooperatecustomCustomerController.cs b/zhengcaioa/zhengcaioa/Controllers/Customer/CooperatecustomCustomerController.cs index e5f2e87..6b97fdb 100644 --- a/zhengcaioa/zhengcaioa/Controllers/Customer/CooperatecustomCustomerController.cs +++ b/zhengcaioa/zhengcaioa/Controllers/Customer/CooperatecustomCustomerController.cs @@ -155,6 +155,12 @@ areaDTOsic.ParentId = "0 "; areaDTOs.Insert(1, areaDTOsic); ViewBag.ShengDropDown = areaDTOs.Select(x => new { code = x.CodeId, label = x.Name }).ToList(); + + + ViewBag.Baomingtimebegin = DateTime.Now.AddYears(-1).ToString("yyyy-MM-dd"); + ViewBag.Baomingtimeend = DateTime.Now.ToString("yyyy-MM-dd"); + + return View(); } diff --git a/zhengcaioa/zhengcaioa/Controllers/Customer/IntentionCustomerController.cs b/zhengcaioa/zhengcaioa/Controllers/Customer/IntentionCustomerController.cs index 11d978b..c934de2 100644 --- a/zhengcaioa/zhengcaioa/Controllers/Customer/IntentionCustomerController.cs +++ b/zhengcaioa/zhengcaioa/Controllers/Customer/IntentionCustomerController.cs @@ -182,6 +182,10 @@ areaDTOsic.ParentId = "0 "; areaDTOs.Insert(1, areaDTOsic); ViewBag.ShengDropDown = areaDTOs.Select(x => new { code = x.CodeId, label = x.Name }).ToList(); + + ViewBag.Baomingtimebegin = DateTime.Now.AddYears(-1).ToString("yyyy-MM-dd"); + ViewBag.Baomingtimeend = DateTime.Now.ToString("yyyy-MM-dd"); + return View(); } diff --git a/zhengcaioa/zhengcaioa/Controllers/ProjectController.cs b/zhengcaioa/zhengcaioa/Controllers/ProjectController.cs index c004c31..7f7a075 100644 --- a/zhengcaioa/zhengcaioa/Controllers/ProjectController.cs +++ b/zhengcaioa/zhengcaioa/Controllers/ProjectController.cs @@ -385,6 +385,10 @@ ViewBag.Creater = _userService.GetList().Select(x => new { code = x.Id, label = x.UserName }).ToList(); ViewBag.flbx = _liaotianService.GetSYScode("system", "shifou").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList(); ViewBag.ShiFouyReasonname = _liaotianService.GetSYScode("Project", "ShiFouyReasonname").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList(); + + ViewBag.Baomingtimebegin = DateTime.Now.AddYears(-1).ToString("yyyy-MM-dd"); + ViewBag.Baomingtimeend = DateTime.Now.ToString("yyyy-MM-dd"); + return View(); } diff --git a/zhengcaioa/zhengcaioa/Views/CooperatecustomCustomer/Index.cshtml b/zhengcaioa/zhengcaioa/Views/CooperatecustomCustomer/Index.cshtml index 0a95e18..87534de 100644 --- a/zhengcaioa/zhengcaioa/Views/CooperatecustomCustomer/Index.cshtml +++ b/zhengcaioa/zhengcaioa/Views/CooperatecustomCustomer/Index.cshtml @@ -17,6 +17,9 @@ var shengDropDown = '@Html.Raw(Newtonsoft.Json.JsonConvert.SerializeObject(ViewBag.ShengDropDown))'; var shifou = '@Html.Raw(Newtonsoft.Json.JsonConvert.SerializeObject(ViewBag.shifou))'; + var Baomingtimebegin = '@Html.Raw(ViewBag.Baomingtimebegin)'; + var Baomingtimeend = '@Html.Raw(ViewBag.Baomingtimeend)'; + loseherght = 60; gridConfig = { multiselect: true, selectcol: "Id" }; dataCol = [ @@ -50,7 +53,7 @@ } }, ]; - dataUrl = "/CooperatecustomCustomer/GetList"+"@(string.IsNullOrEmpty(Creater)?"": "?Ywjl=" + Creater)"; + dataUrl = "/CooperatecustomCustomer/GetList?Createtime=" + Baomingtimebegin + "|" + Baomingtimeend +"@(string.IsNullOrEmpty(Creater)?"": "&Ywjl=" + Creater)"; searchCol = [ { label: '瀹㈡埛鏉ユ簮', name: 'Khly', labtype: 'combox', hidden: false, data: JSON.parse(khlys), cwidth: '5%', cccwidth: '8%' }, @@ -69,6 +72,19 @@ var _pageAdd = function () { OpenWindow("鏂板鍚堜綔瀹㈡埛", "98%", "100%", "/CooperatecustomCustomer/Edit/"); } + + var _pageSearch = function () { + $("#jqGrid").jqGrid('setGridParam', { + url: dataUrl = "/CooperatecustomCustomer/GetList"+"@(string.IsNullOrEmpty(Creater) ?"": "?Ywjl=" + Creater)", postData: jsons, page: 1 + }); //閲嶆柊杞藉叆 + var jsons = GetSearchEnd(); + if (jsons == false) { + msg.info("璇峰綍鍏ユ煡璇㈡潯浠�"); + return false; + } + LoadGrid(jsons); + } + var _pagePrint = function () { @@ -282,7 +298,17 @@ } - + }; + + $(function () { + + + + $("#PBSCreatetimeend").val(Baomingtimeend); + + $("#PBSCreatetimestart").val(Baomingtimebegin); + + }); </script> } diff --git a/zhengcaioa/zhengcaioa/Views/IntentionCustomer/Index.cshtml b/zhengcaioa/zhengcaioa/Views/IntentionCustomer/Index.cshtml index 70b8f99..960ce94 100644 --- a/zhengcaioa/zhengcaioa/Views/IntentionCustomer/Index.cshtml +++ b/zhengcaioa/zhengcaioa/Views/IntentionCustomer/Index.cshtml @@ -15,7 +15,11 @@ var users = '@Html.Raw(Newtonsoft.Json.JsonConvert.SerializeObject(ViewBag.users))'; var shengDropDown = '@Html.Raw(Newtonsoft.Json.JsonConvert.SerializeObject(ViewBag.ShengDropDown))'; var Creater = '@Html.Raw(Newtonsoft.Json.JsonConvert.SerializeObject(ViewBag.Creater))'; - var shifou = '@Html.Raw(Newtonsoft.Json.JsonConvert.SerializeObject(ViewBag.shifou))'; + var shifou = '@Html.Raw(Newtonsoft.Json.JsonConvert.SerializeObject(ViewBag.shifou))'; + + var Baomingtimebegin = '@Html.Raw(ViewBag.Baomingtimebegin)'; + var Baomingtimeend = '@Html.Raw(ViewBag.Baomingtimeend)'; + loseherght = 60; gridConfig = { multiselect: true, selectcol: "Id" }; dataCol = [ @@ -42,7 +46,7 @@ }, ]; - dataUrl = "/IntentionCustomer/GetList"+"@(string.IsNullOrEmpty(Creater11) ?"": "?Ywjl=" + Creater11)"; + dataUrl = "/IntentionCustomer/GetList?Createtime=" + Baomingtimebegin + "|" + Baomingtimeend +"@(string.IsNullOrEmpty(Creater11) ?"": "&Ywjl=" + Creater11)"; searchCol = [ { label: '瀹㈡埛鏉ユ簮', name: 'Khly', labtype: 'combox', hidden: false, data: JSON.parse(khlys), cwidth: '5%', cccwidth: '8%' }, { label: '琛屼笟鍒嗙被', name: 'Hyfl', labtype: 'combox', hidden: false, data: JSON.parse(hyfls), cwidth: '5%', cccwidth: '15%' }, @@ -62,6 +66,18 @@ ]; var _pageAdd = function () { OpenWindow("鏂板鎰忓悜瀹㈡埛", "98%", "100%", "/IntentionCustomer/Edit/"); + } + + var _pageSearch = function () { + $("#jqGrid").jqGrid('setGridParam', { + url: dataUrl = "/IntentionCustomer/GetList"+"@(string.IsNullOrEmpty(Creater11) ?"": "?Ywjl=" + Creater11)", postData: jsons, page: 1 + }); //閲嶆柊杞藉叆 + var jsons = GetSearchEnd(); + if (jsons == false) { + msg.info("璇峰綍鍏ユ煡璇㈡潯浠�"); + return false; + } + LoadGrid(jsons); } var _pagePrint = function () { @@ -364,7 +380,15 @@ sendCity(); + $(function () { + + $("#PBSCreatetimeend").val(Baomingtimeend); + + $("#PBSCreatetimestart").val(Baomingtimebegin); + + }); + </script> } diff --git a/zhengcaioa/zhengcaioa/Views/Project/Select.cshtml b/zhengcaioa/zhengcaioa/Views/Project/Select.cshtml index aff4513..48f9f0a 100644 --- a/zhengcaioa/zhengcaioa/Views/Project/Select.cshtml +++ b/zhengcaioa/zhengcaioa/Views/Project/Select.cshtml @@ -14,7 +14,8 @@ var Creater = '@Html.Raw(Newtonsoft.Json.JsonConvert.SerializeObject(ViewBag.Creater))'; var flbx = '@Html.Raw(Newtonsoft.Json.JsonConvert.SerializeObject(ViewBag.flbx))'; var ShiFouyReasonname = '@Html.Raw(Newtonsoft.Json.JsonConvert.SerializeObject(ViewBag.ShiFouyReasonname))'; - + var Baomingtimebegin = '@Html.Raw(ViewBag.Baomingtimebegin)'; + var Baomingtimeend = '@Html.Raw(ViewBag.Baomingtimeend)'; loseherght = 110; dataCol = [ @@ -94,7 +95,7 @@ { label: '搴熸爣娆℃暟', name: 'Feibiaocishu', labtype: 'txt', hidden: true }, { label: '涓爣閲戦', name: 'Zhongbiaojine', labtype: 'txt', hidden: true } ]; - dataUrl = "/Project/GetLiaotianList"+"@(string.IsNullOrEmpty(Creater11) ?"":"?Creater="+ Creater11)"; + dataUrl = "/Project/GetLiaotianList?StartTimestar=" + Baomingtimebegin + "|" + Baomingtimeend +"@(string.IsNullOrEmpty(Creater11) ?"":"&Creater="+ Creater11)"; searchCol = [ //{ label: '鍏憡鏃堕棿', name: 'StartTimestar', labtype: 'date', hidden: false }, //{ label: '--', name: 'StartTimeend', labtype: 'date', hidden: false, cwidth: '1%', cccwidth: '15%' }, @@ -129,6 +130,18 @@ ]; var _pageAdd = function () { OpenWindow("鏂板椤圭洰", "98%", "90%", "/Project/Add/"); + } + + var _pageSearch = function () { + $("#jqGrid").jqGrid('setGridParam', { + url: dataUrl = "/Project/GetLiaotianList"+"@(string.IsNullOrEmpty(Creater11) ?"":"?Creater="+ Creater11)", postData: jsons, page: 1 + }); //閲嶆柊杞藉叆 + var jsons = GetSearchEnd(); + if (jsons == false) { + msg.info("璇峰綍鍏ユ煡璇㈡潯浠�"); + return false; + } + LoadGrid(jsons); } var _afterSave = function (result) { @@ -259,6 +272,11 @@ $("#PBSCreater").parent().next().remove(); $("#PBSFenchadayu").parent().after("<br>"); + + $("#PBSStartTimestarend").val(Baomingtimeend); + + $("#PBSStartTimestarstart").val(Baomingtimebegin); + }); </script> -- Gitblit v1.9.1