schangxiang@126.com
2025-09-10 3d43ffa3152110b7823f9fa6320c08a6ae02358a
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
<template>
  <div class="scan-container">
    <el-card class="scan-card no-print">
      <div slot="header" class="clearfix">
        <span>灯光校验扫描出库</span>
      </div>
      <el-row>
        <el-col :span="12">
          <el-form ref="form" :model="formData" label-width="120px" class="scan-form">
            <el-form-item label="快递号/出库单号">
              <el-input ref="expressCode" v-model="formData.expressCode" class="input-300" autofocus @keyup.native.enter.stop="getOrderData"></el-input>
              <span class="sub-item">
                <span class="sub-label">物料校验:</span>
                <el-switch v-model="formData.isValidateProductCode" @change="onIsValidateProductCodeChange"></el-switch>
              </span>
            </el-form-item>
            <el-form-item label="物料条码">
              <el-input ref="productModel" v-model="formData.productModel" :disabled="!formData.isValidateProductCode" class="input-300" @keyup.native.enter.stop="checkPackingBarcode"></el-input>
            </el-form-item>
            <el-form-item label="扫描数量">
              <el-input-number ref="scanQty" v-model="formData.scanQty" :min="0" :disabled="!formData.isValidateProductCode" controls-position="right" class="input-120" @change="setScanQty"></el-input-number>
              <span class="sub-item hidden">
                <span class="sub-label">称重:</span>
                <el-input-number v-model="formData.weight" :min="0" controls-position="right" class="input-105"></el-input-number>
              </span>
            </el-form-item>
            <el-form-item>
              <el-button type="primary" @click="lightLabel">点亮标签</el-button>
              <el-button type="success" @click="partialSave">复核提交</el-button>
              <el-button @click="onReset">重置</el-button>
            </el-form-item>
          </el-form>
        </el-col>
        <el-col :span="12">
          <el-form ref="form" :model="formData" label-width="120px" class="scan-form">
            <el-form-item label="灯光服务器地址">
              <el-input v-model="serverIP" class="w-300" @keyup.native.enter.stop="getWayBillPrinter"></el-input>
            </el-form-item>
            <el-form-item>
              <el-button type="primary" @click="connectSocketServer('showMsg')">连接服务器</el-button>
              <el-tag :type="serverStatus==='已连接服务器'?'success':'danger'">{{ serverStatus }}</el-tag>
            </el-form-item>
          </el-form>
        </el-col>
      </el-row>
    </el-card>
    <el-card class="scan-card body-no-padding no-print">
      <div slot="header" class="clearfix">
        <span class="padding-top-10">扫描结果</span>
        <el-button type="text" class="floatRight" @click="setting.visible=true">字段设置</el-button>
      </div>
      <el-table ref="scan-table" :data="tableData" :row-class-name="rowClass" stripe style="width: 100%" class="scan-table" @row-dblclick="setCurrent">
        <template v-for="(item, index) in setting.fields">
          <template v-if="['unFinishedQuantity','finishedQuantity'].indexOf(item.prop)>=0">
            <el-table-column v-if="item.visible" :key="index" :prop="item.prop" :label="item.label" :width="item.width">
              <template slot-scope="scope">
                <template v-if="!formData.isValidateProductCode">
                  <el-input-number v-model="scope.row[item.prop]" :min="0" :max="scope.row['Quantity']" size="mini" class="w-100pc" controls-position="right" @change="rowChangeQty(item.prop, scope.row)"></el-input-number>
                </template>
                <template v-else>
                  {{ scope.row[item.prop] }}
                </template>
              </template>
            </el-table-column>
          </template>
          <template v-else-if="'rowStatus'.indexOf(item.prop)>=0">
            <el-table-column v-if="item.visible" :key="index" :prop="item.prop" :label="item.label" :width="item.width">
              <template slot-scope="scope">
                <template>
                  <el-tag v-if="scope.row.rowStatus==='已确认'" type="success" effect="dark">
                    {{ scope.row.rowStatus }}
                  </el-tag>
                  <el-tag v-else type="warning">
                    {{ scope.row.rowStatus }}
                  </el-tag>
                </template>
              </template>
            </el-table-column>
          </template>
          <template v-else-if="'scanWeight'.indexOf(item.prop)>=0">
            <el-table-column v-if="item.visible" :key="index" :prop="item.prop" :label="item.label" :width="item.width">
              <template slot-scope="scope">
                <template>
                  <el-input v-model="scope.row[item.prop]" size="mini" class="w-100pc"></el-input>
                </template>
              </template>
            </el-table-column>
          </template>
          <template v-else>
            <el-table-column v-if="item.visible" :key="index" :prop="item.prop" :label="item.label" :width="item.width">
            </el-table-column>
          </template>
        </template>
      </el-table>
    </el-card>
    <scan-setting-dialog ref="setting-dialog" :visible.sync="setting.visible" :fields="setting.fields" :name="setting.name">
    </scan-setting-dialog>
 
    <!-- 显示打印模板 -->
    <print v-if="formData.isOuter_PrintBill" ref="printRef" :ids="''+formData.order_Id" type="express"></print>
    <!-- 显示打印装箱清单模板 -->
    <PrintPacking v-if="formData.isOuter_Packinglist" ref="printRef" :ids="''+formData.order_Id" :code="''+formData.caseNumber" type="express"></PrintPacking>
 
    <!--声音文件-->
    <audio ref="sound_error" controls="controls" style="display:none;">
      <source src="@/assets/sounds/error2.mp3" type="audio/mpeg" />
    </audio>
    <audio ref="sound_correct" controls="controls" style="display:none;">
      <source src="@/assets/sounds/feixin.mp3" type="audio/mpeg" />
    </audio>
    <audio controls="controls" style="display:none;">
      <source ref="sound_scan" src="@/assets/sounds/saomiao.wav" type="audio/mpeg" />
    </audio>
 
  </div>
