liuyn
2024-03-22 e8be4d964c6b336ed39dba5900b1b9a8f3181b96
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
<template>
    <div style="width: 100%">
        <template if:true={showSpinner}>
            <div class="overlay">
                <lightning-spinner alternative-text="Loading" size="large"></lightning-spinner>
            </div>
        </template>
        <div style="width: 99%;">
            <table class="title" width="100%" border="0">
                <thead>
                    <tr style="margin-top: 2px;margin-bottom: 2px;">
                        <th width="80%" style="text-align: left;"><sapn style="font-size: 1.3em;">编辑日报</sapn></th>
                        <th width="20%" style='height: 36px;'><lightning-button id="cancleBtn" label="不保存(首页)" onclick={notSave}></lightning-button></th>
                    </tr>
                </thead>
            </table>
        </div>
        <div style="background-color: #8dae84;">
            <span style="font-weight: bold;text-align: left;">&nbsp;&nbsp;基本信息</span>
            <span style="float: right">
                <span class="required-symbol">*</span>
                &nbsp;= 必需信息&nbsp;&nbsp;&nbsp;&nbsp;
            </span>
            <!-- <span style="border-left: 2px solid red;float: right">&nbsp;= 必需信息&nbsp;&nbsp;&nbsp;&nbsp;</span> -->
        </div>
        <div style="width: 99%;padding-top: 5px;">
            <lightning-layout>
                <lightning-layout-item size="12" padding="around-small" >
                    <div style="background-color: red;color:white">
                        {timeValid}
                    </div>
                </lightning-layout-item>
            </lightning-layout>
            <lightning-record-edit-form object-api-name="Daily_Report__c">
                <table class="basicInfo" width="99%" border="0">
                    <thead>
                        <tr style="margin-top: 2px;margin-bottom: 2px;">
                            <th width="10%"></th>
                            <th width="13%"></th>
                            <th width="9%"></th>
                            <th width="6%"></th>
                            <th width="23%"></th>
                            <th width="6%"></th>
                            <th width="16%"></th>
                            <th width="5%"></th>
                            <th width="12%"></th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <th>员工编码&nbsp;&nbsp;&nbsp;</th>
                            <td>{reportOwner.Employee_No__c}</td>
                            <td>&nbsp;</td>
                            <th>报告人&nbsp;&nbsp;&nbsp;</th>
                            <td>
                                <span style="padding:1px">{reportOwner.Name}</span>
                            </td>
                            <th>部门&nbsp;&nbsp;&nbsp;</th>
                            <td>{reportOwner.Category6__c}</td>
                            <th>职种&nbsp;&nbsp;&nbsp;</th>
                            <!-- <td>{reportOwner.Job_Category__c}</td> -->
                            <td>{Job_Category}</td>
                        </tr>
                        <tr>
                            <th>日期<div class="required-symbol">*</div>&nbsp;</th>
                            <td>
                                <lightning-input-field id="reportDateId" required="true" field-name="Reported_Date__c" value={report.Reported_Date__c} onchange={fieldChange}  variant="label-hidden"></lightning-input-field>
                                <!-- <lightning-input-field id="reportDateId" required="true" field-name="Reported_Date__c" value={reportedDate} onchange={fieldChange}  variant="label-hidden"></lightning-input-field> -->
                            </td>
                            <td><lightning-button id="readDailyReportId" label="读取日报" onclick={readDailyReport}></lightning-button></td>
                            <th style='white-space: nowrap;'>工作时间<div class="required-symbol">*</div>&nbsp;</th>
                            <td>
                                <lightning-layout>
                                    <lightning-layout-item size="2">
                                        <lightning-input  class='input-padding-right'  type="number" maxlength="2" variant="label-hidden" value={beforeHour} onchange={beforeHourChange}></lightning-input>
                                    </lightning-layout-item>
                                    <lightning-layout-item size="1" class="centered-text"><b>:</b></lightning-layout-item>
                                    <lightning-layout-item size="2"><lightning-input  class='input-padding-right'  type="number"  maxlength="2" variant="label-hidden" value={beforeMinute} onchange={beforeMinuteChange}></lightning-input></lightning-layout-item>
                                    <lightning-layout-item size="1" class="centered-text"><b>~</b></lightning-layout-item>
                                    <lightning-layout-item size="2"><lightning-input  class='input-padding-right' type="number" maxlength="2"  variant="label-hidden" value={afterHour} onchange={afterHourChange}></lightning-input></lightning-layout-item>
                                    <lightning-layout-item size="1" class="centered-text"><b>:</b></lightning-layout-item>
                                    <lightning-layout-item size="2"><lightning-input  class='input-padding-right' type="number" maxlength="2" variant="label-hidden" value={afterMinute} onchange={afterMinuteChange}></lightning-input></lightning-layout-item>
                                    <lightning-layout-item size="1"></lightning-layout-item>
                                </lightning-layout>
                            </td>
                            <th style='white-space: nowrap;'>日报类型<div class="required-symbol">*</div></th>
                            <td>
                                <lightning-input-field id="DailyReportDataType" required="true" field-name="Daily_Report_Data_Type__c" value={report.Daily_Report_Data_Type__c} onchange={fieldChange}  variant="label-hidden"></lightning-input-field>
                            </td>
                            <th>出差&nbsp;&nbsp;&nbsp;</th>
                            <td>
                                <!-- <lightning-radio-group options={businessTripOptions} value={report.Business_Trip__c} type="radio" class="slds-inline-radio"  variant="label-hidden"></lightning-radio-group> -->
                                <lightning-input-field field-name="Business_Trip__c" value={report.Business_Trip__c} onchange={fieldChange}  variant="label-hidden"></lightning-input-field>
                            </td>
                        </tr>
                        <tr>
                            <th style=' white-space: nowrap;'>日报状态(含代理)&nbsp;&nbsp;</th>
                            <td>{report.Status_With_Check__c}</td>
                            <td></td>
                            <th>提交日&nbsp;&nbsp;&nbsp;</th>
                            <td>{Submit_DateTime_New}</td>
                            <th>批准日&nbsp;&nbsp;&nbsp;</th>
                            <td>{Approved_DateTime}</td>
                            <th>新建人&nbsp;&nbsp;&nbsp;</th>
                            <td>
                                <a href={reportOwnerUrl} id="createdUser" >{reportOwner.Name}</a>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </lightning-record-edit-form>
        </div>
        <div style="background-color: #8dae84;">
            <span style="font-weight: bold;text-align: left;">&nbsp;&nbsp;活动内容</span>
            <span style="float: right">
                <span class="required-symbol">*</span>
                &nbsp;= 必需信息&nbsp;&nbsp;&nbsp;&nbsp;
            </span>
        </div>
        <!-- <div class="scrollable-container"> -->
        <div class="container">
            <template for:each={ativities} for:item="act" for:index="index">
                <div key={act.Id} style="border: 1px solid black;">
                    <div style="width: 99%;padding-top: 5px;">
                        <!-- report={report}指的是日报一览
                        report-owner={reportOwner} 指的是日报的报告者的User信息
                        the-index={index} 暂时不用
                        is-not-sales-service={isNotSalesService} 判断当前日报的报告者的职种是不是销售服务
                        report-status-flg={reportStatusFlg} 判断日报状态相关的东西   用于控制页面元素的disable
                        report-report-flg={reportReportFlg} 判断日报状态相关的东西
                        conid={conId} 暂时不用
                        event={act} 当前循环的某一条报告一览
                        onopenpage={handleOpenPage}  暂时不用
                        onvalidreport={validFromEvnent} 子组件触发父组件方法
                        reported-date={reportedDate} 日报的日期
                        reported-id={report.Id} 日报的ID
                        current-user-id={currentUserId} 当前用户id
                        shour={beforeHour} sminute={beforeMinute} ehour={afterHour} eminute={afterMinute} 指的就是日报一览的工作时间
                        cancel-request-flg={cancelRequestFlg} 判断日报状态相关的东西
                        all-disable-flg={allDisableFlg} 判断日报状态相关的东西 -->
                        <c-active-content report={report} report-owner={reportOwner} the-index={index} 
                        is-not-sales-service={isNotSalesService} report-status-flg={reportStatusFlg} read-report-flag={readReportFlag} new-lead-record-type={newLeadRecordType} 
                        report-report-flg={reportReportFlg} conid={conId} event={act} onopenpage={handleOpenPage} onvalidreport={validFromEvnent} 
                        reported-date={reportedDate} reported-id={report.Id} current-user-id={currentUserId}
                        shour={beforeHour} sminute={beforeMinute} ehour={afterHour} eminute={afterMinute} profile-name={profileName} batch-user={batchUser}
                        cancel-request-flg={cancelRequestFlg} all-disable-flg={allDisableFlg}></c-active-content>
                    </div>
                </div>
            </template>
        </div>
        <lightning-layout>
            <lightning-layout-item size="12" padding="around-small" >
                <lightning-button label="行追加" onclick={addEvent}></lightning-button>
            </lightning-layout-item>
        </lightning-layout>
        <div style="background-color: #8dae84;">
            <span style="font-weight: bold;text-align: left;">&nbsp;&nbsp;追加信息</span>
            <span style="float: right">
                <span class="required-symbol">*</span>
                &nbsp;= 必需信息&nbsp;&nbsp;&nbsp;&nbsp;
            </span>
        </div>
        <div style="width: 99%;padding-top: 5px;">
            <lightning-record-edit-form object-api-name="Daily_Report__c">
                <table class="basicInfo" width="100%" border="0">
                    <thead>
                        <tr style="margin-top: 2px;margin-bottom: 2px;background-color: rgb(200, 200, 200);">
                            <th width="10%"></th>
                            <th width="10%"></th>
                            <th width="13%"></th>
                            <th width="5%"></th>
                            <th width="10%"></th>
                            <th width="15%"></th>
                            <th width="10%"></th>
                            <th width="10%"></th>
                            <th width="10%"></th>
                            <th width="7%"></th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <th style='white-space: nowrap;'>管理人员来的反馈&nbsp;&nbsp;</th>
                            <td colspan="7">
                                <lightning-input-field field-name="Feed_Back_From_Manager__c"  value={report.Feed_Back_From_Manager__c} onchange={fieldChange}  variant="label-hidden"></lightning-input-field>
                            </td>
                        </tr>
                        <tr>
                            <th style='white-space: nowrap;'>反馈过的管理人员&nbsp;&nbsp;</th>
                            <td>
                                 <template lwc:if={report.FeedbackManager__c}>{report.FeedbackManager__r.Name}
                                </template>
                            </td>
                           <!--  <th>新建NOTES邮件提醒&nbsp;&nbsp;&nbsp;</th>
                            <td>
                                <lightning-input-field field-name="Mail_Send_Check__c" value={report.Mail_Send_Check__c} onchange={fieldChange}  variant="label-hidden"></lightning-input-field>
                            </td> -->
                            <th>状态<div class="required-symbol">*</div>&nbsp;</th>
                            <td>
                                <lightning-input-field required="true" field-name="Status__c" value={report.Status__c} onchange={fieldChange}  variant="label-hidden"></lightning-input-field>
                                <p style="color: rgb(255, 0, 0);">{statusMes}</p>
 
                                 <!-- <lightning-input-field required="true" field-name="Status__c" value={report.Status__c}   variant="label-hidden"></lightning-input-field>
                                <p style="color: rgb(255, 0, 0);">{statusMes}</p> -->
                            </td>
                            <td><lightning-button disabled={cancleApplyDis} style="padding-left: 15px;" label="取消申请" onclick={cancleApplyJs} id='cancleApply'></lightning-button></td>
                            <td><lightning-button name="cancle" style="padding-left: 15px;" label="保存并关闭" onclick={saveAll}></lightning-button></td>
                            <td><lightning-button name="notCancle"  style="padding-left: 15px;" label="保存" onclick={saveAll}></lightning-button></td>
                            <td>&nbsp;</td>
                        </tr>
                    </tbody>
                </table>
            </lightning-record-edit-form>
        </div>
        <!-- <template if:true={showModal}>
            <c-new-record-lwc onclosemodal={handleCloseModal} onhandleid={handleReturnId}></c-new-record-lwc>
        </template> -->
    </div>
</template>