操作步骤与对应操作截图如下:
1.打开移动单据列表,单击列表中的一行状态为【创建】的数据,进入移动单据查看窗口。
2.点击顶部菜单【编辑】打开移动表单进入修改状态,修改一个文本字段,点击顶部菜单【提交】。
3.提交后自动关闭移动表单,并刷新父窗口,返回到移动单据查看窗口,此时会看到文本字段刷新了,数据状态字段没有刷新,实际此时是【审核中】状态。
4.继续返回到列表,可以看到文本字段与数据状态字段都能刷新。
为什么移动单据查看窗口中的数据状态字段不能刷新?下图是BOS中的字段属性
以下是提交操作的部分代码:
IOperationResult opResult = null;
opResult = DoSave2();
if (opResult.IsSuccess)
{
this.SourceObject = SourceBillView.Model.DataObject;
bool bSave = SourceBillView.InvokeFormOperation(FormOperationEnum.Submit);
opResult = getFormStatePlugIn.didDoOperationResult;
if (getFormStatePlugIn.didDoOperation != null
&& getFormStatePlugIn.didDoOperation.Operation == "Submit"
&& getFormStatePlugIn.didDoOperationResult.IsSuccess)
{
this.SourceObject = SourceBillView.Model.DataObject;
}
SourceBillView.Close();
this.ShowOperationResult(opResult, "提交成功!");
if (this.operationStatus == OperationStatus.EDIT)
{
base.View.ParentFormView.Refresh();
}
base.View.Close();
}
else
{
this.ShowOperationResult(opResult, "提交失败!");
}
...
...
//保存函数
private IOperationResult DoSave2()
{
var srcBusinessInfo = SourceBillMetadata.BusinessInfo;
var dynamicObject = this.SourceObject;
foreach (var kv in MobKey2SrcKey)
{
var mobKey = kv.Key;
var srcKey = kv.Value;
var mobField = this.View.BusinessInfo.GetField(mobKey);
var srcField = srcBusinessInfo.GetField(srcKey);
//请保证元数据mobField和srcField字段类型一致
if (mobField == null || srcField == null
|| !dynamicObject.DynamicObjectType.Properties.ContainsKey(srcField.PropertyName)) continue;
var mobValue = this.Model.GetValue(mobKey);
if (srcField is BaseDataField && mobValue is DynamicObject)
{
SourceBillView.Model.SetValue(srcKey, (mobValue as DynamicObject)["Id"]);
}
else
{
SourceBillView.Model.SetValue(srcKey, mobValue);
}
}
bool bSave = SourceBillView.InvokeFormOperation(FormOperationEnum.Save);
return getFormStatePlugIn.didDoOperationResult;
}
版本:6.1+PT105859
QQ:469126910
推荐阅读