小小儁爺
2024-11-13 1d0cf4bc401520992b57acd806c7d4afb55adaec
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
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
<template>
  <div>
    <div class="body" :style="{height:mainHeight+'px'}">
      <!--      <div class="bodyTopButtonGroup" style="justify-content: space-between">-->
      <!--        <el-button  type="primary" icon="el-icon-circle-plus-outline" @click="add('add')">新增</el-button>-->
      <!--        <el-button  icon="el-icon-download" @click="upload">导入</el-button>-->
      <!--      </div>-->
 
      <div
        class="bodyTopFormGroup"
        style="margin-top: 10px"
        :style="{height:(mainHeight-20)+'px'}"
      >
        <div style="display: flex;align-items: center">
          <i
            class="el-icon-s-operation"
            :style="{color:$store.state.settings.theme,fontSize:'14px'}"
          />
          <div style="font-size: 14px;margin-left: 5px;color: #a7a7a7">
            查询项
          </div>
          <!--          <div v-if="!isPermission" style="font-size: 14px;margin-left: 10px;color: red">-->
          <!--            当前用户在ERP系统中不存在或未授权,无法入库提交-->
          <!--          </div>-->
        </div>
        <el-form
          ref="form"
          :model="form"
          label-width="100px"
          inline
          style="display: flex;"
        >
          <div class="elForm" style="display: flex;flex-direction: column;justify-content: flex-start">
            <div style="display: flex">
              <el-form-item label="生产车间" required style=" display: flex;">
                <el-select
                  v-model="form.wkshopcode"
                  :popper-append-to-body="false"
                  filterable
                  style="width: 200px"
                  placeholder="请选择"
                  @change="getProductInHouseOrderSearch"
                >
                  <el-option
                    v-for="item in WorkShopArr"
                    :key="item.torg_code"
                    :label="item.torg_name"
                    :value="item.torg_code"
                  />
                </el-select>
              </el-form-item>
              <el-form-item
                label="生产订单"
                style="display: flex;"
              >
                <el-input
                  v-model="form.erpordercode"
                  placeholder="请输入"
                  style="width: 200px"
                />
              </el-form-item>
              <el-form-item
                label="生产工单"
                style="display: flex;"
              >
                <el-input
                  v-model="form.mesordercode"
                  placeholder="请输入"
                  style="width: 200px"
                />
              </el-form-item>
              <el-form-item
                label="销售订单"
                style="display: flex;"
              >
                <el-input
                  v-model="form.saleOrderCode"
                  readonly
                  style="width: 200px"
                />
              </el-form-item>
            </div>
 
            <div style="display: flex">
              <el-form-item label="产品编码" style=" display: flex;">
                <el-input v-model="form.partcode" placeholder="请输入" style="width: 200px" />
              </el-form-item>
              <el-form-item label="产品名称" style=" display: flex;">
                <el-input v-model="form.partname" style="width: 200px" placeholder="请输入" />
              </el-form-item>
              <el-form-item label="产品规格" style=" display: flex;">
                <el-input v-model="form.partspec" style="width: 200px" placeholder="请输入" />
              </el-form-item>
            </div>
 
          </div>
          <div
            class="bodySearchReset"
          >
            <el-button type="primary" icon="el-icon-search" @click="getProductInHouseOrderSearch">查询</el-button>
            <el-button type="info" icon="el-icon-refresh" @click="reset">重置</el-button>
          </div>
        </el-form>
 
        <div style="display: flex;align-items: center">
          <i
            class="el-icon-s-operation"
            :style="{color:$store.state.settings.theme,fontSize:'14px'}"
          />
          <div style="font-size: 14px;margin-left: 5px;color: #a7a7a7">
            选择项
          </div>
        </div>
        <el-form
          ref="form"
          :model="form"
          label-width="100px"
          inline
          style="display: flex;"
        >
          <div class="elForm" style="justify-content: flex-start">
            <el-form-item label="单据日期" style=" display: flex;">
              <el-date-picker
                v-model="form.hbdate"
                style="width: 200px"
                readonly
                type="date"
                placeholder="选择日期"
              />
            </el-form-item>
            <el-form-item label="单据编号" style=" display: flex;">
              <el-input
                v-model="form.hbillno"
 
                placeholder="请输入"
                style="width: 200px"
              />
              <!--              readonly-->
            </el-form-item>
 
            <el-form-item label="入库仓库" required style=" display: flex;">
              <el-select
                v-model="form.stockcode"
                :popper-append-to-body="false"
                filterable
                style="width: 200px"
                placeholder="请选择"
                @change="stockCodeChange"
              >
                <el-option
                  v-for="item in stockcodeArr"
                  :key="item.code"
                  :label="item.name"
                  :value="item.code"
                />
              </el-select>
            </el-form-item>
 
            <!--            <el-form-item label="入库部门" required style=" display: flex;">-->
            <!--              <el-select-->
            <!--                v-model="form.deptno"-->
            <!--                :popper-append-to-body="false"-->
            <!--                filterable-->
            <!--                style="width: 200px"-->
            <!--                placeholder="请选择"-->
            <!--              >-->
            <!--                <el-option-->
            <!--                  v-for="item in departmentArr"-->
            <!--                  :key="item.code"-->
            <!--                  :label="item.name"-->
            <!--                  :value="item.code"-->
            <!--                />-->
            <!--              </el-select>-->
            <!--            </el-form-item>-->
 
          </div>
          <div
            class="bodySearchReset"
            :style="{marginLeft:$store.state.app.sidebar.opened? $store.state.settings.menuIsHorizontal?'15%':'3%':'10%'}"
          >
            <el-button
 
              type="primary"
              icon="el-icon-s-promotion"
              :disabled="$store.state.app.buttonIsDisabled"
              @click="submit"
            >入库提交
            </el-button>
            <!--            <el-button  type="info" icon="el-icon-refresh" @click="reset">重置</el-button>-->
          </div>
        </el-form>
        <div style="display: flex;align-items: center">
          <i
            class="el-icon-s-operation"
            :style="{color:$store.state.settings.theme,fontSize:'14px'}"
          />
          <div style="font-size: 14px;margin-left: 5px;color: #a7a7a7">
            信息栏
          </div>
        </div>
        <div style="padding:0 10px;position: relative">
          <!--          <el-button-->
          <!--            -->
          <!--            type="primary"-->
          <!--            style="position: absolute;right: 10px;top: 10px;z-index: 10"-->
          <!--            icon="el-icon-s-promotion"-->
          <!--            @click=""-->
          <!--          >入库提交-->
          <!--          </el-button>-->
          <el-tabs style="margin-top: 10px;" @tab-click="tabClick">
            <el-tab-pane label="明细">
              <div class="elTableDiv" style="margin: 0 auto 10px;">
                <el-table
                  ref="tableDataRef"
                  class="tableFixed"
                  :data="tableDataDetail"
                  :height="(tableHeight-25)+'px'"
                  border
                  :row-class-name="tableRowClassName"
                  :style="{width: 100+'%',height:(tableHeight-25)+'px',}"
                  highlight-current-row
                  :header-cell-style="this.$headerCellStyle"
                  :cell-style="this.$cellStyle"
                  @selection-change="handleSelectionChange"
                >
                  <!--                  @cell-dblclick="cellDblclick"-->
                  <!--                  @cell-click="cellClick"-->
                  <el-table-column
                    type="selection"
                    width="50"
                    fixed
                  />
                  <el-table-column
                    type="index"
                    width="50"
                    fixed
                    label="序号"
                  />
 
                  <!--                  <el-table-column-->
                  <!--                    prop="stockcode"-->
                  <!--                    label="仓库"-->
                  <!--                    width="160"-->
                  <!--                    show-tooltip-when-overflow-->
                  <!--                  >-->
                  <!--                    <template slot-scope="{row}">-->
                  <!--                      <div>{{ row.stockcode ? stockcodeArr.find(i => i.code === row.stockcode).name : '/' }}</div>-->
                  <!--                      &lt;!&ndash;                      <div&ndash;&gt;-->
                  <!--                      &lt;!&ndash;                        v-if="!(row.index === tabClickIndex && tabClickLabel === '仓库')"&ndash;&gt;-->
                  <!--                      &lt;!&ndash;                      >&ndash;&gt;-->
                  <!--                      &lt;!&ndash;                        {{ row.stockcode ? stockcodeArr.find(i => i.code === row.stockcode).name : '/' }}&ndash;&gt;-->
                  <!--                      &lt;!&ndash;                      </div>&ndash;&gt;-->
                  <!--                      &lt;!&ndash;                      <el-select&ndash;&gt;-->
                  <!--                      &lt;!&ndash;                        v-if="row.index === tabClickIndex && tabClickLabel === '仓库'"&ndash;&gt;-->
                  <!--                      &lt;!&ndash;                        v-model="row.stockcode"&ndash;&gt;-->
                  <!--                      &lt;!&ndash;                        placeholder="请选择"&ndash;&gt;-->
                  <!--                      &lt;!&ndash;                      >&ndash;&gt;-->
                  <!--                      &lt;!&ndash;                        <el-option&ndash;&gt;-->
                  <!--                      &lt;!&ndash;                          v-for="item in stockcodeArr"&ndash;&gt;-->
                  <!--                      &lt;!&ndash;                          :key="item.code"&ndash;&gt;-->
                  <!--                      &lt;!&ndash;                          :label="item.name"&ndash;&gt;-->
                  <!--                      &lt;!&ndash;                          :value="item.code"&ndash;&gt;-->
                  <!--                      &lt;!&ndash;                        />&ndash;&gt;-->
                  <!--                      &lt;!&ndash;                      </el-select>&ndash;&gt;-->
                  <!--                    </template>-->
                  <!--                  </el-table-column>-->
                  <!--                  <el-table-column-->
                  <!--                    prop="inbarcode"-->
                  <!--                    label="入库条码"-->
                  <!--                    width="160"-->
                  <!--                    show-tooltip-when-overflow-->
                  <!--                  />-->
                  <el-table-column
                    prop="stockcode"
                    label="入库仓库"
                    width="160"
                    show-tooltip-when-overflow
                  >
                    <template slot-scope="{row}">
                      <!--                      <div v-if="row.stockcode">{{ row.stockcode }}</div>-->
                      <!--                      <div v-else>/</div>-->
                      <el-select
                        v-model="row.stockcode"
                        placeholder="请选择"
                        @change="val=>stockCodeRowChange(val,row)"
                      >
                        <el-option
                          v-for="item in stockcodeArr"
                          :key="item.code"
                          :label="item.name"
                          :value="item.code"
                        />
                      </el-select>
 
                    </template>
                  </el-table-column>
 
                  <el-table-column
                    prop="saleOrderCode"
                    label="销售单号"
                    width="160"
                    show-tooltip-when-overflow
                  >
                    <template slot-scope="{row}">
                      <div v-if="row.saleOrderCode">{{ row.saleOrderCode }}</div>
                      <div v-else>/</div>
                    </template>
                  </el-table-column>
 
                  <el-table-column
                    prop="m_po"
                    label="订单编号"
                    width="160"
                    show-tooltip-when-overflow
                  >
                    <template slot-scope="{row}">
                      <div v-if="row.m_po">{{ row.m_po }}</div>
                      <div v-else>/</div>
                    </template>
                  </el-table-column>
                  <el-table-column
                    prop="wo_code"
                    label="工单编号"
                    width="160"
                    show-tooltip-when-overflow
                  />
                  <el-table-column
                    prop="partcode"
                    label="产品编码"
                    width="160"
                    show-tooltip-when-overflow
                  />
                  <el-table-column
                    prop="partname"
                    label="产品名称"
                    width="160"
                    show-tooltip-when-overflow
                  />
                  <el-table-column
                    prop="partspec"
                    label="产品规格"
                    width="160"
                    show-tooltip-when-overflow
                  >
                    <template slot-scope="{row}">
                      <div v-if="row.partspec">{{ row.partspec }}</div>
                      <div v-else>/</div>
                    </template>
                  </el-table-column>
 
                  <el-table-column
                    prop="initname"
                    label="单位名称"
                    width="160"
                    show-tooltip-when-overflow
                  >
                    <template slot-scope="{row}">
                      <div v-if="row.unitname">{{ row.unitname }}</div>
                      <div v-else>/</div>
                    </template>
                  </el-table-column>
 
                  <el-table-column
                    prop="wkshp_name"
                    label="车间名称"
                    width="160"
                    show-tooltip-when-overflow
                  >
                    <template slot-scope="{row}">
                      <div v-if="row.wkshp_name">{{ row.wkshp_name }}</div>
                      <div v-else>/</div>
                    </template>
                  </el-table-column>
 
                  <el-table-column
                    prop="stepname"
                    label="工序名称"
                    width="160"
                    show-tooltip-when-overflow
                  >
                    <template slot-scope="{row}">
                      <div v-if="row.stepname">{{ row.stepname }}</div>
                      <div v-else>/</div>
                    </template>
                  </el-table-column>
 
                  <el-table-column
                    prop="qty"
                    label="订单数量"
                    min-width="95"
                    fixed="right"
                    show-tooltip-when-overflow
                  >
                    <template slot-scope="{row}">
                      <div v-if="row.qty">{{ row.qty }}</div>
                      <div v-else>/</div>
                    </template>
                  </el-table-column>
                  <el-table-column
                    prop="plan_qty"
                    label="工单数量"
                    min-width="95"
                    fixed="right"
                    show-tooltip-when-overflow
                  />
                  <el-table-column
                    prop="good_qty"
                    label="完工数量"
                    min-width="95"
                    fixed="right"
                    show-tooltip-when-overflow
                  />
                  <el-table-column
                    prop="inhouseqty"
                    label="已入库数量"
                    min-width="95"
                    fixed="right"
                    show-tooltip-when-overflow
                  />
                  <el-table-column
                    prop="stinhouseqty"
                    label="待入库数量"
                    min-width="130"
                    fixed="right"
                  >
                    <!--                    <template slot-scope="{row}">-->
                    <!--                      <el-input-number v-model="row.stinhouseqty" :min="0" :max="row.good_qty" size="small" />-->
                    <!--                    </template>-->
                  </el-table-column>
                </el-table>
 
              </div>
            </el-tab-pane>
            <!--            <el-tab-pane label="汇总">-->
            <!--              <div class="elTableDiv" style="margin: 0 auto 10px;">-->
            <!--                <el-table-->
            <!--                  ref="tableDataRef"-->
            <!--                  class="tableFixed"-->
            <!--                  :data="tableDataSummary"-->
            <!--                  :height="(tableHeight-25)+'px'"-->
            <!--                  border-->
            <!--                  :row-class-name="tableRowClassName2"-->
            <!--                  :style="{width: 100+'%',height:(tableHeight-25)+'px',}"-->
            <!--                  highlight-current-row-->
            <!--                  :header-cell-style="this.$headerCellStyle"-->
            <!--                  :cell-style="this.$cellStyle"-->
            <!--                >-->
            <!--                  <el-table-column-->
            <!--                    type="index"-->
            <!--                    width="50"-->
            <!--                    fixed-->
            <!--                    label="序号"-->
            <!--                  />-->
            <!--                  &lt;!&ndash;                  <el-table-column&ndash;&gt;-->
            <!--                  &lt;!&ndash;                    prop="stockcode"&ndash;&gt;-->
            <!--                  &lt;!&ndash;                    label="仓库"&ndash;&gt;-->
            <!--                  &lt;!&ndash;                    width="110"&ndash;&gt;-->
            <!--                  &lt;!&ndash;                  >&ndash;&gt;-->
            <!--                  &lt;!&ndash;                    <template slot-scope="{row}">&ndash;&gt;-->
            <!--                  &lt;!&ndash;                      <div>{{ stockcodeArr.find(i => i.code === row.stockcode).name }}</div>&ndash;&gt;-->
            <!--                  &lt;!&ndash;                    </template>&ndash;&gt;-->
            <!--                  &lt;!&ndash;                  </el-table-column>&ndash;&gt;-->
            <!--                  &lt;!&ndash;                    <template slot-scope="{row}">&ndash;&gt;-->
            <!--                  &lt;!&ndash;                      <div v-if="row.stockname">{{ row.stockname }}</div>&ndash;&gt;-->
            <!--                  &lt;!&ndash;                      <div v-else>/</div>&ndash;&gt;-->
            <!--                  &lt;!&ndash;                    </template>&ndash;&gt;-->
 
            <!--                  &lt;!&ndash;                  </el-table-column>&ndash;&gt;-->
            <!--                  &lt;!&ndash;                  <el-table-column&ndash;&gt;-->
            <!--                  &lt;!&ndash;                    prop="inbarcode"&ndash;&gt;-->
            <!--                  &lt;!&ndash;                    label="入库条码"&ndash;&gt;-->
            <!--                  &lt;!&ndash;                    width="160"&ndash;&gt;-->
            <!--                  &lt;!&ndash;                    show-tooltip-when-overflow&ndash;&gt;-->
            <!--                  &lt;!&ndash;                  />&ndash;&gt;-->
            <!--                  &lt;!&ndash;                  <el-table-column&ndash;&gt;-->
            <!--                  &lt;!&ndash;                    prop="m_po"&ndash;&gt;-->
            <!--                  &lt;!&ndash;                    label="订单编号"&ndash;&gt;-->
            <!--                  &lt;!&ndash;                    width="160"&ndash;&gt;-->
            <!--                  &lt;!&ndash;                    show-tooltip-when-overflow&ndash;&gt;-->
            <!--                  &lt;!&ndash;                  >&ndash;&gt;-->
            <!--                  &lt;!&ndash;                    <template slot-scope="{row}">&ndash;&gt;-->
            <!--                  &lt;!&ndash;                      <div v-if="row.m_po">{{ row.m_po }}</div>&ndash;&gt;-->
            <!--                  &lt;!&ndash;                      <div v-else>/</div>&ndash;&gt;-->
            <!--                  &lt;!&ndash;                    </template>&ndash;&gt;-->
            <!--                  &lt;!&ndash;                  </el-table-column>&ndash;&gt;-->
            <!--                  &lt;!&ndash;                  <el-table-column&ndash;&gt;-->
            <!--                  &lt;!&ndash;                    prop="wo_code"&ndash;&gt;-->
            <!--                  &lt;!&ndash;                    label="工单编号"&ndash;&gt;-->
            <!--                  &lt;!&ndash;                    width="160"&ndash;&gt;-->
            <!--                  &lt;!&ndash;                    show-tooltip-when-overflow&ndash;&gt;-->
            <!--                  &lt;!&ndash;                  />&ndash;&gt;-->
            <!--                  <el-table-column-->
            <!--                    prop="partcode"-->
            <!--                    label="产品编码"-->
            <!--                    min-width="160"-->
            <!--                    show-tooltip-when-overflow-->
            <!--                  />-->
            <!--                  <el-table-column-->
            <!--                    prop="partname"-->
            <!--                    label="产品名称"-->
            <!--                    min-width="160"-->
            <!--                    show-tooltip-when-overflow-->
            <!--                  />-->
            <!--                  <el-table-column-->
            <!--                    prop="partspec"-->
            <!--                    label="产品规格"-->
            <!--                    min-width="160"-->
            <!--                    show-tooltip-when-overflow-->
            <!--                  >-->
            <!--                    <template slot-scope="{row}">-->
            <!--                      <div v-if="row.stockname">{{ row.stockname }}</div>-->
            <!--                      <div v-else>/</div>-->
            <!--                    </template>-->
            <!--                  </el-table-column>-->
 
            <!--                  <el-table-column-->
            <!--                    prop="qty"-->
            <!--                    label="订单数量"-->
            <!--                    min-width="95"-->
 
            <!--                    show-tooltip-when-overflow-->
            <!--                  >-->
            <!--                    <template slot-scope="{row}">-->
            <!--                      <div v-if="row.qty">{{ row.qty }}</div>-->
            <!--                      <div v-else>/</div>-->
            <!--                    </template>-->
            <!--                  </el-table-column>-->
            <!--                  &lt;!&ndash;                  <el-table-column&ndash;&gt;-->
            <!--                  &lt;!&ndash;                    prop="plan_qty"&ndash;&gt;-->
            <!--                  &lt;!&ndash;                    label="工单数量"&ndash;&gt;-->
            <!--                  &lt;!&ndash;                    min-width="95"&ndash;&gt;-->
            <!--                  &lt;!&ndash;                    fixed="right"&ndash;&gt;-->
            <!--                  &lt;!&ndash;                    show-tooltip-when-overflow&ndash;&gt;-->
            <!--                  &lt;!&ndash;                  />&ndash;&gt;-->
            <!--                  <el-table-column-->
            <!--                    prop="good_qty"-->
            <!--                    label="完工数量"-->
            <!--                    min-width="95"-->
 
            <!--                    show-tooltip-when-overflow-->
            <!--                  />-->
            <!--                  <el-table-column-->
            <!--                    prop="inhouseqty"-->
            <!--                    label="已入库数量"-->
            <!--                    min-width="95"-->
 
            <!--                    show-tooltip-when-overflow-->
            <!--                  />-->
            <!--                  <el-table-column-->
            <!--                    prop="stinhouseqty"-->
            <!--                    label="可入库数量"-->
            <!--                    min-width="95"-->
 
            <!--                    show-tooltip-when-overflow-->
            <!--                  />-->
            <!--                </el-table>-->
            <!--              </div>-->
            <!--            </el-tab-pane>-->
          </el-tabs>
        </div>
 
      </div>
 
    </div>
 
  </div>
