Quintiq file version 2.0
#parent: Panel700/btn_Cancel_FCOS
Response OnClick () id:Response_Panel700_btn_Cancel_FCOS_OnClick
{
  #keys: '[414724.0.294294721]'
  CanBindMultiple: false
  DefinitionID: 'Responsedef_WebButton_OnClick'
  QuillAction
  {
    Body:
    [*
      // 操作恢复：删除新增的拆分操作，还原删除的拆分操作
      OrderInfo:=dh_Paramer_FCOS.Data();
      if( not isnull( OrderInfo))
      {
        SOrder:=null( S_DT_CustomOrder,constcontent );
        // 得到所有拆分操作记录
        traverse( MacroPlan,S_DT_SpliteStruct,obj,obj.ID_S_DT_CustomOrder() = OrderInfo.ID())
        {
          SOrder:=select( MacroPlan,S_DT_CustomOrder,objSO,objSO.ID_SpliteStruct() = obj.ID());
          // 无对应的拆分订单，视为新增的操作，进行移除
          if( isnull( SOrder))
          {
              obj.Delete();
          }
          else
          {
            // 如果状态为删除状态，则恢复删除
            if( obj.Status()=0)
            {
              obj.Status(1);
            }
          }
        }  
      }
      
      FrmCustomOrderSpliteRow.Close();
    *]
    GroupServerCalls: false
  }
}
