浏览代码

表达式只读时,不允许提交数据

MaiXinRong 5 年之前
父节点
当前提交
16b501d02e
共有 4 个文件被更改,包括 14 次插入0 次删除
  1. 4 0
      app/public/js/ledger.js
  2. 4 0
      app/public/js/revise.js
  3. 4 0
      app/public/js/stage.js
  4. 2 0
      app/public/js/stage_pay.js

+ 4 - 0
app/public/js/ledger.js

@@ -835,6 +835,8 @@ $(document).ready(function() {
         });
 
         $('#bills-expr').bind('change mouseleave', function () {
+            if (this.readOnly) return;
+
             const expr = $(this);
             const sheet = ledgerSpread.getActiveSheet();
             const select = SpreadJsObj.getSelectObject(sheet);
@@ -1328,6 +1330,8 @@ $(document).ready(function() {
     posSpread.bind(spreadNS.Events.SelectionChanged, posOperationObj.selectionChanged)
     if (!posSpreadSetting.readOnly) {
         $('#pos-expr').bind('change mouseleave', function () {
+            if (this.readOnly) return;
+
             const expr = $(this);
             const posSheet = posSpread.getActiveSheet();
             const select = SpreadJsObj.getSelectObject(posSheet);

+ 4 - 0
app/public/js/revise.js

@@ -561,6 +561,8 @@ $(document).ready(() => {
         });
 
         $('#bills-expr').bind('change mouseleave', function () {
+            if (this.readOnly) return;
+
             const expr = $(this);
             const select = SpreadJsObj.getSelectObject(billsSheet);
             const field = expr.attr('field'), orgValue = expr.attr('org'), newValue = expr.val();
@@ -939,6 +941,8 @@ $(document).ready(() => {
     posSpread.bind(spreadNS.Events.SelectionChanged, posSpreadObj.selectionChanged);
     if (!readOnly) {
         $('#pos-expr').bind('change mouseleave', function () {
+            if (this.readOnly) return;
+
             const expr = $(this);
             const select = SpreadJsObj.getSelectObject(posSheet);
             const field = expr.attr('field'), orgValue = expr.attr('org'), newValue = expr.val();

+ 4 - 0
app/public/js/stage.js

@@ -929,6 +929,8 @@ $(document).ready(() => {
     });
     if (!readOnly) {
         $('#bills-expr').bind('change mouseleave', function () {
+            if (this.readOnly) return;
+
             const expr = $(this);
             const sheet = slSpread.getActiveSheet();
             const select = SpreadJsObj.getSelectObject(sheet);
@@ -1308,6 +1310,8 @@ $(document).ready(() => {
     SpreadJsObj.addDeleteBind(spSpread, stagePosSpreadObj.deletePress);
     if (!readOnly) {
         $('#pos-expr').bind('change mouseleave', function () {
+            if (this.readOnly) return;
+
             const expr = $(this);
             const posSheet = spSpread.getActiveSheet();
             const select = SpreadJsObj.getSelectObject(posSheet);

+ 2 - 0
app/public/js/stage_pay.js

@@ -831,6 +831,8 @@ $(document).ready(() => {
         $('#up-move').click(paySpreadObj.upMove);
         $('#down-move').click(paySpreadObj.downMove);
         $('#expr').bind('change mouseleave', function () {
+            if (this.readOnly) return;
+
             const expr = $(this);
             const select = SpreadJsObj.getSelectObject(paySpread.getActiveSheet());
             const field = expr.attr('field'), orgValue = expr.attr('org'), newValue = expr.val();