当单元格被修改后另一单元格显示修改时间

如图,如何实现当定编人数修改时,定编人数更新时间自动更新image.png

FineReport yzmPFJ2C0870528 发布于 2022-8-3 17:24
1min目标场景问卷 立即参与
回答问题
悬赏:3 F币 + 添加悬赏
提示:增加悬赏、完善问题、追问等操作,可使您的问题被置顶,并向所有关注者发送通知
共2回答
最佳回答
0
snrtuemcLv8专家互助
发布于2022-8-3 17:27

在前面单元格,编辑结束事件,写js

Date.prototype.Format = function (fmt) { // author: meizz

  var o = {

    "M+": this.getMonth() + 1, // 月份

    "d+": this.getDate(), // 日

    "h+": this.getHours(), // 小时

    "m+": this.getMinutes(), // 分

    "s+": this.getSeconds(), // 秒

    "q+": Math.floor((this.getMonth() + 3) / 3), // 季度

    "S": this.getMilliseconds() // 毫秒

  };

  if (/(y+)/.test(fmt))

    fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));

  for (var k in o)

    if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));

      return fmt;

}

var a = this.getValue();

var location = this.options.location; //获取当前控件的位置

var cr = FR.cellStr2ColumnRow(location);

var col = cr.col; //列号

var ro = cr.row; //行号

if (a == '1') {

//var myDate = new Date();

var b=new Date().Format("yyyy-MM-dd hh:mm:ss");

   // 获取日期与时间

contentPane.setCellValue(0, col+2, ro, b);

}

最佳回答
0
CD20160914Lv8专家互助
发布于2022-8-3 17:26(编辑于 2022-8-3 17:27)

这个用填报属性中设置这样吧。然后把更新时间写在填报属性的公式中

image.png

  • 3关注人数
  • 186浏览人数
  • 最后回答于:2022-8-3 17:27
    请选择关闭问题的原因
    确定 取消
    返回顶部