binxie
2023-06-26 00e147ec892cb1e89d0698787a8c60da1014cdb7
force-app/main/default/lwc/lexinventoryViewLWC/lexinventoryViewLWC.html
@@ -1,61 +1,109 @@
<template>
    <template if:true={showSpinner}>
        <lightning-spinner size="medium" variant="brand"></lightning-spinner>
    </template>
    <div style="border: 1px solid #D4D4D4;border-radius:5px;">
        <div style="border-top: 3px solid #51606E;;border-bottom: 1px solid #D4D4D4;padding:3px;">
            <p style="font-size: 19px;"><strong>库存管理</strong></p>
        <!-- <lightning-spinner size="medium" variant="brand"></lightning-spinner> -->
        <div class="slds-spinner_container">
            <div
                role="status"
                class="slds-spinner slds-spinner_medium slds-spinner_brand"
            >
                <span class="slds-assistive-text">Loading</span>
                <div class="slds-spinner__dot-a"></div>
                <div class="slds-spinner__dot-b"></div>
            </div>
        </div>
        <div style="padding:10px;">
            <div style="border: 1px solid #D4D4D4;border-radius:5px;margin-bottom:7px;">
                <div style="border-top: 3px solid #51606E;border-bottom: 1px solid #D4D4D4;padding:3px;">
                    <lightning-button style="margin: 5px;" label="库存盘点" title="库存盘点"
    </template>
    <c-common-toast></c-common-toast>
    <div style="border: 1px solid #d4d4d4; border-radius: 5px">
        <div
            style="
                border-top: 3px solid #51606e;
                border-bottom: 1px solid #d4d4d4;
                padding: 3px;
            "
        >
            <!-- <p style="font-size: 18px;"><strong>库存管理</strong></p> -->
            <lightning-layout>
                <lightning-layout-item padding="around-small">
                    <p style="font-size: 18px">
                        <strong>库存管理</strong>
                    </p>
                </lightning-layout-item>
            </lightning-layout>
        </div>
        <div style="padding: 10px">
            <div
                style="
                    border: 1px solid #d4d4d4;
                    border-radius: 5px;
                    margin-bottom: 7px;
                "
            >
                <div
                    style="
                        border-top: 3px solid #51606e;
                        border-bottom: 1px solid #d4d4d4;
                        padding: 10px;
                    "
                >
                    <!-- <lightning-button variant="brand" class = 'lexstyle' style="margin:12px;" label="库存盘点" title="库存盘点"
                        onclick={inventoryCount}></lightning-button>
                    <lightning-button style="margin: 5px;" label="过期库存销存" title="过期库存销存"
                    <lightning-button variant="brand" class = 'lexstyle' style="margin: 12px;" label="过期库存销存" title="过期库存销存"
                        onclick={handleExpired}></lightning-button>
                    <lightning-button style="margin: 5px;" label="拆盒" title="拆盒" onclick={removeBox}></lightning-button>
                    <lightning-button style="margin: 5px;" label="取消拆盒" title="取消拆盒"
                        onclick={cancelremoveBox}></lightning-button>
                    <!-- <table>
                        <colgroup>
                            <col width="160px"/>
                            <col width="100px"/>
                            <col width="10px"/>
                            <col width="70px"/>
                            <col width="100px"/>
                            <col width="10px"/>
                            <col width="90px"/>
                            <col width="100px"/>
                            <col width="10px"/>
                            <col width="85px"/>
                            <col width="100px"/>
                            <col width="10px"/>
                            <col width="70px"/>
                            <col width="100px"/>
                        </colgroup>
                        <tbody>
                            <tr>
                                <td style="width:15%;"></td>
                                <td style="width:15%;"><lightning-button label="库存盘点" title="库存盘点" onclick={inventoryCount} ></lightning-button></td>
                                <td></td>
                                <td></td>
                                <td style="width:15%"><lightning-button label="过期库存销存"  title="过期库存销存" onclick={handleExpired} ></lightning-button></td>
                                <td></td>
                                <td></td>
                                <td style="width:15%;"><lightning-button label="拆盒" title="拆盒" onclick={removeBox} ></lightning-button></td>
                                <td></td>
                                <td></td>
                                <td style="width:15%;"><lightning-button label="取消拆盒" title="取消拆盒" onclick={handleClick}></lightning-button></td>
                            </tr>
                        </tbody>
                </table> -->
                    <lightning-button variant="brand" class = 'lexstyle' style="margin: 12px;" label="拆盒" title="拆盒" onclick={removeBox}></lightning-button>
                    <lightning-button variant="brand" class = 'lexstyle' style="margin: 12px;" label="取消拆盒" title="取消拆盒"
                        onclick={cancelremoveBox}></lightning-button> -->
                    <button
                        style="margin-left: 5px"
                        class="slds-button slds-button_neutral slds-button_stretch lexBorder"
                        label="库存盘点"
                        onclick={inventoryCount}
                    >
                        库存盘点
                    </button>
                    <button
                        class="slds-button slds-button_neutral slds-button_stretch lexButtoun"
                        label="过期库存销存"
                        style="margin-left: 60px"
                        onclick={handleExpired}
                    >
                        过期库存销存
                    </button>
                    <button
                        class="slds-button slds-button_neutral slds-button_stretch lexButtoun"
                        label="拆盒"
                        style="margin-left: 60px"
                        onclick={removeBox}
                    >
                        拆盒
                    </button>
                    <button
                        class="slds-button slds-button_neutral slds-button_stretch lexButtoun"
                        label="取消拆盒"
                        style="margin-left: 60px"
                        onclick={cancelremoveBox}
                    >
                        取消拆盒
                    </button>
                </div>
            </div>
            <div style="border: 1px solid #D4D4D4;border-radius:5px;margin-bottom:7px;">
                <div style="border-top: 3px solid #51606E;border-bottom: 1px solid #D4D4D4;padding:3px;">
                    <table>
            <div
                style="
                    border: 1px solid #d4d4d4;
                    border-radius: 5px;
                    margin-bottom: 7px;
                    margin-top: 30px;
                "
            >
                <div
                    style="
                        border-top: 3px solid #51606e;
                        border-bottom: 1px solid #d4d4d4;
                        padding: 3px;
                        height: 115px;
                    "
                >
                    <table style="margin-top: 10px">
                        <colgroup>
                            <col width="160px" />
                            <col width="100px" />
