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
<template>
    <div>
        <div class="slds-form-element">
            <div class="slds-form-element__control">
                <div class="slds-combobox_container">
                    <div id="box" class={boxClass} aria-expanded="true" aria-haspopup="listbox" role="combobox">
                        {searchLabel}
                        <div class="slds-combobox__form-element slds-input-has-icon slds-input-has-icon_right" role="none">
                            <template if:true={isValue}>
                                <!-- height: 100%; -->
                                <!-- <div style="position: absolute;top: 0;left: 0;width: 100%;
                                background-color: rgb(201, 201, 201);pointer-events: none;"> -->
                                    <div id="lookup-pill" class="slds-pill-container" style="position: relative;">
                                        <lightning-pill label={valueObj} name={valueObj} onremove={handleRemovePill} disabled={disabled}>
                                            <lightning-icon icon-name={iconName} alternative-text="acc"></lightning-icon>
                                        </lightning-pill>
                                    </div>
                                <!-- </div> -->
                            </template>
                            <template if:false={isValue}>
                                <div class="slds-p-top_none">
                                    <lightning-input class={inputClass} type="search" id="input" value={searchTerm}
                                        onclick={handleClick}  onchange={searchChange} onblur={onBlur} disabled={disabled}
                                        variant="label-hidden" autocomplete="off" placeholder="Search..." label='account search'>
                                    </lightning-input>
                                </div>
                            </template>
                        </div>
                        <div id="listbox-id-1" class="slds-dropdown slds-dropdown_length-with-icon-7 slds-dropdown_fluid" role="listbox" 
                        onmouseleave={handleMouseleave} onmouseenter={handleMouseenter}>
                            <ul class="slds-listbox slds-listbox_vertical" role="presentation">
                                <template for:each={options} for:item="item">
                                    <li key={item.Id} onclick={onSelect} data-id={item.Id} role="presentation">
                                        <span class="slds-lookup__item-action slds-lookup__item-action--label" role="option">
                                            <lightning-icon class="slds-icon slds-icon--small slds-icon-text-default" icon-name={iconName} alternative-text={objName} size="small"></lightning-icon>
                                            <span class="slds-truncate">{item.Name}</span>
                                        </span>
                                    </li>
                                </template>
                                <li class="sticky-li" onclick={newObject} data-id="NewRecord"  role="presentation">
                                    <span class="slds-lookup__item-action slds-lookup__item-action--label" role="option">
                                        <span class="slds-truncate">新建</span>
                                    </span>
                                </li>
                            </ul>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <template if:true={showModal}>
        <!-- Modal/Popup Box LWC starts here -->
        <section role="dialog" tabindex="-1" aria-labelledby="modal-heading-01" aria-modal="true" aria-describedby="modal-content-id-1" class="slds-modal slds-fade-in-open">
            <div class="slds-modal__container">
                <!-- Modal/Popup Box LWC header here -->
                <header class="slds-modal__header">
                    <button class="slds-button slds-button_icon slds-modal__close slds-button_icon-inverse" title="Close" onclick={closeModal}>
                        <lightning-icon icon-name="utility:close"
                            alternative-text="close"
                            variant="inverse"
                            size="small" ></lightning-icon>
                        <span class="slds-assistive-text">Close</span>
                    </button>
                    <h2 id="modal-heading-01" class="slds-text-heading_medium slds-hyphenate">新建客户人员</h2>
                </header>
                <!-- Modal/Popup Box LWC body starts here -->
                <div class="slds-modal__content slds-p-around_medium" id="modal-content-id-1">
                    <!-- <lightning-record-form  object-api-name="Agency_Contact__c" layout-type="Full" columns="2" mode="edit" no-save-button no-cancel-button>
                    </lightning-record-form> -->
                    <lightning-record-edit-form object-api-name="Contact">
                        <lightning-layout multiple-rows="true">
                            <lightning-layout-item size="6">
                                <lightning-input-field required="true" value={theContact.Name} onchange={fieldChange} field-name="LastName"></lightning-input-field>
                            </lightning-layout-item>
                            <!-- <lightning-layout-item size="6">
                                <lightning-input-field value={theContact.UnifiedI_Contact_ID__c} onchange={fieldChange} field-name="UnifiedI_Contact_ID__c"></lightning-input-field>
                            </lightning-layout-item> -->
                            <lightning-layout-item size="6">
                               <!--  <lightning-input-field required="true" value={theContact.AccountId} 
                                onchange={fieldChange} field-name="AccountId" ></lightning-input-field> -->
                                <lightning-input-field required="true" value={filter} onchange={fieldChange} field-name="AccountId"  ></lightning-input-field>
                               <!--  <lightning-formatted-name required="true" value={filter} onchange={fieldChange} field-name="AccountId"  ></lightning-formatted-name> -->
                              <!--  <c-other-look-up  unique-key="AccountID" value-id={filter} obj-name={ContactDepartment}  
                                         icon-name="standard:account" search-label="" onvalueselect={handleContactDepartmentSelection} fields={visitorPalceFields}></c-other-look-up> -->
                            </lightning-layout-item>
                            <!-- <lightning-layout-item size="6">
                                <lightning-input-field value={theContact.ServicePlatformCode__c} onchange={fieldChange} field-name="ServicePlatformCode__c"></lightning-input-field>
                            </lightning-layout-item> -->
                            <lightning-layout-item size="6">
                                <label for="custom-phone" class="slds-form-element__label slds-no-flex">手机号</label>
                                <lightning-input-field value={theContact.Phone} onchange={fieldChange} field-name="Phone" id="custom-phone" variant="label-hidden"></lightning-input-field>
                            </lightning-layout-item>
                            <!-- <lightning-layout-item size="6">
                                <lightning-input-field value={theContact.Strategic_dept_Class__c} onchange={fieldChange} field-name="Strategic_dept_Class__c"></lightning-input-field>
                            </lightning-layout-item> -->
                        </lightning-layout>
                    </lightning-record-edit-form>
                </div>
                <!-- Modal/Popup Box LWC footer starts here -->
                <footer class="slds-modal__footer">
                    <button class="slds-button slds-button_brand" onclick={sureSave}>保存</button>
                    <button class="slds-button slds-button_neutral" onclick={closeModal}>取消</button>
                </footer>
            </div>
        </section>
        <div class="slds-backdrop slds-backdrop_open"></div>
    </template>
</template>