<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<activity id="__XAfay2QMYRkxelWtO0J">
  <name>保存</name>
  <parentId>__TguP7KZtUDBVC1gHr6k</parentId>
  <applicationid>__LgZds5MVHW3o08T7UcX</applicationid>
  <type>13</type>
  <onActionFlow></onActionFlow>
  <onActionPrint></onActionPrint>
  <colorType>default</colorType>
  <beforeActionScript><![CDATA[//判断表单某字段不能为空
#include "sysfunction";
(function(){
  var attention = getItemValueAsString("attention"); 
  var isComputerExam= getItemValueAsString("isComputerExam"); 
  var isStamina= getItemValueAsString("isStamina"); 
  var examStandard = getItemValueAsString("examStandard"); 
  var writtenPassScore = getItemValueAsString("writtenPassScore"); 
  var operatePassScore = getItemValueAsString("operatePassScore"); 
  if(!"00".equals(examStandard)){
    println("examStandard------------"+examStandard)
    if(examStandard > 100){
      return "成绩合格分数不得大于100！"
    }
  }
  if(!"00".equals(writtenPassScore)){
    println("writtenPassScore------------"+writtenPassScore)
    if(writtenPassScore > 100){
      return "理论考试合格分数不得大于100！"
    }
  }
  if(!"00".equals(operatePassScore)){
    println("operatePassScore------------"+operatePassScore)
    if(operatePassScore > 100){
      return "﻿实操考试合格分数不得大于100！"
    }
  }
  if("0".equals(isComputerExam) && "0".equals(isStamina)){
    return "是否理论考试和是否实操考试不能均为否！！！"
  }
  var examRules= getItemValueAsString("examRules"); 

  var theoreticalAddress = getItemValueAsString("theoreticalAddress"); 
  var computerStartDate= getItemValueAsDate("computerStartDate"); 
  var computerEndDate= getItemValueAsDate("computerEndDate"); 
  var staminaAddress = getItemValueAsString("staminaAddress"); 
  var staminaStartDate= getItemValueAsDate("staminaStartDate"); 
  var staminaEndDate= getItemValueAsDate("staminaEndDate"); 
  var writtenRatio = getItemValueAsInt("writtenRatio"); 
  var operateRatio= getItemValueAsInt("operateRatio"); 
  var examStandard= getItemValueAsInt("examStandard"); 
  var writtenPassScore = getItemValueAsInt("writtenPassScore"); 
  var operatePassScore= getItemValueAsInt("operatePassScore"); 


  if(!isNotNull(attention)){return "注意事项必须填写!";}
  if("1".equals(isComputerExam) && "0".equals(isStamina) ){
    if(!isNotNull(theoreticalAddress)){return "理论考试地址必须填写!";}
    if(!isNotNull(computerStartDate)){return "理论考试开始时间必须填写!";}
    if(!isNotNull(computerEndDate)){return "理论考试结束时间必须填写!";}
    if(examStandard == 0){return "成绩合格分数必须填写!";}
  }else if("0".equals(isComputerExam) && "1".equals(isStamina) ){
    return "理论成绩必须填写"
    if(!isNotNull(staminaAddress)){return "体能考试地址必须填写!";}
    if(!isNotNull(staminaStartDate)){return "体能考试开始时间必须填写!";}
    if(!isNotNull(staminaEndDate)){return "体能考试结束时间必须填写!";}
  }else if("1".equals(isComputerExam) && "1".equals(isStamina)){
    if(!isNotNull(theoreticalAddress)){return "理论考试地址必须填写!";}
    if(!isNotNull(computerStartDate)){return "理论考试开始时间必须填写!";}
    if(!isNotNull(computerEndDate)){return "理论考试结束时间必须填写!";}
    if(!isNotNull(staminaAddress)){return "体能考试地址必须填写!";}
    if(!isNotNull(staminaStartDate)){return "体能考试开始时间必须填写!";}
    if(!isNotNull(staminaEndDate)){return "体能考试结束时间必须填写!";}
    if(!isNotNull(examRules)){return "成绩考核规则必须填写!";}
   if(format(staminaStartDate,"yyyy-MM-dd HH:mm:ss") <= format(computerEndDate,"yyyy-MM-dd HH:mm:ss") && format(staminaEndDate,"yyyy-MM-dd HH:mm:ss")>=format(computerStartDate,"yyyy-MM-dd HH:mm:ss")){
    return "理论与实操考试时间存在冲突"
    }
    if("0".equals(examRules)){
      if(writtenRatio == 0){return "理论考试占比必须填写!";}
      if(operateRatio == 0){return "体能考试占比必须填写!";}
      if(examStandard == 0){return "成绩合格分数必须填写!";}
    }else{
      if(writtenPassScore == 0){return "理论考试合格分数必须填写!";}
      if(operatePassScore == 0){return "体能考试合格分数必须填写!";}
    }
  }

  /*校验考场时间无法重叠
 var placeId= getItemValueAsInt("placeId"); 
 println("dddd") 

var sqlo="select * from tlk_system_exam_info where  item_placeId ='"+placeId+"'"
  */

})()]]></beforeActionScript>
  <afterActionScript><![CDATA[]]></afterActionScript>
  <retractBeforeActionScript><![CDATA[]]></retractBeforeActionScript>
  <retractAfterActionScript><![CDATA[]]></retractAfterActionScript>
  <hiddenScript><![CDATA[true]]></hiddenScript>
  <readonlyScript><![CDATA[]]></readonlyScript>
  <startFlowScript><![CDATA[]]></startFlowScript>
  <editMode>0</editMode>
  <fileNameScript><![CDATA[]]></fileNameScript>
  <iconurl></iconurl>
  <orderno>2</orderno>
  <stateToShow></stateToShow>
  <parentForm>__TguP7KZtUDBVC1gHr6k</parentForm>
  <jumpType>0</jumpType>
  <expSub>false</expSub>
  <icon></icon>
  <disableFlowNode>false</disableFlowNode>
  <changeFlowOperator>false</changeFlowOperator>
  <changeFlowCc>false</changeFlowCc>
  <multiLanguageLabel></multiLanguageLabel>
  <dispatcherMode>0</dispatcherMode>
  <dispatcherUrl><![CDATA[]]></dispatcherUrl>
  <dispatcherParams><![CDATA[[{"paramKey":"","paramValue":""}]]]></dispatcherParams>
  <jumpMode>0</jumpMode>
  <jumpActOpenType>0</jumpActOpenType>
  <withOld>false</withOld>
  <actionType>2</actionType>
  <actionDispatcherUrlScript><![CDATA[]]></actionDispatcherUrlScript>
  <actionSelection>0</actionSelection>
  <relatedFormId></relatedFormId>
  <actionScript><![CDATA[]]></actionScript>
  <workFlowType>0</workFlowType>
  <contextMenu>false</contextMenu>
  <showInToolbar>true</showInToolbar>
  <transpond></transpond>
  <targetList>|</targetList>
  <label><![CDATA[]]></label>
</activity>