liuyn
2024-03-11 a87f1c3df03078814ee97ad0c8ac200a232419e9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
<apex:page Controller="RentalApplyFaultReportController" showHeader="false" sidebar="false" id="allPage" action="{!init}" title="备品检测分析报告" lightningStylesheets="true">
<!-- Begin Default Content REMOVE THIS -->
<apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}"/>
<apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}"/>
<apex:stylesheet value="{!URLFOR($Resource.StyleUtilCss)}"/><!-- 20230619 ljh lightning --> 
  <script>
    function checkAll(ele) {
      var ckd = j$(ele).attr("checked") ? true : false;
      j$('input[type="checkbox"]').prop("checked", ckd);
    }
 
    function newReport(flag, radetailId, radetailName, personId, personName, purpose2, name, hospitalName, serialNumber, fixtureNo, workPlace, deptCategory){
      console.log( flag );
      if(flag == '不存在故障报告单'){
        // window.open("/a5C/e?Name=*" + "&CF00N10000009I5UX_lKid=" + radetailId + "&CF00N10000009I5UX=" + radetailName + "&CF00N10000009I5UV_lKid=" + personId + "&CF00N10000009I5UV=" + personName + "&00N10000009I5Uh=" + purpose2 + "&00N10000009I5UW=" + name + "&00N10000009I6jv=" + hospitalName + "&00N10000009I5Ua=" + serialNumber + "&00N10000009I5UP=" + fixtureNo + "&00N10000009I5Uf=" + workPlace + "&00N10000009I5UU=" + deptCategory);
        //window.open("/a5F/e?Name=*" + "&CF00N9D000007hkLN_lKid=" + radetailId + "&CF00N9D000007hkLN=" + radetailName + "&CF00N9D000007jemP_lKid=" + personId + "&CF00N9D000007jemP=" + personName + "&00N9D000007jrE6=" + purpose2 + "&00N9D000007ijyA=" + name + "&00N9D000007yNXu=" + hospitalName + "&00N9D000007jrEL=" + serialNumber + "&00N9D000007jrEQ=" + fixtureNo + "&00N9D000007jrEV=" + workPlace + "&00N9D000007jrJW=" + deptCategory);
        var url = '/lightning/o/Rental_Apply_Fault__c/new?defaultFieldValues=Name=*,Rental_Apply_Equipment_Set_Detail__c='+radetailId+',Person_In_Charge_User__c='+personId
        +',demo_purpose2__c='+purpose2
        +',RentalApplyNo__c='+name
        +',HospitalText__c='+hospitalName
        +',Repair_product_body_number__c='+serialNumber
        +',Fixture_Model_No__c='+fixtureNo
        +',WorkPlace__c='+workPlace
        +',OCM_dept_category__c='+deptCategory;
        // console.log(url);
        window.open(url);
      
      
      }else{
        // if(confirm('是否打开或创建新的检测分析报告?')){
        //   if (flag == '存在故障报告单'){
        //     window.open("/a5F/e?Name=*" + "&CF00N9D000007hkLN_lKid=" + radetailId + "&CF00N9D000007hkLN=" + radetailName + "&CF00N9D000007jemP_lKid=" + personId + "&CF00N9D000007jemP=" + personName + "&00N9D000007jrE6=" + purpose2 + "&00N9D000007ijyA=" + name + "&CF00N9D000007jrEG=" + hospitalName + "&00N9D000007jrEL=" + serialNumber + "&00N9D000007jrEQ=" + fixtureNo + "&00N9D000007jrEV=" + workPlace + "&00N9D000007jrJW=" + deptCategory);
        //   }else{
        //     window.open("/" + flag);
        //   }
        // }
        if(confirm('已存在检测分析报告')){
            window.open("/" + flag);
        }
      } 
      
    }
 
    function returnjs(raId) {
      console.log(raId);
      var url = "/" + raId;
      window.location.href = url;
 
    }
  </script>
 
  <style>
    body .bPageBlock .detailList .labelCol{
      text-align: right;
      width: 7%;
    }
    .allPage:allForm:allBlock:j_id4{
      width: 33%;
    }
    /*20230920 ljh add start*/
    body .pbHeader{
      background-color: #08107b !important;;
      color: #FFF !important;
    }
    body .pbTitle .mainTitle{
      margin-left: 5px;
    }
    /*20230920 ljh add end*/
  </style>
 
  <title>主体备品选择</title>
 
  <apex:form id="allForm">
    <apex:pageBlock title="备品检测分析报告" id="allBlock" rendered="true">
      <!-- <apex:pageBlockButtons > -->
      <!-- 20230920 ljh 注释 -->
      <!-- <apex:commandButton onclick="returnjs('{!raId}'); return false;" value="返回" rerender="dummy" style="float: right;"/> -->
      <!-- </apex:pageBlockButtons> -->
      <apex:pageBlockSection rendered="{!IF(raId == null ,false, true)}">
          <apex:outputText value="{!raObj.Name}" />
          <apex:pageBlockSectionItem >
            <apex:outputLabel value="备品出借担当" />
            <apex:outputField value="{!raObj.Person_In_Charge__r.Name}" />
          </apex:pageBlockSectionItem>
          <apex:outputText value="{!raObj.WorkPlace__c}" />
          <apex:outputText value="{!raObj.demo_purpose2__c}" />
      </apex:pageBlockSection>
    
    <apex:outputPanel rendered="{!IF(raId == null ,false, true)}">
      <table border="1" style="border-collapse: collapse; font-size:16px;width: 100%;">
        <tr>
          <th style="text-align:center;">No.</th>
          <th style="text-align:center;">{!$ObjectType.Rental_Apply_Equipment_Set_Detail__c.fields.Fixture_Model_No__c.label}</th>
          <th style="text-align:center;">{!$ObjectType.Rental_Apply_Equipment_Set_Detail__c.fields.Loaner_asset_no__c.label}</th>
          <th style="text-align:center;">机身编码</th>
          <th style="text-align:center;">{!$ObjectType.Rental_Apply__c.fields.OCM_dept_category__c.label}</th>
          <th style="text-align:center;">{!$ObjectType.Rental_Apply__c.fields.Hospital__c.label}</th>
          <th style="text-align:center;white-space:normal;">检测结果</th>
          <th style="text-align:center;white-space:normal;">检测NG区分</th>
          <th style="text-align:center;white-space:normal;">故障报告</th>
        </tr>
 
        <apex:repeat value="{!retObject}" var="res" id="eList">
          <tr>
              <td style="text-align:center;">{!res.rae.Name}</td>
              <td style="text-align:center;">{!res.rae.Fixture_Model_No__c}</td>
              <td style="text-align:center;">{!res.rae.Loaner_asset_no__c}</td>
              <td style="text-align:center;">{!res.rae.SerialNumber_F__c}</td>
              <td style="text-align:center;">{!raObj.OCM_dept_category__c}</td>
              <td style="text-align:center;">{!raObj.Hospital__r.Name}</td>
              <td style="text-align:center;">{!res.rae.Inspection_result_after__c}</td>
              <td style="text-align:center;">{!res.rae.Inspection_result_after_NG__c}</td>
              <td style="text-align:center;"><apex:commandButton style="font-size: 16px; margin: 3%;margin-right: 3px;" value="故障报告" onclick="newReport('{!res.flag}','{!res.Id}','{!res.Name}','{!raObj.Person_In_Charge__c}','{!raObj.Person_In_Charge__r.Name}','{!raObj.demo_purpose2__c}','{!raObj.Name}','{!raObj.Hospital__r.Name}','{!res.rae.SerialNumber_F__c}','{!res.rae.Fixture_Model_No__c}','{!raObj.WorkPlace__c}','{!raObj.OCM_dept_category__c}'); return false;"/></td>
          </tr>
        </apex:repeat>
      </table>
    </apex:outputPanel>
 
    </apex:pageBlock>
  </apex:form>
</apex:page>