</template>
 
<script>
 
import { PrentOrganizationNoCompany, WareHouse } from '@/api/GeneralBasicData'
import {
  DeptSelectData,
  ProductInHouseOrderCodeSearch,
  ProductInHouseOrderSearch,
  ProductInHouseOrderSeave, TProductInHouseOrderSpSeave
} from '@/api/WorkOrder'
import { TSecLocaTree } from '@/api/basicSettings'
import { handleDatetime, handleDatetime2 } from '@/utils/global'
 
export default {
  name: 'ProductWarehouse2',
  components: {},
  data() {
    return {
      mainHeight: 0,
      tableHeight: 0,
      form: {
        hbillno: '', // 入库单号
        incbit: '', // 流水号
        hbdate: new Date(), // 入库单日期
 
        saleordercode: '', // 销售单号
        wkshopcode: '', // 生产车间
        erpordercode: '', // 订单编号
        mesordercode: '', // 工单编号
        partcode: '', // 产品编码
        partname: '', // 产品名称
        partspec: '', // 规格型号
 
        deptno: '', // 入库部门
        saleOrderCode: '', // 销售订单
        stockcode: '' // 入库仓库
 
      },
 
      tableDataDetail: [], // 明细表
      multipleSelection: [],
      stockcodeArr: [], // 入库仓库数组
      WorkShopArr: [], // 生产车间数组
      departmentArr: [], // 入库部门
 
      tabClickIndex: null, // 点击的单元格
      tabClickLabel: '', // 当前点击的列名
 
      tableDataSummary: [] // 汇总表
 
    }
  },
  watch: {},
  created() {
  },
  mounted() {
    window.addEventListener('resize', this.getHeight)
    this.getHeight()
 
    this.getPrentOrganizationNoCompany()
    this.getTSecLocaTree()
    this.getProductInHouseOrderCodeSearch()
    // this.getDeptSelectData()
 
    // this.getProductInHouseOrderSearch()
  },
  methods: {
    // 获取入库部门
    async getDeptSelectData() {
      const { data: res } = await DeptSelectData()
      this.departmentArr = res
    },
    // 获取单据编号(入库单号)、流水号
    async getProductInHouseOrderCodeSearch() {
      const { data: res } = await ProductInHouseOrderCodeSearch({ rightcode: '0605' })
      this.form.hbillno = res[0]
      this.form.incbit = res[1]
    },
    // 获取仓库信息
    async getTSecLocaTree() {
      const { data: res } = await WareHouse()
      this.stockcodeArr = res
      // const { data: res } = await TSecLocaTree()
      // this.stockcodeArr = res.filter(i => i.depth === 0)// 层级为0的  是仓库
    },
    // 获取车间信息
    async getPrentOrganizationNoCompany() {
      const { data: res } = await PrentOrganizationNoCompany()
      this.WorkShopArr = res
    },
    // 获取大列表查询
    async getProductInHouseOrderSearch() {
      const data = {
        saleordercode: this.form.saleordercode, // 销售单号
        wkshopcode: this.form.wkshopcode, // 生产车间
        erpordercode: this.form.erpordercode, // 订单编号
        mesordercode: this.form.mesordercode, // 工单编号
        partcode: this.form.partcode, // 产品编码
        partname: this.form.partname, // 产品名称
        partspec: this.form.partspec // 规格型号
 
      }
      const { data: res } = await ProductInHouseOrderSearch(data)
      this.tableDataDetail = res
    },
 
    // 入库仓库值改变时
    stockCodeChange(val) {
      this.multipleSelection.forEach(i => {
        i.stockcode = val
        i.stockid = this.stockcodeArr.find(j => j.code === val).noid
      })
    },
 
    stockCodeRowChange(val, row) {
      row.stockid = this.stockcodeArr.find(i => i.code === val).noid
    },
 
    // 页签切换
    tabClick() {
 
    },
    // 复选框切换
    handleSelectionChange(val) {
      this.multipleSelection = val
    },
    // 递交
    async  submit() {
      // usercode
      // console.log(localStorage.getItem('username'))
 
      if (this.multipleSelection.length === 0) {
        return this.$message.info('请先勾选单据!')
      }
      if (this.form.stockcode === '') {
        return this.$message.info('入库仓库不能为空!')
      }
      if (this.multipleSelection.find(i => i.stockid === '' || i.stockid === null)) {
        return this.$message.info('表格内入库仓库不能为空!')
      }
 
      const TableDetailData = []
      this.multipleSelection.forEach((i, index) => {
        TableDetailData.push({
          'hbillno': this.form.hbillno, // 入库单号
          'wocode': i.wo_code, // 工单号
          'rownumber': (index + 1).toString(), // 行号
          'sourceVoucherId': i.mpoid.toString(), // 来源单据id
          'sourceVoucherCode': i.m_po, // 来源单据编号
          'SourceVoucherDetailId': i.sbid.toString(), // 来源单据明细id
          'inbarcode': i.inbarcode, // 入库条码
          'idinventory': i.materiel_id.toString(), // 存货id
          'inventorycode': i.partcode, // 存货编码
          'idunit': i.unitid.toString(), // 计量单位id
          'unitcode': i.unitcode, // 计量单位编码
          idwarehouse: i.stockid.toString(), // 仓库id
          warehousecode: i.stockcode, // 仓库编码
          'saleOrderId': i.saleOrderid.toString(), // 销售单id
          'saleOrderCode': i.saleOrderCode, // 销售单号
          'saleOrderDetailId': i.saleOrderDetailId.toString(), // 销售单明细id
          'qty': i.good_qty.toString(), // 入库数量
          'stepcode': i.step_code, // 工序编码
          'style': i.style, // 报工类型:B(自制) S(外协)
          'status': '0' // 入库单状态:0(未审核) 1(已审核)
        })
      })
 
      const data = {
        'rightcode': '0605', // 功能编号
        'incbit': this.form.incbit, // 流水号
        'TableData': [
          [
            {
              'hbillno': this.form.hbillno, // 入库单号
              'madedate': handleDatetime(this.form.hbdate) + ' 00:00:00', // 制单日期(年月日 00:00:00)
              'hbdate': this.multipleSelection[this.multipleSelection.length - 1].voucherdate,
 
              sourceVoucherId: [...new Set(this.multipleSelection.map(i => i.mpoid))].length > 1 ? '' : this.multipleSelection[0].mpoid,
              sourceVoucherCode: [...new Set(this.multipleSelection.map(i => i.m_po))].length > 1 ? '' : this.multipleSelection[0].m_po,
              saleOrderCode: [...new Set(this.multipleSelection.map(i => i.saleOrderCode))].length > 1 ? '' : this.multipleSelection[0].saleOrderCode,
 
              'iddepartment': this.multipleSelection[0].dept_id, // 部门id
              'departmentcode': this.multipleSelection[0].dept_code, // 部门编码
 
              'idwarehouse': this.stockcodeArr.find(i => i.code === this.form.stockcode).noid, // 仓库id
              'warehousecode': this.form.stockcode, // 仓库编码
              'status': '0', // 入库单状态:0(未审核) 1(已审核)
              PurchaseOrderCode: '', // 采购订单号
              'remark': '', // 备注
              'create_user': localStorage.getItem('username'), // 创建人员
              'create_date': handleDatetime2(new Date()),
              'check_user': '', // 审核人员
              'check_date': ''// 审核时间
            }
          ],
          TableDetailData// 表体
        ]
      }
 
      // console.log(JSON.stringify(data))
      const res = await TProductInHouseOrderSpSeave(data)
      if (res.code === '200') {
        this.$message.success('入库成功!')
        this.multipleSelection = []
        this.form.deptno = ''
        this.form.stockcode = ''
        await this.getProductInHouseOrderSearch()
        await this.getProductInHouseOrderCodeSearch()
      }
    },
    // 重置
    reset() {
      this.form.saleordercode = '' // 销售单号
      this.form.wkshopcode = '' // 生产车间
      this.form.erpordercode = ''// 订单编号
      this.form.mesordercode = ''// 工单编号
      this.form.partcode = ''// 产品编码
      this.form.partname = '' // 产品名称
      this.form.partspec = '' // 规格型号
    },
    // 获取页面高度
    getHeight() {
      this.$nextTick(() => {
        this.mainHeight = window.innerHeight - 85
        this.tableHeight = this.mainHeight - 255
        this.$refs.tableDataRef.doLayout()
      })
    },
    tableRowClassName({ row, rowIndex }) {
      // 把每一行的索引放进row
      row.index = rowIndex
      return 'custom-row'
    },
    tableRowClassName2({ row, rowIndex }) {
      return 'custom-row'
    }
  }
}
</script>
 
