<?xml version="1.0" encoding="UTF-8"?>
|
<CustomObject xmlns="http://soap.sforce.com/2006/04/metadata">
|
<actionOverrides>
|
<actionName>Accept</actionName>
|
<type>Default</type>
|
</actionOverrides>
|
<actionOverrides>
|
<actionName>CancelEdit</actionName>
|
<type>Default</type>
|
</actionOverrides>
|
<actionOverrides>
|
<actionName>Clone</actionName>
|
<type>Default</type>
|
</actionOverrides>
|
<actionOverrides>
|
<actionName>Delete</actionName>
|
<type>Default</type>
|
</actionOverrides>
|
<actionOverrides>
|
<actionName>Edit</actionName>
|
<type>Default</type>
|
</actionOverrides>
|
<actionOverrides>
|
<actionName>List</actionName>
|
<type>Default</type>
|
</actionOverrides>
|
<actionOverrides>
|
<actionName>New</actionName>
|
<type>Default</type>
|
</actionOverrides>
|
<actionOverrides>
|
<actionName>SaveEdit</actionName>
|
<type>Default</type>
|
</actionOverrides>
|
<actionOverrides>
|
<actionName>Tab</actionName>
|
<type>Default</type>
|
</actionOverrides>
|
<actionOverrides>
|
<actionName>View</actionName>
|
<type>Default</type>
|
</actionOverrides>
|
<allowInChatterGroups>false</allowInChatterGroups>
|
<compactLayoutAssignment>SYSTEM</compactLayoutAssignment>
|
<deploymentStatus>Deployed</deploymentStatus>
|
<enableActivities>false</enableActivities>
|
<enableBulkApi>true</enableBulkApi>
|
<enableChangeDataCapture>false</enableChangeDataCapture>
|
<enableFeeds>false</enableFeeds>
|
<enableHistory>false</enableHistory>
|
<enableReports>true</enableReports>
|
<enableSearch>true</enableSearch>
|
<enableSharing>true</enableSharing>
|
<enableStreamingApi>true</enableStreamingApi>
|
<externalSharingModel>ControlledByParent</externalSharingModel>
|
<fields>
|
<fullName>ApplyType_F__c</fullName>
|
<externalId>false</externalId>
|
<formula>IF( RecordType.DeveloperName = 'PostponeType',IF( NextPlanDate__c < CancelOPDPlan__r.OPDPlan_ImplementDate__c ,'提前','延期'),IF( RecordType.DeveloperName = 'CancelType','取消',''))</formula>
|
<label>申请类型(公式)</label>
|
<required>false</required>
|
<trackTrending>false</trackTrending>
|
<type>Text</type>
|
<unique>false</unique>
|
</fields>
|
<fields>
|
<fullName>ApplyType__c</fullName>
|
<externalId>false</externalId>
|
<label>申请类型</label>
|
<length>255</length>
|
<required>false</required>
|
<trackTrending>false</trackTrending>
|
<type>Text</type>
|
<unique>false</unique>
|
</fields>
|
<fields>
|
<fullName>CancelOPDPlan__c</fullName>
|
<externalId>false</externalId>
|
<label>OPD计划</label>
|
<referenceTo>OPDPlan__c</referenceTo>
|
<relationshipLabel>OPD计划取消延期</relationshipLabel>
|
<relationshipName>OPDPlan</relationshipName>
|
<relationshipOrder>0</relationshipOrder>
|
<reparentableMasterDetail>false</reparentableMasterDetail>
|
<trackTrending>false</trackTrending>
|
<type>MasterDetail</type>
|
<writeRequiresMasterRead>false</writeRequiresMasterRead>
|
</fields>
|
<fields>
|
<fullName>Fieldemail__c</fullName>
|
<description>获取备品中心的邮件地址</description>
|
<externalId>false</externalId>
|
<label>备品中心的电子邮件字段</label>
|
<required>false</required>
|
<trackTrending>false</trackTrending>
|
<type>Email</type>
|
<unique>false</unique>
|
</fields>
|
<fields>
|
<fullName>NextPlanDate__c</fullName>
|
<externalId>false</externalId>
|
<label>下次计划日期</label>
|
<required>false</required>
|
<trackTrending>false</trackTrending>
|
<type>Date</type>
|
</fields>
|
<fields>
|
<fullName>Status__c</fullName>
|
<externalId>false</externalId>
|
<label>状态</label>
|
<required>false</required>
|
<trackTrending>false</trackTrending>
|
<type>Picklist</type>
|
<valueSet>
|
<restricted>true</restricted>
|
<valueSetDefinition>
|
<sorted>false</sorted>
|
<value>
|
<fullName>取消</fullName>
|
<default>false</default>
|
<label>取消报告</label>
|
</value>
|
<value>
|
<fullName>提交</fullName>
|
<default>false</default>
|
<label>取消提交</label>
|
</value>
|
<value>
|
<fullName>取消成功</fullName>
|
<default>false</default>
|
<label>取消成功</label>
|
</value>
|
<value>
|
<fullName>延期报告</fullName>
|
<default>false</default>
|
<label>改期报告</label>
|
</value>
|
<value>
|
<fullName>延期提交</fullName>
|
<default>false</default>
|
<label>改期提交</label>
|
</value>
|
<value>
|
<fullName>延期成功</fullName>
|
<default>false</default>
|
<label>改期成功</label>
|
</value>
|
</valueSetDefinition>
|
</valueSet>
|
</fields>
|
<fields>
|
<fullName>cancelReasonCombobox__c</fullName>
|
<externalId>false</externalId>
|
<label>改期理由</label>
|
<required>false</required>
|
<trackTrending>false</trackTrending>
|
<type>Picklist</type>
|
<valueSet>
|
<valueSetDefinition>
|
<sorted>false</sorted>
|
<value>
|
<fullName>手术取消</fullName>
|
<color>#78C953</color>
|
<default>false</default>
|
<label>手术取消</label>
|
</value>
|
<value>
|
<fullName>信息填写错误</fullName>
|
<color>#E27001</color>
|
<default>false</default>
|
<label>信息填写错误</label>
|
</value>
|
<value>
|
<fullName>计划重复</fullName>
|
<color>#A845DC</color>
|
<default>false</default>
|
<label>计划重复</label>
|
</value>
|
<value>
|
<fullName>工作计划修改</fullName>
|
<color>#F3D904</color>
|
<default>false</default>
|
<label>工作计划修改</label>
|
</value>
|
<value>
|
<fullName>医院取消试用</fullName>
|
<color>#A53711</color>
|
<default>false</default>
|
<label>医院取消试用</label>
|
</value>
|
<value>
|
<fullName>暂时没有备品</fullName>
|
<color>#66E9BD</color>
|
<default>false</default>
|
<label>暂时没有备品</label>
|
</value>
|
<value>
|
<fullName>备品到货推迟</fullName>
|
<color>#0B24BE</color>
|
<default>false</default>
|
<label>备品到货推迟</label>
|
</value>
|
<value>
|
<fullName>工作计划变化</fullName>
|
<color>#419249</color>
|
<default>false</default>
|
<label>工作计划变化</label>
|
</value>
|
<value>
|
<fullName>医院试用改期</fullName>
|
<color>#B6E32E</color>
|
<default>false</default>
|
<label>医院试用改期</label>
|
</value>
|
<value>
|
<fullName>手术改期</fullName>
|
<color>#641CCF</color>
|
<default>false</default>
|
<label>手术改期</label>
|
</value>
|
<value>
|
<fullName>日期填写错误</fullName>
|
<color>#F96FB7</color>
|
<default>false</default>
|
<label>日期填写错误</label>
|
</value>
|
<value>
|
<fullName>医院设备不到位</fullName>
|
<color>#2F5D85</color>
|
<default>false</default>
|
<label>医院设备不到位</label>
|
</value>
|
<value>
|
<fullName>学会取消</fullName>
|
<color>#8F6429</color>
|
<default>false</default>
|
<label>学会取消</label>
|
</value>
|
<value>
|
<fullName>学会延期</fullName>
|
<color>#EFAE73</color>
|
<default>false</default>
|
<label>学会延期</label>
|
</value>
|
<value>
|
<fullName>取消OPD计划</fullName>
|
<color>#57F17C</color>
|
<default>false</default>
|
<label>取消OPD计划</label>
|
</value>
|
<value>
|
<fullName>备品取消</fullName>
|
<color>#0B6FCE</color>
|
<default>false</default>
|
<label>备品取消</label>
|
</value>
|
<value>
|
<fullName>超过计划日</fullName>
|
<color>#78C953</color>
|
<default>false</default>
|
<label>超过计划日</label>
|
</value>
|
<value>
|
<fullName>担当离职</fullName>
|
<color>#E27001</color>
|
<default>false</default>
|
<label>担当离职</label>
|
</value>
|
<value>
|
<fullName>没完成备品申请</fullName>
|
<color>#FFFF66</color>
|
<default>false</default>
|
<label>没完成备品申请</label>
|
</value>
|
<value>
|
<fullName>系统自动延期</fullName>
|
<color>#78C953</color>
|
<default>false</default>
|
<label>系统自动延期</label>
|
</value>
|
<value>
|
<fullName>计划调整变更</fullName>
|
<default>false</default>
|
<label>计划调整变更</label>
|
</value>
|
<value>
|
<fullName>修理对应</fullName>
|
<default>false</default>
|
<label>修理对应</label>
|
</value>
|
<value>
|
<fullName>问题已解决无需OPD</fullName>
|
<default>false</default>
|
<label>问题已解决无需OPD</label>
|
</value>
|
<value>
|
<fullName>申请单合并</fullName>
|
<default>false</default>
|
<label>申请单合并</label>
|
</value>
|
<value>
|
<fullName>客户已采购竞品,失单</fullName>
|
<default>false</default>
|
<label>客户已采购竞品,失单</label>
|
</value>
|
<value>
|
<fullName>备品不足</fullName>
|
<default>false</default>
|
<label>备品不足</label>
|
</value>
|
<value>
|
<fullName>其他</fullName>
|
<default>false</default>
|
<label>其他</label>
|
</value>
|
<value>
|
<fullName>客户时间变更或冲突</fullName>
|
<default>false</default>
|
<label>客户时间变更或冲突</label>
|
</value>
|
</valueSetDefinition>
|
</valueSet>
|
</fields>
|
<fields>
|
<fullName>cancelReason__c</fullName>
|
<externalId>false</externalId>
|
<label>取消/延期理由1</label>
|
<length>255</length>
|
<required>false</required>
|
<trackTrending>false</trackTrending>
|
<type>Text</type>
|
<unique>false</unique>
|
</fields>
|
<fields>
|
<fullName>if_HaveRental_Apply__c</fullName>
|
<defaultValue>false</defaultValue>
|
<externalId>false</externalId>
|
<label>是否备品主动取消</label>
|
<trackTrending>false</trackTrending>
|
<type>Checkbox</type>
|
</fields>
|
<fields>
|
<fullName>isDailyReportDelay__c</fullName>
|
<defaultValue>false</defaultValue>
|
<externalId>false</externalId>
|
<label>是否日报延期</label>
|
<trackTrending>false</trackTrending>
|
<type>Checkbox</type>
|
</fields>
|
<fields>
|
<fullName>opd_emain_dizhi__c</fullName>
|
<externalId>false</externalId>
|
<formula>CancelOPDPlan__r.Loaner_centre_mail_addressF__c</formula>
|
<formulaTreatBlanksAs>BlankAsZero</formulaTreatBlanksAs>
|
<label>opd计划的备品中心的邮件地址</label>
|
<required>false</required>
|
<trackTrending>false</trackTrending>
|
<type>Text</type>
|
<unique>false</unique>
|
</fields>
|
<label>OPD计划取消延期</label>
|
<listViews>
|
<fullName>All</fullName>
|
<columns>NAME</columns>
|
<columns>CancelOPDPlan__c</columns>
|
<columns>cancelReasonCombobox__c</columns>
|
<columns>Status__c</columns>
|
<filterScope>Everything</filterScope>
|
<label>全部</label>
|
<language>zh_CN</language>
|
</listViews>
|
<nameField>
|
<displayFormat>{YYYY}{MM}{DD}{00}</displayFormat>
|
<label>名称</label>
|
<type>AutoNumber</type>
|
</nameField>
|
<recordTypes>
|
<fullName>CancelType</fullName>
|
<active>true</active>
|
<label>取消</label>
|
<picklistValues>
|
<picklist>Status__c</picklist>
|
<values>
|
<fullName>取消</fullName>
|
<default>false</default>
|
</values>
|
<values>
|
<fullName>取消成功</fullName>
|
<default>false</default>
|
</values>
|
<values>
|
<fullName>提交</fullName>
|
<default>false</default>
|
</values>
|
</picklistValues>
|
<picklistValues>
|
<picklist>cancelReasonCombobox__c</picklist>
|
<values>
|
<fullName>信息填写错误</fullName>
|
<default>false</default>
|
</values>
|
<values>
|
<fullName>其他</fullName>
|
<default>false</default>
|
</values>
|
<values>
|
<fullName>医院取消试用</fullName>
|
<default>false</default>
|
</values>
|
<values>
|
<fullName>客户已采购竞品%EF%BC%8C失单</fullName>
|
<default>false</default>
|
</values>
|
<values>
|
<fullName>客户时间变更或冲突</fullName>
|
<default>false</default>
|
</values>
|
<values>
|
<fullName>计划调整变更</fullName>
|
<default>false</default>
|
</values>
|
<values>
|
<fullName>计划重复</fullName>
|
<default>false</default>
|
</values>
|
<values>
|
<fullName>问题已解决无需OPD</fullName>
|
<default>false</default>
|
</values>
|
</picklistValues>
|
</recordTypes>
|
<recordTypes>
|
<fullName>PostponeType</fullName>
|
<active>true</active>
|
<label>改期</label>
|
<picklistValues>
|
<picklist>Status__c</picklist>
|
<values>
|
<fullName>延期成功</fullName>
|
<default>false</default>
|
</values>
|
<values>
|
<fullName>延期报告</fullName>
|
<default>false</default>
|
</values>
|
<values>
|
<fullName>延期提交</fullName>
|
<default>false</default>
|
</values>
|
</picklistValues>
|
<picklistValues>
|
<picklist>cancelReasonCombobox__c</picklist>
|
<values>
|
<fullName>其他</fullName>
|
<default>false</default>
|
</values>
|
<values>
|
<fullName>医院设备不到位</fullName>
|
<default>false</default>
|
</values>
|
<values>
|
<fullName>医院试用改期</fullName>
|
<default>false</default>
|
</values>
|
<values>
|
<fullName>备品到货推迟</fullName>
|
<default>false</default>
|
</values>
|
<values>
|
<fullName>客户时间变更或冲突</fullName>
|
<default>false</default>
|
</values>
|
<values>
|
<fullName>工作计划变化</fullName>
|
<default>false</default>
|
</values>
|
<values>
|
<fullName>日期填写错误</fullName>
|
<default>false</default>
|
</values>
|
</picklistValues>
|
</recordTypes>
|
<searchLayouts/>
|
<sharingModel>ControlledByParent</sharingModel>
|
<validationRules>
|
<fullName>NextPlanDateCheck</fullName>
|
<active>true</active>
|
<description>跳过系统管理员</description>
|
<errorConditionFormula>$User.ProfileId <> "00e10000000Y3o5" && Text(CancelOPDPlan__r.OPDType__c) != '学会' &&((NextPlanDate__c - TODAY() > 60)||(NextPlanDate__c - TODAY() < 1))</errorConditionFormula>
|
<errorMessage>计划日期只能在60天内</errorMessage>
|
</validationRules>
|
<validationRules>
|
<fullName>NextPlanDateMustMaxToday</fullName>
|
<active>true</active>
|
<description>下次计划日期 必须在 今天以后
|
排除系统管理员</description>
|
<errorConditionFormula>AND($User.ProfileId <> "00e10000000Y3o5",NextPlanDate__c <= TODAY(),$User.Batch_User__c=false)</errorConditionFormula>
|
<errorDisplayField>NextPlanDate__c</errorDisplayField>
|
<errorMessage>下次计划日期 必须在 今天以后</errorMessage>
|
</validationRules>
|
<visibility>Public</visibility>
|
<webLinks>
|
<fullName>CommitNeedApproval</fullName>
|
<availability>online</availability>
|
<description>提交待审批(自定义)</description>
|
<displayType>button</displayType>
|
<linkType>javascript</linkType>
|
<masterLabel>提交待审批</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
|
function foo(){
|
//SWAG-BUF6J5 SWAG-BVH3Q7
|
//0.判断符合条件得备品借出申请(状态为取消才去验证) SWAG-BUF6J5
|
var NowStatus = "{!CancelPostponePlan__c.Status__c}";
|
if(NowStatus == "取消" || NowStatus == "延期报告"){
|
var opdplanid = '{!CancelPostponePlan__c.CancelOPDPlanId__c}';
|
var rtn = sforce.apex.execute("OpdPlanWebService", "changeTrade",{opdplanId:opdplanid});
|
if (rtn != 'OK') {
|
alert(rtn);
|
return;
|
}
|
}
|
|
//1.当前状态(只有取消或者延期报告状态才可以进行审批)
|
if(NowStatus != "取消" && NowStatus != "延期报告"){
|
alert("只有状态为取消或者延期报告时才可以进行提交审批!")
|
return;
|
}
|
//2.提示
|
if (!confirm("一旦提交此记录以待批准,根据您的设置您可能不再能够编辑此记录或将他从批准过程中调回。是否继续?")) {
|
return;
|
}
|
var rac = new sforce.SObject("CancelPostponePlan__c");
|
rac.Id = "{!CancelPostponePlan__c.Id}";
|
//3.状态改为 提交
|
if(NowStatus == "取消"){
|
rac.Status__c ="提交";
|
}else if(NowStatus == "延期报告"){
|
rac.Status__c ="延期提交";
|
}
|
var result = sforce.connection.update([rac]);
|
var messages = getConnectDMLErrorMessages(result);
|
if (messages.length > 0) {
|
alert(messages.join("\n"));
|
return;
|
}
|
|
//4. 进程生成器
|
|
//5. 重新刷新页面
|
window.location.reload();
|
}
|
foo();</url>
|
</webLinks>
|
</CustomObject>
|