</template>
 
<script>
import print from "@/views/sys/print/base2";
import PrintPacking from "@/views/sys/print/base3";
import YrtScanMixins from "@/components/common/yrtScanMixins.vue";
import ScanSettingDialog from "@/components/common/components/scanSettingDialog.vue";
 
export default {
  name: "outbound-scan-out-light",
  components: {
    print,
    PrintPacking,
    ScanSettingDialog
  },
  mixins: [YrtScanMixins],
  data() {
    return {
      formData: {
        order_Id: 0,
        orderCode: null,
        expressCode: null,
        caseNumber: null,
        productModel: null, // 包装条码
        scanQty: 0, // 扫描数量
        quantityOuter: null,
        weight: 0, // 称重
        isValidateProductCode: false, // 是否校验物料
        isOuter_PrintBill: false,
        isOuter_Packinglist: false,
        wrapperBarcode: ""
      },
      // 扫描数据
      tableData: [],
      // radio2: 1,
      // 当前正在扫描的数据
      currentRow: {},
      // 已经找到的数据
      existRows: [],
      // 装箱方式:0:常规扫描,1:一品一箱,2:多品一箱
      caseMode: 0,
      // 一次扫描的数量
      scanCount: 1,
      // 装箱新增行
      caseNewRows: [],
      // 配置参数
      config: {
        // 自动生成上架单
        in_generateShelve: true,
        // 是否启用装箱操作
        in_caseNumber: false,
        // 支持一品多码
        sku_productToMultiBarcode: true,
        // 打印面单
        outer_printBill: true,
        // 打印装箱清单
        Outer_Packinglist: true
      },
      /** ***********************
       * websockect
       * *********************** */
      // 服务器IP
      serverIP: null,
      ws: null,
      // 服务器状态
      serverStatus: "未连接",
      // 扫描列设置对话框参数
      setting: {
        visible: false,
        name: "outbound-scan-out-light",
        fields: [
          {
            prop: "productModel",
            label: "条形码",
            visible: true,
            width: 130,
            order: 1
          },
          {
            prop: "quantityOrder",
            label: "物料数量",
            visible: true,
            width: 80,
            order: 2
          },
          {
            prop: "quantityOuter",
            label: "已出库数量",
            visible: true,
            width: 90,
            order: 3
          },
          {
            prop: "finishedQuantity",
            label: "已扫描数量",
            visible: true,
            width: 90,
            order: 4
          },
          {
            prop: "unFinishedQuantity",
            label: "未扫描数量",
            visible: true,
            width: 90,
            order: 5
          },
          {
            prop: "productCode",
            label: "物料编号",
            visible: false,
            width: 130,
            order: 6
          },
          {
            prop: "purchasePrice",
            label: "单价",
            visible: false,
            width: 80,
            order: 11
          },
          {
            prop: "positionName",
            label: "货位",
            visible: true,
            width: 120,
            order: 8
          },
          {
            prop: "rowStatus",
            label: "出库状态",
            visible: true,
            width: 80,
            order: 8
          },
          {
            prop: "productSpec",
            label: "物料规格",
            visible: true,
            width: 80,
            order: 12
          },
          {
            prop: "weight",
            label: "单位毛重",
            visible: false,
            width: 80,
            order: 13
          },
          {
            prop: "sumTotalWeight",
            label: "合计重量",
            visible: false,
            width: 80,
            order: 14
          },
          {
            prop: "scanWeight",
            label: "已扫重量",
            visible: false,
            width: 80,
            order: 15
          },
          {
            prop: "productName",
            label: "物料名称",
            visible: true,
            width: null,
            order: 16
          }
        ]
      }
    };
  },
  computed: {
    // 服务器地址
    serverDomain: function() {
      return "ws://" + this.serverIP + ":2888/";
    }
  },
  activated() {
    const isValidateProductCode = localStorage["out_isValidateProductCode"];
    if (isValidateProductCode) {
      this.formData.isValidateProductCode = isValidateProductCode === "true";
    }
  },
  mounted() {
    this.getConfig();
 
    this.serverIP = localStorage.getItem("serverIP");
    // 连接灯光系统
    this.connectSocketServer();
    setInterval(() => {
      if (!this.ws || this.ws.readyState === 2 || this.ws.readyState === 3) {
        this.connectSocketServer();
      }
    }, 20 * 1000);
 
    // 字段设置
    const setting = localStorage[this.setting.name + "-setting"];
    if (setting) {
      this.setting.fields = JSON.parse(setting);
    }
  },
  methods: {
    // 连接服务器
    connectSocketServer(type) {
      const userInfo = this.common.getUserInfo();
      const support = "MozWebSocket" in window ? "MozWebSocket" : "WebSocket" in window ? "WebSocket" : null;
      localStorage.setItem("serverIP", this.serverIP);
 
      if (support == null) {
        alert("Your browser cannot support WebSocket!");
        return;
      }
 
      if (this.ws) {
        this.ws.close();
      }
 
      // 0 (CONNECTING), 1 (OPEN), 2 (CLOSING),3 (CLOSED)
      if (!this.ws || this.ws.readyState === 2 || this.ws.readyState === 3) {
        this.ws = new window[support](this.serverDomain);
      } else {
        this.$message.warning("已连接,无需重复连接");
      }
 
      this.ws.onerror = function(e) {
        // console.log(e);
      };
 
      this.ws.onmessage = evt => {
        var data = JSON.parse(evt.data);
        if (data.action === "closeLabelLight") {
          this.tableData.forEach(item => {
            if (item.orderList_Id === data.rowId) {
              item.rowStatus = "已确认";
            }
          });
        }
      };
 
      // when the connection is established, this method is called
      this.ws.onopen = () => {
        var msg = {};
        msg.action = "setOnline";
        msg.fromMobile = userInfo.mobile;
        this.ws.send(JSON.stringify(msg));
        this.serverStatus = "已连接服务器";
        if (type === "showMsg") {
          if (this.serverStatus === "已连接服务器") {
            this.$message.success(this.serverStatus);
          } else {
            this.$message.error(this.serverStatus);
          }
        }
      };
 
      // when the connection is closed, this method is called
      this.ws.onclose = () => {
        this.serverStatus = "未连接服务器";
      };
    },
    // 点亮标签
    lightLabel() {
      const positionNames = [];
      this.tableData
        .filter(item => {
          return item.finishedQuantity > 0 && item.rowStatus !== "已确认";
        })
        .forEach(item => {
          const _positionNames = item.positionName.split(",");
 
          for (const pn of _positionNames) {
            positionNames.push({
              rowId: item.orderList_Id,
              positionName: pn,
              qty: item.finishedQuantity,
              status: "未点亮"
            });
          }
        });
      if (!positionNames.length) {
        this.$message.error("没有可提交的数据");
        return;
      }
      if (!this.ws || this.ws.readyState === 2 || this.ws.readyState === 3) {
        this.$message.warning("未连接灯光系统,无法点亮");
        return;
      }
 
      const dataInfo = {
        action: "SendCode",
        dataList: positionNames
      };
      this.ws.send(JSON.stringify(dataInfo));
    },
 
    // 是否校验物料切换
    onIsValidateProductCodeChange() {
      localStorage["out_isValidateProductCode"] = this.formData.isValidateProductCode;
      this.tableData.forEach(item => {
        if (this.formData.isValidateProductCode) {
          item.finishedQuantity = 0;
          item.unFinishedQuantity = item.quantityOrder;
        } else {
          item.finishedQuantity = item.unFinishedQuantity;
          item.unFinishedQuantity = 0;
        }
      });
    },
    // 获得配置参数
    getConfig() {
      var keys = Object.keys(this.config).join(",");
      var url = "/api/sys/param/getConfig";
      var params = {
        openNodeApi: true,
        keys: keys
      };
      var callback = res => {
        this.common.showMsg(res);
        this.valueList = res.data;
        // 获得参数值列表,将数字转换为对象
        res.data.forEach(item => {
          var value03 = item.value03;
          if (this.common.isNumber(item.value03)) {
            value03 = parseInt(item.value03);
          }
          this.$set(this.config, item.Value02, !!value03);
        });
      };
      var target = this.$refs["settings"];
      this.common.ajax(url, params, callback, target);
    },
    // 获取扫描数据
    getOrderData() {
      var expressCode = this.formData.expressCode;
      if (!expressCode) {
        this.$message.error("快递单号不能为空!");
        return;
      }
      var url = "/api/outbound/outScan/getOrderData";
      var params = {
        openNodeApi: true,
        expressCode: expressCode
      };
      var callBack = res => {
        this.common.showMsg(res);
        if (res.result) {
          this.tableData = res.data.map(row => {
            row.unFinishedQuantity = row.quantityOrder;
            row.finishedQuantity = 0;
            row.sortIndex = 0;
            row.rowStatus = "未确认";
            if (this.formData.isValidateProductCode) {
              row.finishedQuantity = 0;
            } else {
              row.finishedQuantity = row.unFinishedQuantity;
              row.unFinishedQuantity = 0;
            }
 
            return row;
          });
          if (this.config.outer_printBill === true) {
            this.formData.order_Id = this.tableData[0].order_Id;
          }
          this.formData.caseNumber = res.Dynamic;
          // 条码框获得焦点
          if (this.formData.isValidateProductCode) {
            this.$refs.productModel.focus();
            this.$refs.productModel.select();
          } else {
            this.$refs.expressCode.focus();
            this.$refs.expressCode.select();
          }
        } else {
          this.onReset();
        }
      };
      this.common.ajax(url, params, callBack, true);
    },
    // 判断扫描包装条码
    checkPackingBarcode() {
      this.checkPackingProductModel();
      // var code = this.formData.productModel;
      // if (!code) {
      //   this.$refs.productModel.focus();
      //   this.$refs.productModel.select();
      //   this.$message.error("物料条码不能为空!");
      //   return;
      // }
      // var isExistsProduct = false; // 物料是否在明细存在
      // this.tableData.forEach(rowData => {
      //   if (!rowData) return true;
      //   if (this.checkBarcodeExist(code, rowData)) {
      //     this.checkProductCode(this);
      //     this.$refs.productModel.focus();
      //     this.$refs.productModel.select();
      //     isExistsProduct = true;
      //     return false;
      //   }
      // });
      // if (!isExistsProduct) {
      //   this.$messager.error("物料条码[" + code + "]不存在!", "red");
      //   return;
      // }
    },
    // 校验SKU条码
    checkProductCode() {
      var code = this.formData.productModel;
      code = code.trim();
      if (!code) return;
      var isItemFinished = true; // 当前物料是否全部扫描完成
      var isExistsProduct = false; // 物料是否在明细存在
      this.tableData.forEach(rowData => {
        if (this.checkBarcodeExist(code, rowData)) {
          isExistsProduct = true;
          var finishedQuantity = rowData.finishedQuantity;
          var unFinishedQuantity = rowData.unFinishedQuantity;
          if (unFinishedQuantity > 0) {
            isItemFinished = false;
            if (this.caseMode === 1) {
              // 一品一箱
              this.addRow_1(rowData);
            } else if (this.caseMode === 2) {
              // 多品一箱
              this.addRow_2(rowData);
            } else {
              rowData.finishedQuantity = finishedQuantity + 1;
              rowData.unFinishedQuantity = unFinishedQuantity - 1;
              rowData.caseNumber = this.formData.caseNumber;
              this.currentRow = rowData;
              // 设置排序,进行置顶
              this.currentRow.sortIndex = 1;
            }
            return false;
          }
          return true;
        }
      });
      if (!isExistsProduct) {
        this.$message({
          showClose: true,
          message: "物料[" + code + "]在该订单不存在!",
          type: "warning"
        });
        return;
      }
      if (isItemFinished) {
        this.$message({
          showClose: true,
          message: "物料[" + code + "]已经扫描完成,不需要再扫描!",
          type: "warning"
        });
        return;
      }
      // 扫描置顶
      this.tableData = this.tableData.sort(function(a, b) {
        return b.sortIndex - a.sortIndex;
      });
 
      this.tableData.forEach(element => {
        element.sortIndex = 0;
      });
    },
    // 判断扫描是否完成
    checkFinished() {
      var isFinished = true;
      this.tableData.forEach(rowData => {
        var unFinishedQuantity = rowData.unFinishedQuantity;
        if (unFinishedQuantity > 0) {
          isFinished = false;
        }
      });
      return isFinished;
    },
    // 判断条码是否存在
    checkBarcodeExist(barcode, rowData) {
      var isExists = false;
      if (!rowData) return false;
 
      if (this.config.sku_productToMultiBarcode) {
        // 支持一品多码
        isExists =
          barcode === rowData.productModel ||
          barcode === rowData.RelationCode ||
          barcode === rowData.RelationCode2 ||
          barcode === rowData.RelationCode3 ||
          barcode === rowData.RelationCode4 ||
          barcode === rowData.RelationCode5;
      } else {
        isExists = barcode === rowData.productModel;
      }
 
      return isExists;
    },
    // 改变明细扫描数量
    rowFinishedQtyChange(row) {
      row.unFinishedQuantity = Math.Round(row.quantityOrder - row.quantityOuter - row.finishedQuantity, 4);
    },
    // 设置扫描数量
    setScanCount(barcode, count, isAdd) {
      if (!count || count < 0) {
        this.$message({
          showClose: true,
          message: '"数量不正确',
          type: "warning"
        });
        return;
      }
      if (!barcode) {
        this.$message({
          showClose: true,
          message: '"条码不能为空',
          type: "warning"
        });
        return;
      }
    },
    // 行样式
    rowClass({ row, rowIndex }) {
      if (this.currentRow === row) {
        return "row-active";
      }
    },
    // 复核提交,封箱(部分打包),然后计算已打包数量,设置 新快递单号为 “可用”
    partialSave() {
      var expressCode = this.formData.expressCode; // 快递单号
      var wrapperBarcode = this.formData.wrapperBarcode; // 包材条码
      var newExpressCode = ""; // 新快递单号
      var weight = this.formData.weight; // 重量
      if (!expressCode) {
        this.$message({
          showClose: true,
          message: "快递单号不能为空!",
          type: "warning"
        });
        return;
      }
 
      var dataArray = this.tableData
        .filter(item => {
          return item.finishedQuantity > 0;
        })
        .map(rowData => {
          return {
            caseNumber: rowData.caseNumber,
            order_Id: rowData.order_Id,
            orderCode: rowData.orderCode,
            orderList_Id: rowData.orderList_Id,
            scanCount: rowData.finishedQuantity,
            totalWeight: rowData.scanWeight,
            weight: rowData.weight
          };
        });
      if (!dataArray.length) {
        this.$message({
          showClose: true,
          message: "请先扫描条码!",
          type: "error"
        });
        return;
      }
 
      var existRows = this.tableData.some(item => {
        return item.rowStatus === "未确认" && item.finishedQuantity > 0;
      });
 
      const doWork = noTip => {
        const url = "/api/outbound/outScan/orderPartialSaveScan";
        const params = {
          openNodeApi: true,
          expressCode: expressCode,
          wrapperBarcode: wrapperBarcode,
          newExpressCode: newExpressCode,
          data: dataArray,
          weight: weight
        };
        const callBack = res => {
          this.common.showMsg(res);
          if (res.result) {
            this.onReset();
            // 自动打印,系统配置中心开启,且勾选打印复选框
            if (this.config.outer_printBill === true && this.formData.isOuter_PrintBill) {
              this.$refs.printRef.lodopPrint();
            }
          }
        };
        this.common.ajax(url, params, callBack, true);
      };
 
      if (existRows) {
        this.$confirm("已扫描出库数量未确认,是否强制出库?", "提示", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        })
          .then(() => {
            doWork(true);
          })
          .catch(() => {
            this.$message({
              type: "info",
              message: "已取消"
            });
          });
      } else {
        doWork();
      }
    },
    // 重置
    onReset() {
      const isValidateProductCode = localStorage["out_isValidateProductCode"];
 
      this.formData = {
        order_Id: 0,
        orderCode: null,
        expressCode: null,
        caseNumber: null,
        productModel: null, // 包装条码
        scanQty: 0, // 扫描数量
        quantityOuter: null,
        weight: 0, // 称重
        isValidateProductCode: isValidateProductCode === "true", // 是否校验物料
        isOuter_PrintBill: false,
        isOuter_Packinglist: false,
        wrapperBarcode: ""
      };
      // 扫描数据
      this.tableData = [];
      // radio2: 1,
      // 当前正在扫描的数据
      this.currentRow = {};
      // 已经找到的数据
      this.existRows = [];
      // 装箱方式:0:常规扫描,1:一品一箱,2:多品一箱
      this.caseMode = 0;
      // 一次扫描的数量
      this.scanCount = 1;
      // 装箱新增行
      this.caseNewRows = [];
      // 配置参数
      this.config = {
        // 自动生成上架单
        in_generateShelve: true,
        // 是否启用装箱操作
        in_caseNumber: false,
        // 支持一品多码
        sku_productToMultiBarcode: true,
        // 打印面单
        outer_printBill: true,
        // 打印装箱清单
        Outer_Packinglist: true
      };
      this.$refs.expressCode.focus();
    }
  }
};
</script>
 
<style lang="scss" scoped>
@import "../../../styles/scan.scss";
</style>