<!--公共页面样式-->
<style lang="scss" scoped>
$main_color: #42b983;
::v-deep .el-range__icon {
  line-height: 28px !important;
}
 
::v-deep .el-range-separator {
  line-height: 28px !important;
}
 
::v-deep .el-range-input {
  font-size: 14px;
}
 
::v-deep .el-range-separator {
  display: flex;
  justify-content: center;
  align-items: center;
}
 
::v-deep .el-button--text {
  font-size: 14px;
  cursor: pointer;
}
 
.el-icon-share, .el-icon-delete, .el-icon-edit-outline {
  color: $main_color;
  cursor: pointer;
}
 
.el-icon-edit-outline {
  margin-right: 15px;
}
 
::v-deep .el-button--primary, .el-button--default, .el-button--info {
  height: 34px;
  display: flex;
  align-items: center;
  padding: 0 15px;
}
 
::v-deep .el-button--primary {
  //background-color: $main_color !important;
}
 
::v-deep .el-button--default {
  background-color: #f8f8fa;
  border: none;
}
 
::v-deep .el-input__inner {
  height: 34px;
  line-height: 34px;
  //color: #a7a7a7;
}
 
::v-deep .el-dialog__body {
  padding: 20px 100px !important;
}
 
::v-deep .dialogVisibleRoles .el-dialog__body {
  padding: 20px 20px !important;
}
 