@@ -76,119 +124,168 @@
                        </colgroup>
                        <tbody>
                            <tr>
                                <td style="width: 21%;">
                                    <lightning-input type="text" name="Name" label="消耗品名称" value={Name}
                                        variant="label-inline" onchange={dataChange}
                                        data-field="Name"></lightning-input>
                                <td style="width: 10px"></td>
                                <td style="width: 250px">
                                    <div
                                        style="width: 90px; margin-left: 12px"
                                        class="searchName"
                                    >
                                        消耗品名称
                                    </div>
                                </td>
                                <td style="width: 21%;">
                                    <lightning-combobox name="CategoryThree" label="第3分类" value={value}
                                        placeholder="请选择..." options={category3Options} variant="label-inline"
                                        data-field="CategoryThree" onchange={dataChange}></lightning-combobox>
                                <td style="width: 21%">
                                    <lightning-input
                                        class="searchName"
                                        type="text"
                                        name="Name"
                                        label="消耗品名称"
                                        value={Name}
                                        variant="label-hidden"
                                        onchange={dataChange}
                                        data-field="Name"
                                    ></lightning-input>
                                </td>
                                <td style="width: 21%;">
                                    <lightning-combobox name="CategoryFour" label="第4分类" value={value}
                                        placeholder="请选择..." options={category4Options} variant="label-inline"
                                        data-field="CategoryFour" onchange={dataChange}></lightning-combobox>
                                <td style="width: 150px">
                                    <div
                                        style="width: 90px; text-align: center"
                                        class="searchName"
                                    >
                                        第3分类
                                    </div>
                                </td>
                                <td style="width: 21%;">
                                    <lightning-combobox name="CategoryFive" label="第5分类" value={value}
                                        placeholder="请选择..." options={category5Options} variant="label-inline"
                                        data-field="CategoryFive" onchange={dataChange}></lightning-combobox>
                                <td style="width: 21%">
                                    <lightning-combobox
                                        class="inputFont"
                                        style="margin-left: 5px"
                                        name="CategoryThree"
                                        label="第3分类"
                                        value={value}
                                        placeholder="请选择..."
                                        options={category3Options}
                                        variant="label-hidden"
                                        data-field="CategoryThree"
                                        onchange={dataChange}
                                    ></lightning-combobox>
                                </td>
                                <td style="width: 3%;"></td>
                                <td style="width: 8%;">
                                    <lightning-button label="消耗品搜索" onclick={searchOrderDetail}></lightning-button>
                                <td style="width: 150px">
                                    <div
                                        style="width: 90px; text-align: center"
                                        class="searchName"
                                    >
                                        第4分类
                                    </div>
                                </td>
                                <td style="width: 8%;">
                                    <lightning-button label="清空" onclick={clearAll}></lightning-button>
                                <td style="width: 21%">
                                    <lightning-combobox
                                        class="inputFont"
                                        name="CategoryFour"
                                        label="第4分类"
                                        value={value}
                                        placeholder="请选择..."
                                        options={category4Options}
                                        variant="label-hidden"
                                        data-field="CategoryFour"
                                        onchange={dataChange}
                                    ></lightning-combobox>
                                </td>
                                <td style="width: 150px">
                                    <div
                                        style="width: 90px; text-align: center"
                                        class="searchName"
                                    >
                                        第5分类
                                    </div>
                                </td>
                                <td style="width: 21%">
                                    <lightning-combobox
                                        class="inputFont"
                                        name="CategoryFive"
                                        label="第5分类"
                                        value={value}
                                        placeholder="请选择..."
                                        options={category5Options}
                                        variant="label-hidden"
                                        data-field="CategoryFive"
                                        onchange={dataChange}
                                    ></lightning-combobox>
                                </td>
                                <td style="width: 1%"></td>
                            </tr>
                        </tbody>
                    </table>
                    <br />
                    <div style="float: right; margin-right: 10px">
                        <button
                            class="slds-button slds-button_neutral slds-button_stretch lexsearchStyle"
                            label="消耗品搜索"
                            onclick={searchOrderDetail}
                        >
                            消耗品搜索
                        </button>
                        <button
                            style="margin-left: 10px"
                            class="slds-button slds-button_neutral slds-button_stretch lexclearStyle"
                            label="清空"
                            onclick={clearAll}
                        >
                            清空
                        </button>
                    </div>
                </div>
            </div>
            <div style="border: 1px solid #D4D4D4;border-radius:5px;margin-bottom:7px;">
                <div style="border-top: 3px solid #51606E;border-bottom: 1px solid #D4D4D4;padding:3px;">
                    <p style="font-size: 16px;"><strong>库存详情</strong></p>
            <div
                style="
                    border: 1px solid #d4d4d4;
                    border-radius: 5px;
                    margin-bottom: 7px;
                "
            >
                <div
                    style="
                        border-top: 3px solid #51606e;
                        border-bottom: 1px solid #d4d4d4;
                        padding: 3px;
                    "
                >
                    <!-- <p style="font-size: 16px;"><strong>库存详情</strong></p> -->
                    <lightning-layout>
                        <lightning-layout-item padding="around-small">
                            <p style="font-size: 18px">
                                <strong>库存详情</strong>
                            </p>
                        </lightning-layout-item>
                    </lightning-layout>
                </div>
                <div style="padding:10px;">
                <div style="padding: 10px">
                    <template if:true={showTable}>
                        <lightning-datatable key-field="id" data={data} columns={columns}
                            default-sort-direction={defaultSortDirection} sorted-direction={sortDirection}
                            sorted-by={sortedBy} onsort={onHandleSort} hide-checkbox-column={hidecheckboxcolumn}
                            style="word-wrap:break-word; word-break:break-all; ">
                        </lightning-datatable>
                        <c-lex-custom-lightning-datatable
                            key-field="id"
                            data={data}
                            columns={columns}
                            default-sort-direction={defaultSortDirection}
                            sorted-direction={sortDirection}
                            sorted-by={sortedBy}
                            onsort={onHandleSort}
                            hide-checkbox-column={hidecheckboxcolumn}
                            class="wrapped-header-datatable"
                        >
                        </c-lex-custom-lightning-datatable>
                    </template>
                    <c-paginator onprevious={handlePrevious} onnext={handleNext} onpageschange={handlePageschange}
                        onfirst={handleFirst} onlast={handleLast} page-size-options={pageSizeOptions}
                        previous-button-disabled={previousButtonDisabled} next-button-disabled={nextButtonDisabled}
                        record-start={recordStart} record-end={recordEnd} total-records={totalRecords}></c-paginator>
                    <!-- <table class="list" border="0" cellpadding="0" cellspacing="0" id="example">
                        <thead>
                            <tr class="headerRow">
                                <th>消耗品名称</th>
                                <th>第3分类</th>
                                <th>第4分类</th>
                                <th>第5分类</th>
                                <th>规格</th>
                                <th>单位</th>
                                <th>注册证编码号</th>
                                <th>注册证效期</th>
                                <th>CFDA状态</th>
                                <th>使用期限</th>
                                <th>有效期内库存</th>
                                <th>过期库存</th>
                                <template if:true={hasHos}>
                                    <th>医院特价</th>
                                </template>
                            </tr>
                        </thead>
                        <tbody>
                            <template for:each={pageRecords} for:item="m">
                                <tr key={m.Prod.Name__c}>
                                    <td align="center">{m.Prod.Name__c}</td>
                                    <td align="center">{m.Prod.Category3__c}</td>
                                    <td align="center">{m.Prod.Category4__c}</td>
                                    <td align="center">{m.Prod.Category5__c}</td>
                                    <td align="center">{m.packing_list}</td>
                                    <td align="center">{m.BoxPiece}</td>
                                    <td align="center">{m.approbation_No}</td>
                                    <td align="center">{m.expiration_Date}</td>
                                    <td align="center">{m.Prod.SFDA_Status__c}</td>
                                    <td align="center">{m.guaranteeperiod}</td>
                                    <td align="center">{m.limitCount}</td>
                                    <td align="center">{m.overlimitCount}</td>
                                    <template if:true={hasHos}>
                                        <td>
                                            <template if:true={m.hospitalSpecialOffer}>
                                                √
                                            </template>
                                        </td>
                                    </template>
                                </tr>
                            </template>
                        </tbody>
                    </table> -->
                    <!-- <div style="height: 300px;">
                        <lightning-datatable
                                key-field="id"
                                data={data}
                                columns={columns}
                                hide-checkbox-column
                                default-sort-direction={defaultSortDirection}
                                sorted-direction={sortDirection}
                                sorted-by={sortedBy}
                                onsort={onHandleSort}>
                        </lightning-datatable>
                    </div> -->
                    <c-paginator
                        onprevious={handlePrevious}
                        onnext={handleNext}
                        onpageschange={handlePageschange}
                        onfirst={handleFirst}
                        onlast={handleLast}
                        page-size-options={pageSizeOptions}
                        previous-button-disabled={previousButtonDisabled}
                        next-button-disabled={nextButtonDisabled}
                        record-start={recordStart}
                        record-end={recordEnd}
                        total-records={totalRecords}
                    ></c-paginator>
                </div>
            </div>
        </div>
    </div>
</template>