以收料通知单为例
1、打开BOS,
添加打印时间和一个长日期字段
2、录入表单插件,打印后取当前时间再往前调2个小时
#引入clr运行库
# -*- coding: utf-8 -*-
import clr
#添加对cloud插件开发的常用组件的引用
clr.AddReference('System')
clr.AddReference('System.Data')
clr.AddReference('Kingdee.BOS')
clr.AddReference('Kingdee.BOS.Core')
clr.AddReference('Kingdee.BOS.App')
clr.AddReference('Kingdee.BOS.ServiceHelper')
#clr.AddReference('Kingdee.BOS.KDSReportEntity')
#clr.AddReference('Kingdee.BOS.App.KDSService')
clr.AddReference('Newtonsoft.Json')
#导入cloud基础库中的常用实体对象(分命名空间导入,不会递归导入)
from Kingdee.BOS import *
from Kingdee.BOS.Core import *
from Kingdee.BOS.Core.Bill import *
from Kingdee.BOS.Core.DynamicForm.PlugIn import *
from Kingdee.BOS.Core.DynamicForm.PlugIn.ControlModel import *
from System import *
from System.Data import *
from Kingdee.BOS.App.Data import *
from System.Collections.Generic import List
from Kingdee.BOS.ServiceHelper import *
from Kingdee.BOS.JSON import *
from Newtonsoft.Json.Linq import *
def OnAfterPrint(e):
if e.NoteIDPairs is None:
return
if e.NoteIDPairs.Count > 0:
#this.View.ShowMessage("Print")
this.Model.SetValue("F_UAGW_Datetime",DateTime.Now.AddHours(-2))
this.View.UpdateView("F_UAGW_Datetime")
this.View.Model.Save();
this.View.Refresh();
打印时间.zip(0.77KB)
推荐阅读