::v-deep .importPickerClass .el-dialog__body {
  padding: 20px 20px !important;
}
 
::v-deep .el-dialog__footer {
  display: flex;
  justify-content: flex-end;
}
 
::v-deep .el-table .caret-wrapper {
  transform: scale(0.8);
}
 
::v-deep .cell {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
 
::v-deep .el-table::before {
  height: 0;
}
 
::v-deep .el-table__body-wrapper {
  background-color: #f8f8fa;
}
 
::v-deep .el-table__body .el-table__row.hover-row td {
  background-color: #eaecef;
}
 
::v-deep .el-form--inline .el-form-item__label {
  color: #a7a7a7;
}
 
.body ::v-deep .el-divider {
  border: 1px solid #eee;
  width: 99%;
  margin: 10px auto;
}
 
.body ::v-deep .el-form-item {
  margin-bottom: 0;
}
 
.userDialogVisible ::v-deep .el-form-item {
  margin-bottom: 0;
}
 
::v-deep .el-select__caret {
  display: flex;
  align-items: center;
  justify-content: center;
}
 
.tableFixed {
  ::v-deep .el-table__fixed-right {
    height: 100% !important;
  }
 
  ::v-deep .el-table__fixed {
    height: 100% !important;
  }
}
 
::v-deep .el-tabs__item {
  padding-right: 0;
}
</style>
<style>
 
.el-table .custom-row {
  background: #f8f8fa;
}
</style>