diff --git a/AMESCoreStudio.Web/Controllers/BASController.cs b/AMESCoreStudio.Web/Controllers/BASController.cs index b2ff62c5..5f7d9ce0 100644 --- a/AMESCoreStudio.Web/Controllers/BASController.cs +++ b/AMESCoreStudio.Web/Controllers/BASController.cs @@ -121,7 +121,7 @@ namespace AMESCoreStudio.Web.Controllers var result = await _basApi.GetFlowRules(); var FlowRuleItems = new List(); - FlowRuleItems.Add(new SelectListItem("N/A", "0")); + FlowRuleItems.Add(new SelectListItem("全部", "0")); for (int i = 0; i < result.Count; i++) { FlowRuleItems.Add(new SelectListItem(result[i].UnitNo + result[i].FlowRuleName, result[i].FlowRuleID.ToString())); @@ -165,6 +165,22 @@ namespace AMESCoreStudio.Web.Controllers ViewBag.NextStationList = NextStationItems; } + [HttpPost] + public async Task GetFlowRuleJson(string unit_no) + { + var result = await _basApi.GetFlowRulesByUnit(unit_no); + + var item = new List(); + item.Add(new SelectListItem("全部", "0")); + + for (int i = 0; i < result.Count; i++) + { + item.Add(new SelectListItem(result[i].FlowRuleName, result[i].FlowRuleID.ToString())); + } + //将数据Json化并传到前台视图 + return Json(new { data = item }); + } + #endregion #region BAS001工廠资料维护相关 @@ -1017,6 +1033,7 @@ namespace AMESCoreStudio.Web.Controllers public async Task BAS010() { + await GetFactoryUnitList(); await GetFlowRuleList(); return View(); @@ -1136,13 +1153,15 @@ namespace AMESCoreStudio.Web.Controllers [ResponseCache(Duration = 0)] [HttpGet] - public async Task GetRuleStationsByFlowAsync(int id) + public async Task GetRuleStationsByFlowAsync(int flowId, int page = 1, int limit = 10) { - var result = await _basApi.GetRuleStationsByFlow(id); + var result_total = await _basApi.GetRuleStationsByFlow(flowId, 0, limit); + + var result = await _basApi.GetRuleStationsByFlow(flowId, page, limit); if (result.Count > 0) { - return Json(new Table() { code = 0, msg = "", data = result, count = result.Count }); + return Json(new Table() { code = 0, msg = "", data = result, count = result_total.Count }); } return Json(new Table() { count = 0, data = null }); diff --git a/AMESCoreStudio.Web/HttpApis/IBAS.cs b/AMESCoreStudio.Web/HttpApis/IBAS.cs index d2d2cccd..a1e51758 100644 --- a/AMESCoreStudio.Web/HttpApis/IBAS.cs +++ b/AMESCoreStudio.Web/HttpApis/IBAS.cs @@ -395,7 +395,7 @@ namespace AMESCoreStudio.Web /// /// [WebApiClient.Attributes.HttpGet("api/RuleStations/Flow/{id}")] - ITask> GetRuleStationsByFlow(int id); + ITask> GetRuleStationsByFlow(int id, int page = 1, int limit = 10); #endregion diff --git a/AMESCoreStudio.Web/Views/BAS/BAS010.cshtml b/AMESCoreStudio.Web/Views/BAS/BAS010.cshtml index f3ad9df9..e91cd074 100644 --- a/AMESCoreStudio.Web/Views/BAS/BAS010.cshtml +++ b/AMESCoreStudio.Web/Views/BAS/BAS010.cshtml @@ -33,6 +33,12 @@
+ +
+ +
+