请问如何根据某单元格为“完成”时,记录提交的时间

反馈查询看板(仓库).zip

image.png

这是我之前的方法,但是会导致每次提交时,所有的之前完成的提交时间全部刷新为一样的now()了,求问有什么办法可以记录每次的时间

image.png

FineReport 不辛苦命苦 发布于 2023-11-1 15:51 (编辑于 2023-11-2 11:41)
1min目标场景问卷 立即参与
回答问题
悬赏:3 F币 + 添加悬赏
提示:增加悬赏、完善问题、追问等操作,可使您的问题被置顶,并向所有关注者发送通知
共2回答
最佳回答
0
Z4u3z1Lv6专家互助
发布于2023-11-1 15:52
最佳回答
0
snrtuemcLv8专家互助
发布于2023-11-1 15:53

你这个需要写js实现

你写下拉框编辑后事件,用下面的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 == '已完成') {

//var myDate = new Date();

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

   // 获取日期与时间

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

}

  • 1关注人数
  • 206浏览人数
  • 最后回答于:2023-11-2 11:41
    请选择关闭问题的原因
    确定 取消
    返回顶部