Browse Source

现金流表单填写的最后一个单元格数据保存不生效

xujunjie 1 year ago
parent
commit
25209c0b44
1 changed files with 7 additions and 0 deletions
  1. 7 0
      src/pages/PSRManage/detail.js

+ 7 - 0
src/pages/PSRManage/detail.js

@@ -531,6 +531,12 @@ const PSRDetail = () => {
   };
   //保存
   const handlerSave = () => {
+    // 手动触发单元格的完成编辑事件
+    const $ = iframeRef.current.contentWindow.$;
+    const e = $.Event("keydown")
+    e.keyCode = 13
+    $(".luckysheet-cell-input").trigger(e)
+
     const luckyData = luckysheetRef.current?.toJson();
     let allData;
     //如果是现金流的保存。需要计算一些数值填充到psr中;
@@ -657,6 +663,7 @@ const PSRDetail = () => {
           console.log(cell, sheet);
         },
         cellUpdated: () => {
+          console.log(123123123)
           luckysheetRef.current.refreshFormula();
         },
         workbookCreateAfter: async () => {