1. 使用填报自动计算功能 在填报属性中设置单元格自动计算逻辑: 设置第一行单元格值为10000 从第二行开始,使用公式计算剩余值

2. 具体实现步骤 设置初始值: 设置递减公式: 使用JS动态计算(可选): // 当值变化时自动计算剩余值 contentPane.on("cellselect", function(){ // 获取当前行号 var row = this.options.curLGP.getTDRow(this.curLGP.curTDCell); // 如果是第一行则跳过 if(row > 1) { // 获取上一行剩余值 var lastValue = this.getCellValue(0, row-1, 1); // 假设剩余值在第二列 // 计算当前行剩余值 var currentValue = lastValue - this.getCellValue(0, row, 0); this.setCellValue(0, row, 1, currentValue); // 设置当前行剩余值 } });
3. 注意事项
|