<?xml version="1.0" encoding="UTF-8"?> 
 | 
<WebLink xmlns="http://soap.sforce.com/2006/04/metadata"> 
 | 
    <fullName>OSH_Submit</fullName> 
 | 
    <availability>online</availability> 
 | 
    <description>OSH提出用 
 | 
2019-08-15 前代码: 
 | 
{!RequireScript("/soap/ajax/30.0/connection.js")} 
 | 
{!RequireScript("/soap/ajax/30.0/apex.js")} 
 | 
{!RequireScript("/resource/CommonUtilJs")} 
 | 
  
 | 
var foo = function () { 
 | 
    if ('{!QIS_Report__c.QIS_Status__c}' == 'OSH检测申请' || '{!QIS_Report__c.QIS_Status__c}' == '完毕') { 
 | 
        alert('需要先点击[OSH检查受理]'); 
 | 
        return; 
 | 
    } 
 | 
    if ('{!QIS_Report__c.QIS_Status__c}' != 'OSH检测中') { 
 | 
        alert('已经提交审批'); 
 | 
        return; 
 | 
    } 
 | 
    if (!confirm("一旦提交此记录以待批准,根据您的设置您可能不再能够编辑此记录或将他从批准过程中调回。是否继续?")) { 
 | 
        return; 
 | 
    } 
 | 
    if ("{!QIS_Report__c.OSH_staff__c}" == "" 
 | 
         || "{!QIS_Report__c.OSH_staff_email__c}" == "") { 
 | 
        alert("OSH担当必须填写"); 
 | 
        return; 
 | 
    } 
 | 
    var qis = new sforce.SObject("QIS_Report__c"); 
 | 
    qis.Id = "{!QIS_Report__c.Id}"; 
 | 
    qis.QIS_Status__c = "OSH填写完毕"; 
 | 
    var result = sforce.connection.update([qis]); 
 | 
    var messages = getConnectDMLErrorMessages(result); 
 | 
    if (messages.length > 0) { 
 | 
        alert(messages.join("\n")); 
 | 
        return; 
 | 
    } 
 | 
  
 | 
    window.location.reload(); 
 | 
} 
 | 
foo();</description> 
 | 
    <displayType>button</displayType> 
 | 
    <linkType>javascript</linkType> 
 | 
    <masterLabel>提交待审批1</masterLabel> 
 | 
    <openType>onClickJavaScript</openType> 
 | 
    <protected>false</protected> 
 | 
    <url>{!RequireScript("/soap/ajax/51.0/connection.js")} 
 | 
{!RequireScript("/soap/ajax/51.0/apex.js")} 
 | 
{!RequireScript("/resource/CommonUtilJs")} 
 | 
//2021-10-21 gwy 版本更改为51.0 
 | 
var foo = function () { 
 | 
    if ('{!QIS_Report__c.QIS_Status__c}' == 'OSH检测申请' || '{!QIS_Report__c.QIS_Status__c}' == '完毕') { 
 | 
        alert('需要先点击[OSH检查受理]'); 
 | 
        return; 
 | 
    } 
 | 
    if ('{!QIS_Report__c.QIS_Status__c}' != 'OSH检测中') { 
 | 
        alert('已经提交审批'); 
 | 
        return; 
 | 
    } 
 | 
    if (!confirm("一旦提交此记录以待批准,根据您的设置您可能不再能够编辑此记录或将他从批准过程中调回。是否继续?")) { 
 | 
        return; 
 | 
    } 
 | 
    if ("{!QIS_Report__c.OSH_staff__c}" == "" 
 | 
         || "{!QIS_Report__c.OSH_staff_email__c}" == "") { 
 | 
        alert("OSH担当必须填写"); 
 | 
        return; 
 | 
    } 
 | 
    sforce.connection.sessionId = "{!$Api.Session_ID}"; 
 | 
    var qis = new sforce.SObject("QIS_Report__c"); 
 | 
    qis.Id = "{!QIS_Report__c.Id}"; 
 | 
    qis.QIS_Status__c = "OSH填写完毕"; 
 | 
    try { 
 | 
        var result = sforce.connection.update([qis]); 
 | 
        var messages = getConnectDMLErrorMessages(result); 
 | 
        if (messages.length > 0) { 
 | 
            alert(messages.join("\n")); 
 | 
            return; 
 | 
        } 
 | 
    } catch (err) { 
 | 
        if(err.faultstring !=undefined && err.faultstring.indexOf('INVALID_SESSION_ID') != -1) { 
 | 
            alert('当前网页已登出,请您重新登录后刷新该网页!'); 
 | 
        } else { 
 | 
                alert(err.faultstring); 
 | 
        } 
 | 
        return; 
 | 
    } 
 | 
  
 | 
    window.location.reload(); 
 | 
} 
 | 
foo();</url> 
 | 
</WebLink> 
 |