-
刷新交易端流水
- @if (CurUser.结算管理_成交簿记流水新增)
- {
-
-
- }
-
- @*
*@
-
- @Html.MyAceDropdownInput("SearchClientId", "客户名称", ClientDataModel.GetAllOpenClient(),multiple:false,appendEmptyAll:false)
-
-
-
-
- @if (CurUser.结算管理_成交簿记流水重置)
+
+
+
+
+ 刷新交易端流水
+
+ @if (CurUser.结算管理_成交簿记流水新增)
{
-
- }
- @if (CurUser.结算管理_成交簿记流水簿记)
- {
-
+
+
}
+
+
+
+
+
+
+
+
FR007
+
+
+ %
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 日期
+
+ 客户名称
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ @if (CurUser.结算管理_成交簿记流水重置)
+ {
+
+ }
+ @if (CurUser.结算管理_成交簿记流水簿记)
+ {
+
+ }
+
- @*
-
*@
+
@Html.Raw(JqGridSimple.OutTable())
diff --git a/YLErpWeb/wwwroot/Scripts/app/swaptrade/SwapflowList.js b/YLErpWeb/wwwroot/Scripts/app/swaptrade/SwapflowList.js
index 339a1f60..3d51053f 100644
--- a/YLErpWeb/wwwroot/Scripts/app/swaptrade/SwapflowList.js
+++ b/YLErpWeb/wwwroot/Scripts/app/swaptrade/SwapflowList.js
@@ -2,6 +2,7 @@
const inputFormatTradePrice = Object.freeze({ precision: otcformat.trading.tradeSinglePrice.precision, negative: true, append: '' });
const inputFormatTradeAmount = Object.freeze({ precision: otcformat.trading.notional.precision, append: '' });
const inputFormatMarginRate = Object.freeze({ precision: otcformat.trading.marginRateP.precision, append: '%' });
+var clients = ylotc.clients;
const consUnderlyingFlag = (function () {
let unSelFlag = tradeHelper.UnderlyingSelectFlag;
return unSelFlag.UseForTrading | unSelFlag.IncludeMatured | unSelFlag.UsePinYinFilter | unSelFlag.IncludeBasket | unSelFlag.IncludeSynthetic | unSelFlag.CheckLaunch;
@@ -186,6 +187,9 @@ $(function () {
document.onkeydown = keyEnter;
let underlyingCtrl = new tradeHelper.UnderlyingSelectCtrl('#UnderlyingCode', { UseCodeAsId: true }).setFlag(tradeHelper.UnderlyingSelectFlag.OtcTrade);
+ let autoClientNumber_0 = FastVue.autocomplete(document.getElementById('SearchClientId'), {
+ nameField: 'Name', valueField: 'id', searchField: ['Number', 'Name'], lookup: clients
+ });
CombookingHub();
ResetHub();
});
@@ -868,7 +872,16 @@ var vue = new Vue({
step: 1,
tradeDate: "",
UnderlyingCode: "",
- ClientId:null
+ ClientId: null,
+ isAddOrEditFRData: false,
+ isShowWarning: true,
+ isFromArtifical: false,
+ FRData: {
+ oldValue: null,
+ value: "",
+ id: "",
+ date: ""
+ },
},
mounted: function () {
autoClient = FastVue.autocomplete(document.getElementById('ClientId'), {
@@ -881,12 +894,17 @@ var vue = new Vue({
this.initStep(this.step);
//intiGrid(this.step)
this.refreshTradeFlow(false);
+ this.FRData.date = this.getToday()
+ this.getFRData();
},
computed: {
maxTradeDate() {
var now = this.getCurrentDate();
return now;
},
+ frTips() {
+ return `${this.FRData.date}无FR007,请补充。`;
+ }
},
methods: {
initStep(index) {
@@ -903,6 +921,87 @@ var vue = new Vue({
intiGrid(thisObj.step)
});
},
+ getToday() {
+ const today = new Date();
+ const year = today.getFullYear();
+ const month = today.getMonth() + 1; // getMonth() 返回的月份是从 0 开始的
+ const day = today.getDate();
+
+ // 如果需要格式化为 YYYY-MM-DD 字符串
+ const formattedToday = `${year}-${month.toString().padStart(2, '0')}-${day.toString().padStart(2, '0')}`;
+ return formattedToday
+ },
+ getFRData() {
+ const thisObj = this;
+ main.post(`/swapTrade2/SearchTodayWhetherFRData?dateTime=${this.FRData.date}`).done(function (resp) {
+ if (resp.UnderlyingCode) { // 如果这天有fr007获取值和id,隐藏警告
+ thisObj.FRData.value = (resp.ReferencePrice * 100).toFixed(4);
+ thisObj.FRData.oldValue = (resp.ReferencePrice * 100).toFixed(4);
+ thisObj.FRData.id = resp.id;
+ thisObj.isShowWarning = false
+ thisObj.isFromArtifical = resp.DataSource === "人工"
+ } else {
+ thisObj.FRData.value = "";
+ thisObj.FRData.id = "";
+ thisObj.isShowWarning = true;
+ thisObj.isFromArtifical = true;// 如果没有fr007,fr007来源默认设置为人工,用于新增
+ }
+ });
+ },
+ editFRData() {
+ this.isAddOrEditFRData = true
+ this.isShowWarning = false
+ },
+ cancelEditFRData() {
+ this.FRData.value = "";
+ this.isAddOrEditFRData = false
+ const today = this.getToday();
+ if (this.FRData.date !== today) {
+ this.isShowWarning = true;
+ } else {
+ this.isShowWarning = false
+ }
+ },
+ commitFRData() {
+ if (this.FRData.value) {
+ const value = Number(this.FRData.value)
+ if (!Number.isNaN(value)) {
+ // 用字符串四舍五入
+ const price = main.toNumber(value / 100, 6);
+ // 新增时不传id
+ const url = this.FRData.date ? `/swapTrade2/AddOrUpdateFRData?dateTime=${this.FRData.date}&price=${price}` : `/swapTrade2/AddOrUpdateFRData?price=${price}`
+ const thisObj = this;
+ main.post(url).done(function (resp) {
+ if (resp) {
+ thisObj.isAddOrEditFRData = false
+ thisObj.getFRData()
+ }
+ });
+ }
+ } else if (this.isShowWarning) { // 当日无fr007不做改动
+ this.isAddOrEditFRData = false
+ this.getFRData()
+ } else if (this.FRData.id) { // 当日有fr007删除fr007
+ const thisObj = this;
+ main.post(`/swapTrade2/DeleteFRData?id=${thisObj.FRData.id}`).done(function (resp) {
+ if (resp) {
+ thisObj.isAddOrEditFRData = false
+ thisObj.getFRData()
+ }
+ });
+ } else {
+ this.isAddOrEditFRData = false
+ this.isShowWarning = true;
+ }
+ },
+ deleteFRData() {
+ if (this.FRData.id) {
+ this.FRData.value = this.FRData.oldValue
+ this.isAddOrEditFRData = false
+ } else {
+ this.cancelEditFRData()
+ }
+ },
setStep(st) {
this.step = st;
},