- @if (ViewBag.IsNew != null && (bool)ViewBag.IsNew)
+ @if (isNew)
{
-
-
+
+
@@ -85,4 +90,4 @@
-
\ No newline at end of file
+
diff --git a/YLErpWeb/Views/EodPrice/eodFuturePriceEdit.cshtml b/YLErpWeb/Views/EodPrice/eodFuturePriceEdit.cshtml
index 9cddbc82..b4edeb1a 100644
--- a/YLErpWeb/Views/EodPrice/eodFuturePriceEdit.cshtml
+++ b/YLErpWeb/Views/EodPrice/eodFuturePriceEdit.cshtml
@@ -2,6 +2,7 @@
@{
ViewBag.Title = "日终商品期货价格 | 编辑";
Layout = "~/Views/Shared/_InfoLayout.cshtml";
+ bool isNew = ViewBag.IsNew != null && (bool)ViewBag.IsNew;
}
@section JS
{
@@ -16,17 +17,29 @@
return pass;
}
- function onFuturePicked() {
- var sel = document.getElementById('FuturePicker');
- var opt = sel.options[sel.selectedIndex];
- document.getElementById('UnderlyingId').value = opt.value;
- document.getElementById('UnderlyingCode').value = opt.getAttribute('data-code') || '';
- document.getElementById('MarketBox').value = opt.getAttribute('data-market') || '';
+ // 手工输入期货合约代码后失焦:校验标的存在且已上市,带出市场并回填 UnderlyingId(列表查询按此 join)
+ function lookupFuture() {
+ var el = document.getElementById('UnderlyingCode');
+ if (!el) return;
+ var code = (el.value || '').trim();
+ var mk = document.getElementById('MarketBox');
+ var idEl = document.getElementById('UnderlyingId');
+ if (!code) { if (mk) mk.value = ''; if (idEl) idEl.value = ''; return; }
+ main.post("/eodPrice/LookupUnderlyingForEod", { code: code, kind: 'future' }).done(function (res) {
+ el.value = res.obj.Code;
+ if (idEl) idEl.value = res.obj.Id;
+ if (mk) mk.value = res.obj.Market || '';
+ });
}
function saveeod_commodity_future_price() {
- if (document.getElementById('FuturePicker') && !document.getElementById('UnderlyingCode').value) {
- main.message('请先选择期货标的'); return false;
+ var el = document.getElementById('UnderlyingCode');
+ var idEl = document.getElementById('UnderlyingId');
+ if (el && !(el.value || '').trim()) {
+ main.message('请输入期货标的代码'); return false;
+ }
+ if (el && idEl && !idEl.value) {
+ main.message('标的未校验通过,请重新输入代码后失焦'); return false;
}
if (!checkSubmitData()) return false;
var data = $("#form1").serialize();
@@ -42,25 +55,26 @@
-
-
+ @if (isNew)
+ {
+
+ }
+ else
+ {
+
+
+ }
日终商品期货价格修改
- @if (ViewBag.IsNew != null && (bool)ViewBag.IsNew)
+ @if (isNew)
{
-
-
+
+
@@ -88,4 +102,4 @@
-
\ No newline at end of file
+
diff --git a/YLErpWeb/Views/EodPrice/eodPriceAdd.cshtml b/YLErpWeb/Views/EodPrice/eodPriceAdd.cshtml
deleted file mode 100644
index bc216e25..00000000
--- a/YLErpWeb/Views/EodPrice/eodPriceAdd.cshtml
+++ /dev/null
@@ -1,268 +0,0 @@
-@{
- ViewBag.Title = "日终价格新增";
- Layout = "~/Views/Shared/_InfoLayout.cshtml";
-}
-@section CSS
-{
-
-}
-@section JS
-{
-
-}
-
-
diff --git a/YLErpWeb/Views/EodPrice/eodStockPriceEdit.cshtml b/YLErpWeb/Views/EodPrice/eodStockPriceEdit.cshtml
index ad7fb36f..08d58bc0 100644
--- a/YLErpWeb/Views/EodPrice/eodStockPriceEdit.cshtml
+++ b/YLErpWeb/Views/EodPrice/eodStockPriceEdit.cshtml
@@ -2,11 +2,11 @@
@{
ViewBag.Title = "日终股票价格 | 编辑";
Layout = "~/Views/Shared/_InfoLayout.cshtml";
+ bool isNew = ViewBag.IsNew != null && (bool)ViewBag.IsNew;
}
@section JS
{