buli
2023-04-20 44f866419cde0ff12a91d9c1d92daf9e36b063e1
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
<template>
 
    <template if:true={showcount}>
        <div style="border: 1px solid #D4D4D4;border-radius:5px;">
            <div style="border-top: 3px solid #51606E;;border-bottom: 1px solid #D4D4D4;padding:3px;">
                <div>
                    <p style="font-size: 19px;float:left"><strong>库存盘点</strong></p>
                </div>
                <div style="margin-left:400px;">
                    <lightning-button label="盘点确认" title="盘点确认" onclick={saveConfirm}></lightning-button></td>
                </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;">
                        <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></td>
                                    <td align="right">Barcode</td>
                                    <td style="width:600px"><lightning-textarea name="Barcode" label=""
                                            onchange={handleChange}></lightning-textarea></td>
                                    <td align="right"></td>
                                    <td></td>
                                    <td><lightning-button label="Barcode" title="Barcode录入" onclick={barcodeEntrys}
                                            style="width: 150px;"></lightning-button>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </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>
                    <div style="padding:10px;">
 
                        <div style="height: 300px;">
                            <template if:true={showTable}>
 
                                <c-lex-custom-lightning-datatable key-field="ProdId" data={data} columns={columns}
                                    ondiffreasons={diffreasons} onrowselection={getSelectedRows}
                                    selected-rows={selectedRows}>
                                </c-lex-custom-lightning-datatable>
                            </template>
                            <!-- 加载框 -->
 
                            <div if:true={casesSpinner} class="slds-spinner_inline spinner-padding"
                                style="margin-top:10px;">
                                <lightning-spinner variant="brand" alternative-text="Loading Cases" size="medium">
                                </lightning-spinner>
                            </div>
 
                        </div>
 
                    </div>
                </div>
            </div>
 
 
            <div style="border: 1px solid #D4D4D4;border-radius:5px;margin-bottom:7px;margin-top:50px">
                <div style="border-top: 3px solid #51606E;border-bottom: 1px solid #D4D4D4;padding:3px;">
                    <table>
                        <tr>
                            <td>
                                <p style="font-size: 16px;"><strong>调整明细</strong></p>
                            </td>
                            <template if:true={showbutton}>
                                <td align="center"> <lightning-button label="下载本次盘点库存变化明细" title="下载本次盘点库存变化明细"
                                        onclick={exportData} style="width: 150px;"></lightning-button></td>
                            </template>
                        </tr>
                    </table>
                </div>
 
                <div style="padding:10px;">
                    <template if:true={showTable}>
                        <c-lwc-datatable-utility records={codPageRecords} total-records={codPageRecords.length}
                            columns={column} key-field="Id" show-search-box="true"
                            max-row-selection={codPageRecords.length} onpaginatorchange={handlePaginatorChange}>
                        </c-lwc-datatable-utility>
                    </template>
 
 
                </div>
            </div>
        </div>
    </template>
 
 
    <template if:true={EditAble}>
        <div style="border: 1px solid #D4D4D4;border-radius:5px;">
            <div style="border-top: 3px solid #51606E;;border-bottom: 1px solid #D4D4D4;padding:3px;">
                <div style="border: 1px solid #D4D4D4;border-radius:5px;">
                    <div style="border-top: 3px solid #51606E;;border-bottom: 1px solid #D4D4D4;padding:6px;">
                        <p style="font-size: 19px;"><strong>盘点情况一览</strong></p>
 
                    </div>
                    <div class="acc-container">
                        <lightning-record-edit-form object-api-name="Consumable_order__c" record-id={conId}>
                            <lightning-layout multiple-rows="true">
                                <!-- <template if:true={isSummonsFlag}> -->
                                <lightning-layout-item class="hehe-layoutItem" size="4">
                                    <lightning-output-field field-name="Name"></lightning-output-field>
                                </lightning-layout-item>
                                <lightning-layout-item class="hehe-layoutItem" size="4">
                                    <lightning-output-field field-name="Inventory_date__c"></lightning-output-field>
                                </lightning-layout-item>
                                <lightning-layout-item class="hehe-layoutItem" size="4">
                                </lightning-layout-item>
                                <!-- </template> -->
                            </lightning-layout>
                        </lightning-record-edit-form>
                    </div>
                </div>
            </div>
 
            <lightning-accordion allow-multiple-sections-open class="slds-m-around_medium"
                active-section-name={activeSections}>
                <lightning-accordion-section name="dataExpand" label="盘点明细">
                    <table class="list" border="0" cellpadding="0" cellspacing="0" id="example">
                        <thead>
                            <tr class="headerRow">
                                <th>消耗品名称</th>
                                <th>库存</th>
                                <th>盘点</th>
                                <th>丢失</th>
                                <th>寻回</th>
                                <th>差异原因</th>
                            </tr>
                        </thead>
                        <tbody>
                            <template for:each={detailData} for:item="m">
                                <tr key={m.Prod.Name__c}>
                                    <td>{m.Prod.Name__c}</td>
                                    <td>{m.orderdetails1.Count_Sum__c}</td>
                                    <td>{m.orderdetails1.inventory_sum__c}</td>
                                    <td>{m.orderdetails1.Diff__c}</td>
                                    <td>{m.orderdetails1.Product_Refind__c}</td>
                                    <td>{m.orderdetails1.Lose_reason__c}</td>
                                </tr>
                            </template>
                        </tbody>
                    </table>
                </lightning-accordion-section>
            </lightning-accordion>
            <lightning-accordion allow-multiple-sections-open class="slds-m-around_medium"
                active-section-name={activeSections}>
                <lightning-accordion-section name="dataExpand" label="在库调整明细">
                    <table class="list" border="0" cellpadding="0" cellspacing="0" id="examples">
                        <thead>
                            <tr class="headerRow">
                                <th>消耗品名称</th>
                                <th>产品型号</th>
                                <th>差异原因</th>
                                <th>是否丢失</th>
                            </tr>
                        </thead>
                        <tbody>
                            <template for:each={adjustdata} for:item="m">
                                <tr key={m.Prod.Name__c}>
                                    <td>{m.Prod.Name__c}</td>
                                    <td>{m.Prod.Asset_Model_No__c}</td>
                                    <td>{m.orderdetails2.Lose_reason__c}</td>
                                    <td>{m.orderdetails1.Diff__c}</td>
                                    <td>{m.orderdetails1.Product_Refind__c}</td>
                                    <td>{m.orderdetails2.Lose_Flag__c}</td>
                                </tr>
                            </template>
                        </tbody>
                    </table>
 
                </lightning-accordion-section>
            </lightning-accordion>
        </div>
    </template>
</template>