<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<activity id="__P6x6qzINtGEJCmi8LxI">
  <name>修改信息</name>
  <parentId>__EXJ1Ihn29NvlF2ZIJov</parentId>
  <applicationid>__LgZds5MVHW3o08T7UcX</applicationid>
  <type>13</type>
  <onActionFlow></onActionFlow>
  <onActionPrint></onActionPrint>
  <colorType>default</colorType>
  <beforeActionScript><![CDATA[]]></beforeActionScript>
  <afterActionScript><![CDATA[]]></afterActionScript>
  <retractBeforeActionScript><![CDATA[]]></retractBeforeActionScript>
  <retractAfterActionScript><![CDATA[]]></retractAfterActionScript>
  <hiddenScript><![CDATA[(function(){
var materialApproveStatus = getItemValueAsString("materialApproveStatus"); 
if("审核通过".equals(materialApproveStatus)) {
    return true;
}else{
	return false
}
})()]]></hiddenScript>
  <readonlyScript><![CDATA[/*(function(){
var materialApproveStatus = getItemValueAsString("materialApproveStatus"); 
var applyStatus=getItemValueAsString("applyStatus");
if("0".equals(materialApproveStatus)&&(applyStatus=='0')) {
    return false;
}else{
	return true
}
})()*/]]></readonlyScript>
  <startFlowScript><![CDATA[							]]></startFlowScript>
  <editMode>0</editMode>
  <fileNameScript><![CDATA[]]></fileNameScript>
  <iconurl></iconurl>
  <orderno>1</orderno>
  <stateToShow></stateToShow>
  <parentForm>__EXJ1Ihn29NvlF2ZIJov</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>1</actionType>
  <actionDispatcherUrlScript><![CDATA[]]></actionDispatcherUrlScript>
  <actionSelection>0</actionSelection>
  <relatedFormId>选择</relatedFormId>
  <actionScript><![CDATA[#include "optsLib";
#include "applyUpdateField";
#include "applyUpdateFile";
(function(){ 
var doc=getCurrentDocument();
var newAvatar = getItemValueAsString("avatar");
var newSecurityYear = getItemValueAsString("securityYear");
var newIdcardAddress = getItemValueAsString("idcardAddress");
var newSecurityType = getItemValueAsString("securityType");
var newAddress = getItemValueAsString("address");
var newResidentPlaceType = getItemValueAsString("residentPlaceType");
var newResidentType = getItemValueAsString("residentType");
var newIdCardNoFrontUrl = getItemValueAsString("idCardNoFrontUrl");
var newIdCardNoBackUrl = getItemValueAsString("idCardNoBackUrl");
var newSecurityCertificate = getItemValueAsString("securityCertificate");
var newContractName = getItemValueAsString("contractName");
var newContractId = getItemValueAsString("contractId");
var newSecondPartyName = getItemValueAsString("secondPartyName");
var newEffectStartDate = getItemValueAsString("effectStartDate");
var newEffectEndDate = getItemValueAsString("effectEndDate");
var newContractFile = getItemValueAsString("contractFile");
  var applyId = getId();
var applyInfoDoc=findDocument(applyId);
var oldAvatar = applyInfoDoc.findItem("avatar").getValue();
applyInfoDoc.findItem("avatar").setValue(newAvatar);
var oldSecurityYear = applyInfoDoc.findItem("securityYear").getValue();
applyInfoDoc.findItem("securityYear").setValue(newSecurityYear);
var oldIdcardAddress = applyInfoDoc.findItem("idcardAddress").getValue();
applyInfoDoc.findItem("idcardAddress").setValue(newIdcardAddress);
var oldAddress = applyInfoDoc.findItem("address").getValue();
applyInfoDoc.findItem("securityType").setValue(newSecurityType);
var oldSecurityType = applyInfoDoc.findItem("securityType").getValue();
applyInfoDoc.findItem("address").setValue(newAddress);
var oldResidentPlaceType = applyInfoDoc.findItem("residentPlaceType").getValue();
applyInfoDoc.findItem("residentPlaceType").setValue(newResidentPlaceType);
var oldResidentType = applyInfoDoc.findItem("residentType").getValue();
applyInfoDoc.findItem("residentType").setValue(newResidentType);
var oldIdCardNoFrontUrl = applyInfoDoc.findItem("idCardNoFrontUrl").getValue();
applyInfoDoc.findItem("idCardNoFrontUrl").setValue(newIdCardNoFrontUrl);
var oldIdCardNoBackUrl = applyInfoDoc.findItem("idCardNoBackUrl").getValue();
applyInfoDoc.findItem("securityCertificate").setValue(newSecurityCertificate);
var oldSecurityCertificate = applyInfoDoc.findItem("securityCertificate").getValue();
applyInfoDoc.findItem("securityCertificate").setValue(newSecurityCertificate);
var oldContractName = applyInfoDoc.findItem("contractName").getValue();
applyInfoDoc.findItem("contractName").setValue(newContractName);
var oldContractId = applyInfoDoc.findItem("contractId").getValue();
applyInfoDoc.findItem("contractId").setValue(newContractId);
var oldSecondPartyName = applyInfoDoc.findItem("secondPartyName").getValue();
applyInfoDoc.findItem("secondPartyName").setValue(newSecondPartyName);
var oldEffectStartDate = applyInfoDoc.findItem("effectStartDate").getValue();
applyInfoDoc.findItem("effectStartDate").setValue(newEffectStartDate);
var oldEffectEndDate = applyInfoDoc.findItem("effectEndDate").getValue();
applyInfoDoc.findItem("effectEndDate").setValue(newEffectEndDate);
var oldContractFile = applyInfoDoc.findItem("contractFile").getValue();
applyInfoDoc.findItem("contractFile").setValue(newContractFile);
var process = getDocumentProcess();
process.doUpdate(applyInfoDoc); 

//将工作年限数据类型转换成字符串
  newSecurityYear=newSecurityYear+"";
  oldSecurityYear=oldSecurityYear+"";
   println("newSecurityYear"+newSecurityYear)
   println("oldSecurityYear"+oldSecurityYear)
   //println("newSecurityYear222"+newSecurityYear.substring(0,newSecurityYear.indexOf(".")))
   //println("oldSecurityYear222"+oldSecurityYear.substring(0,oldSecurityYear.indexOf(".")))
   println("newSecurityYear222"+splitText(newSecurityYear,".")[0])
   println("oldSecurityYear222"+splitText(oldSecurityYear,".")[0])
  
var viewId="__Qi47Zh0slmdQ3ZcgP60";
applyUpdateField(viewId,"户籍所在地",applyId,echoResidentPlaceType(newResidentPlaceType),echoResidentPlaceType(oldResidentPlaceType));
applyUpdateField(viewId,"人员类型",applyId,echoSecurityType(newSecurityType),echoSecurityType(oldSecurityType));
applyUpdateField(viewId,"户籍类型",applyId,echoHouseholdType(newResidentType),echoHouseholdType(oldResidentType));
applyUpdateField(viewId,"合同名称",applyId,newContractName,oldContractName);
applyUpdateField(viewId,"从事保安员工作年限",applyId,splitText(newSecurityYear,".")[0],splitText(oldSecurityYear,".")[0]);
applyUpdateField(viewId,"身份证/户籍地址",applyId,newIdcardAddress,oldIdcardAddress);
applyUpdateField(viewId,"现住地址",applyId,newAddress,oldAddress);
applyUpdateField(viewId,"乙方名称",applyId,newSecondPartyName,oldSecondPartyName);
applyUpdateField(viewId,"合同有效期",applyId,newEffectStartDate + "~" + newEffectEndDate,oldEffectStartDate + "~" + oldEffectEndDate);
applyUpdateFile(viewId,"两寸蓝底免冠彩照",applyId,newAvatar,oldAvatar);
applyUpdateFile(viewId,"证书图片",applyId,newSecurityCertificate,oldSecurityCertificate);
applyUpdateFile(viewId,"合同文件",applyId,newContractFile,oldContractFile);
applyUpdateFile(viewId,"身份证人面像",applyId,newIdCardNoFrontUrl,oldIdCardNoFrontUrl);
applyUpdateFile(viewId,"身份证国徽面",applyId,newIdCardNoBackUrl,oldIdCardNoBackUrl);



})()]]></actionScript>
  <workFlowType>0</workFlowType>
  <contextMenu>false</contextMenu>
  <showInToolbar>true</showInToolbar>
  <transpond>选择</transpond>
  <targetList>ism1EiHqAkpLpSd2Zr7|</targetList>
  <label><![CDATA[]]></label>
</activity>