Li Jun
2022-03-24 f127c76b19f5316032d4bed127a1dde710c48d74
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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
<apex:page sidebar="false" showHeader="true" action="{!init}" standardcontroller="AssessmentReport__c" extensions="AssessmentReportController" id="allPage">
    <apex:stylesheet value="{!URLFOR($Resource.blockUIcss)}"/>
    <apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}"/>
    <apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}"/>
    <apex:includeScript value="/soap/ajax/29.0/connection.js"/>
    <apex:includeScript value="/soap/ajax/29.0/apex.js"/>
    <apex:includeScript value="{!URLFOR($Resource.AWSService, 'AWSService.js') }" />
 
    <script>
        var aws = JSON.parse('{!awsString}');
        var staticResources = JSON.parse('{!staticResource}');
        var contactAwsDataIds = [];
        var contact = {};
        queryContact();
 
        function preparePayloadForSearchContact(){
            let searchPayload = new Object();
            searchPayload.dataIds = contactAwsDataIds;
            searchPayload.contactName = '';
            return JSON.stringify(searchPayload);
        }
 
        function queryContact(){
            for(var i = 0;i<aws.length;i++){
                contactAwsDataIds.push(aws[i].CamMem.Contact_ID__r.AWS_Data_Id__c);
            }
            let data = preparePayloadForSearchContact();
            let searchCallBack = function searchCallBack(result){
                console.log(result);
                let contacts = result.object;
                if(contacts == null){
                    return;
                }
                for(var i=0;i<contacts.length;i++){
                    contact[contacts[i].dataId] = contacts[i].lastName.replace(/"/g,"");
                }
                console.log(JSON.stringify(contact));
            };
            AWSService.search(staticResources.searchUrl,data,searchCallBack,staticResources.token);
        }
 
        function showPIDiv(awsDataId){
            console.log('awsDataId Value:'+awsDataId);
            let parentNode = document.getElementById(awsDataId);
            let createDiv = document.createElement("div");  
            createDiv.id = awsDataId+"_PI";  
            let piInformation = 'Name:'+contact[awsDataId]
            //let piInformation = 'Name:'+contact['943114607025717249'].lastName +'\n' +'Phone:'+contact['943114607025717249'].phone
            createDiv.innerText = piInformation;
            let x=window.event.x;
            let y=window.event.y; 
            createDiv.style.left=x;  
            createDiv.style.top=y;  
            createDiv.style.height='30px';  
            createDiv.style.width='100px'; 
            createDiv.style.background="#dddddd";
            createDiv.style.position = "absolute";
            parentNode.appendChild(createDiv); 
            parentNode.style.position = "relative"; 
        }
 
        function hidePIDiv(awsDataId){
            document.getElementById(awsDataId+'_PI').remove();
        }
    </script>
 
    <apex:form id="allForm">
 
        <apex:pageBlock title="{!IF(AssessmentReport!=null && AssessmentReport.Name != null , AssessmentReport.Name, '授课/考核报告')}" id="allBlock">
               <apex:pageBlockButtons id="manyBtn" >
                <apex:commandButton id="Edit" action="{!EditRecord}" onclick="blockme();" oncomplete="unblockUI();" rendered="{!Inputdisabled}" rerender="allForm" disabled="{!If(AssessmentReport.Status__c = '草案中' || AssessmentReport.Status__c = '不批准' , false, true)}" value="编辑"/>
                <apex:commandButton action="{!save}" onclick="blockme();" oncomplete="unblockUI();" disabled="{!Inputdisabled}" rerender="allForm" value="保存"/>
                <apex:commandButton id="Cancel" action="{!EditRecord}" onclick="blockme();" oncomplete="unblockUI();" rendered="{!Not(Inputdisabled)}" rerender="allForm" value="取消"/>
                <apex:commandButton action="{!Submit}" disabled="{!If(AssessmentReport.Status__c = '草案中' , false, true)}" rerender="allForm" value="保存并提交审批"/>
                <apex:commandButton action="{!cancel}" style="float:right;" onclick="blockme();" oncomplete="unblockUI();" rerender="allForm" value="不保存(返回)"/>
                <apex:commandButton action="{!saveAndCancel}" onclick="blockme();" oncomplete="unblockUI();" style="float:right;"  rerender="allForm" disabled="{!Inputdisabled}" value="保存(返回)"/>
            </apex:pageBlockButtons>
            <apex:pageMessages id="pageMessages"></apex:pageMessages>
 
            <apex:pageBlockSection id="BasicInformation" title="基本信息" columns="2" >
                <apex:inputField id="Type"  rendered="{!Not(Inputdisabled)}" required="true"  value="{!AssessmentReport.Type__c}" />
                <apex:outputField id="Type_Output"  rendered="{!Inputdisabled}"  value="{!AssessmentReport.Type__c}" />
                <apex:outputText id="Report_Code" label="报告编码 :"  value="{!AssessmentReport.Report_Code__c}" />
                
                <apex:inputField id="TeachingHourSelect"  required="true" rendered="{!Not(Inputdisabled)}" value="{!AssessmentReport.TeachingHourSelect__c}"/>
                <apex:outputField id="TeachingHourSelect_Output" label="授课课时 :" rendered="{!Inputdisabled}" value="{!AssessmentReport.TeachingHourSelect__c}"/>
                <apex:inputField id="TeachingHourOther" label="授课课时(其他) :" rendered="{!Not(Inputdisabled)}" value="{!AssessmentReport.TeachingHourOther__c}"/>
                <apex:outputField id="TeachingHourOther_Output" label="授课课时(其他) :" rendered="{!Inputdisabled}" value="{!AssessmentReport.TeachingHourOther__c}"/>
                <apex:outputText id="Status" label="审批状态 :"  value="{!AssessmentReport.Status__c}" />
                <apex:inputCheckbox value="{!AssessmentReport.AssessNext__c}" disabled="true" id="finish_Output" rendered="{!Inputdisabled}" label="同时申请最终考核:" />
                <apex:inputCheckbox value="{!AssessmentReport.AssessNext__c}"  id="finish" rendered="{!not(Inputdisabled)}" label="同时申请最终考核:" />
 
                 <apex:outputText id="AttendNumber" label="出勤人数 :"  value="{!AssessmentReport.AttendNumber__c}"/>
                <apex:inputField id="TrainingLecturer1" required="true" rendered="{!Not(Inputdisabled)}"   value="{!AssessmentReport.TrainingLecturer1__c}"/> 
                <apex:outputField id="TrainingLecturer1_Output" rendered="{!Inputdisabled}" label="授课讲师1 :"  value="{!AssessmentReport.TrainingLecturer1__c}"/> 
                 <apex:outputText id="AverageGrade" label="平均分 :"    value="{!AssessmentReport.AverageGrade__c}" />
               
 
                <apex:inputField id="TrainingLecturer2" rendered="{!Not(Inputdisabled)}"    value="{!AssessmentReport.TrainingLecturer2__c}"/>
                <apex:outputField id="TrainingLecturer2_Output" rendered="{!Inputdisabled}" label="授课讲师2 :"  value="{!AssessmentReport.TrainingLecturer2__c}"/>
                 <apex:inputField id="TeachingContent"   required="true"  rendered="{!Not(Inputdisabled)}" value="{!AssessmentReport.TeachingContent__c}"/>
                 <apex:outputField id="TeachingContent_Output" label="授课内容 :"  rendered="{!Inputdisabled}" value="{!AssessmentReport.TeachingContent__c}"/>  
 
                <apex:inputField id="TrainingLecturer3" rendered="{!Not(Inputdisabled)}"   value="{!AssessmentReport.TrainingLecturer3__c}"/>
                <apex:outputField id="TrainingLecturer3_Output" rendered="{!Inputdisabled}" label="授课讲师3 :"  value="{!AssessmentReport.TrainingLecturer3__c}"/>
 
 
                 <apex:outputText id="j" label="出勤率 :" value="{!AssessmentReport.AttendRate__c}" />
                <apex:inputField id="TrainingLecturer4" rendered="{!Not(Inputdisabled)}"    value="{!AssessmentReport.TrainingLecturer4__c}"/>
                <apex:outputField id="TrainingLecturer4_Output" rendered="{!Inputdisabled}" label="授课讲师4 :"  value="{!AssessmentReport.TrainingLecturer4__c}"/>
 
                <apex:outputField id="TeachingDate_Output" label="授课日期 :"  value="{!AssessmentReport.TeachingDate__c}"/>
                
                <apex:inputField id="TrainingLecturer5" rendered="{!Not(Inputdisabled)}"   value="{!AssessmentReport.TrainingLecturer5__c}"/>
                <apex:outputField id="TrainingLecturer5_Output" rendered="{!Inputdisabled}" label="授课讲师5 :"  value="{!AssessmentReport.TrainingLecturer5__c}"/>
 
               
              
               
            </apex:pageBlockSection>
            
            <apex:pageblocksection columns="1" title="出勤学员&成绩" id="InstructedStaff">
                <apex:inputHidden id="TeachingHour" value="{!AssessmentReport.TeachingHour__c}"/>
                <apex:outputPanel >
                 
                    <table id="theTable_header"  style ="width: 98%; text-align: center;"   styleClass="list">
                          <thead>
                         <tr>
                            <td  style="width: 18%" scope="col">医院科室</td>
                             <td  style="width: 8%" scope="col">姓名</td>  
                            <td  style="width: 14%" scope="col">营业本部</td>
                             <td  style="width: 8%" scope="col">省</td>
                            <td  style="width: 8%" scope="col">市</td>
                            <td  style="width: 5%" scope="col">出勤情况</td>
                             <td  style="width: 5%" scope="col">课堂参与度</td>
                              <td  style="width: 5%" scope="col">成绩</td>
                            <td  style="width: 5%" scope="col">课后作业完成情况</td>
                             <td  style="width: 24%" scope="col">备注</td>
                         </tr>
                       </thead>
                   </table>
                      <div id="tablediv" style="overflow:auto; width:100%; height:200px; text-align: center;">
                          <apex:dataTable value="{!ARSInfoList}" var="al" id="theTable_content" border="0" 
                        style="width:99%;border-bottom-width: 0px; font-size:11px; border-spacing:0;" styleClass="list">
                            <apex:column style="width: 18%">
                               <apex:outputField style="resize:vertical;width: 95%" id="Department" value="{!al.CamMem.Department_ID__c}"/>
                            </apex:column>
                            <!-- id="{!al.CamMem.Contact_ID__r.AWS_Data_Id__c}" onmouseover="showPIDiv('{!al.CamMem.Contact_ID__r.AWS_Data_Id__c}')" onmouseout="hidePIDiv('{!al.CamMem.Contact_ID__r.AWS_Data_Id__c}')" -->
                            <apex:column style="width: 8%" >
                               <!-- <apex:outputField style="resize:vertical;width: 95%" id="Name" value="{!al.CamMem.Contact_ID__c}" /> -->
                               <span id="{!al.CamMem.Contact_ID__r.AWS_Data_Id__c}" onmouseover="showPIDiv('{!al.CamMem.Contact_ID__r.AWS_Data_Id__c}')" onmouseout="hidePIDiv('{!al.CamMem.Contact_ID__r.AWS_Data_Id__c}')">{!al.ARS.Name}</span>
                            </apex:column>
                            <apex:column style="width: 14%">
                               <apex:outputText style="resize:vertical;width: 95%" id="dept" value="{!al.CamMem.dept__c}"/>
                            </apex:column>
                                <apex:column style="width: 8%">
                               <apex:outputText style="resize:vertical;width: 95%" id="State" value="{!al.CamMem.State__c}"/>
                            </apex:column>
                            <apex:column style="width: 8%">
                               <apex:outputText style="resize:vertical;width: 95%" id="City" value="{!al.CamMem.City__c}"/>
                            </apex:column>
                                <apex:column style="width: 5%">
                               <apex:inputField rendered="{!Not(Inputdisabled)}" style="resize:vertical;width: 95%" id="AttendStatus" value="{!al.ARS.AttendStatus__c}"/>
                               <apex:outputField rendered="{!Inputdisabled}" style="resize:vertical;width: 95%" id="AttendStatus_Output" value="{!al.ARS.AttendStatus__c}"/>
                            </apex:column>
                            <apex:column style="width: 5%">
                               <apex:inputField rendered="{!Not(Inputdisabled)}" style="resize:vertical;width: 95%" id="AttendRate" value="{!al.ARS.AttendRate__c}"/>
                               <apex:outputField rendered="{!Inputdisabled}" style="resize:vertical;width: 95%" id="AttendRate_Output" value="{!al.ARS.AttendRate__c}"/>
                            </apex:column>
                            <apex:column style="width: 5%">
                               <apex:inputField rendered="{!Not(Inputdisabled)}" style="resize:vertical;width: 95%" id="Grade" value="{!al.ARS.Grade__c}"/>
                               <apex:outputField rendered="{!Inputdisabled}" style="resize:vertical;width: 95%" id="Grade_Output" value="{!al.ARS.Grade__c}"/>
                            </apex:column>
                            <apex:column style="width: 5%">
                              <apex:inputField rendered="{!Not(Inputdisabled)}" value="{!al.ARS.HomeworkFeedback__c}" style="width: 95%" id="HomeworkFeedback" />
                              <apex:outputField rendered="{!Inputdisabled}" style="resize:vertical;width: 95%" id="HomeworkFeedback_Output" value="{!al.ARS.HomeworkFeedback__c}"/>
                            </apex:column>
                            <apex:column style="width: 24%">
                              <apex:inputTextarea disabled="{!Inputdisabled}" value="{!al.ARS.comment__c}" style="resize:vertical ;width: 95%" rows="3" />
                            </apex:column>
                           
                       </apex:dataTable>
                    </div>
                     
                
 
                </apex:outputPanel>
            </apex:pageblocksection>
 
 
         <apex:pageBlockSection id="TrainedStaffFeedback" title="培训人员反馈信息汇总" columns="2" >
             <apex:outputPanel >
                 <apex:inputTextarea id="TrainedStaffFeedback" disabled="{!Inputdisabled}" value="{!AssessmentReport.TrainedStaffFeedback__c}" rows="10" style="resize:vertical;width: 250%"/>
              </apex:outputPanel>
         </apex:pageBlockSection>
         <apex:pageBlockSection id="HomeworkFeedback" title="课后作业、复习相关情况汇总" columns="2" >
            <apex:outputPanel >
                 <apex:inputTextarea id="HomeworkFeedback" disabled="{!Inputdisabled}" value="{!AssessmentReport.HomeworkFeedback__c}"  rows="10" style="resize:vertical;width: 250%"/>
             </apex:outputPanel>
        </apex:pageBlockSection>
        <apex:pageBlockSection id="TeacherFeedback" title="讲师对活动综合报告/感想" columns="2" >
             <apex:outputPanel >
                 <apex:inputTextarea id="TeacherFeedback" disabled="{!Inputdisabled}" value="{!AssessmentReport.TeacherFeedback__c}" rows="10" style="resize:vertical;width: 250%"/>
              </apex:outputPanel>
        </apex:pageBlockSection>
        <apex:pageBlockSection id="LectureFeedback" title="课件\课程设置相关反馈内容(修改意见、亮点等)" columns="2" >
            <apex:outputPanel >
                 <apex:inputTextarea id="LectureFeedback" disabled="{!Inputdisabled}" value="{!AssessmentReport.LectureFeedback__c}" rows="10" style="resize:vertical;width: 250%"/>
             </apex:outputPanel>
        </apex:pageBlockSection>
        <apex:pageBlockSection id="GoodExample" title="本次活动好的例子&需要改善的地方" columns="2" >
             <apex:outputPanel >
                 <apex:inputTextarea id="GoodExample" disabled="{!Inputdisabled}" value="{!AssessmentReport.GoodExample__c}" rows="10" style="resize:vertical;width: 250%"/>
              </apex:outputPanel>
        </apex:pageBlockSection>
        <apex:pageMessages id="pageMessages_botton"></apex:pageMessages>
        </apex:pageBlock>
    </apex:form>
 
</apex:page>