333
schangxiang@126.com
2025-09-19 18966e02fb573c7e2bb0c6426ed792b38b910940
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
<template>
  <div ref="container" class="page-list-container">
    <!--数据Table-->
    
     
    
    <yrt-data-list :ref="dataListRef" :editor-ref="editorRef" :data-options="dataOptions" :fields.sync="dataListOptions.fields" :buttons="dataListOptions.buttons" :button-click="buttonClick" :data-list-selections.sync="dataListSelections" :auth-nodes="authNodes" @on-super-reset="onSuperReset">
       
      <template slot="common-column-slot" slot-scope="{ row, col }">
        
        <template v-if="col.prop == 'statusTexts'">
 
          <state-flow :load-options="stateLoadOptions" :where="{order_Id: row[dataOptions.idField]}">
            <template slot="content">
              <el-tag :color="setStatusBgColor(row[col.prop])" :style="setStatusColor(row[col.prop])" class="cursor-pointer">
                {{ row[col.prop] }}
              </el-tag>
            </template>
          </state-flow>
        </template>
         <!-- <el-button type="primary">主要按钮</el-button> -->
        <!--分拣状态字段-->
        <template v-else-if="col.prop == 'sortingStatus'">
          <template>
            <el-tag v-if="row[col.prop] == 1" color="#ffff33" style="color:black;border:0">
              {{ $refs[dataListRef].translateText( col.prop, row[col.prop], col.dropdown_Id ) }}
            </el-tag>
            <el-tag v-else-if="row[col.prop] == 2" color="#00ff99" style="color:black;border:0">
              {{ $refs[dataListRef].translateText( col.prop, row[col.prop], col.dropdown_Id ) }}
            </el-tag>
            <el-tag v-else-if="row[col.prop] == 3" color="#ff0000" style="color:black;border:0;color:#fff;">
              {{ $refs[dataListRef].translateText( col.prop, row[col.prop], col.dropdown_Id ) }}
            </el-tag>
            <el-tag v-else-if="row[col.prop] == 5" color="#6699FF" style="color:black;border:0;color:#fff;">
              {{ $refs[dataListRef].translateText( col.prop, row[col.prop], col.dropdown_Id ) }}
            </el-tag>
            <span v-else>
              {{ row[col.prop] }}
            </span>
          </template>
        </template>
        <template v-else-if="col.prop == 'statusText'">
          <template>
            <el-tag v-if="row[col.prop] == '待下架'" color="#ffff33" style="color:black;border:0">
              {{ $refs[dataListRef].translateText( col.prop, row[col.prop], col.dropdown_Id ) }}
            </el-tag>
            <el-tag v-else-if="row[col.prop] == '部分分配'" color="#6699FF" style="color:black;border:0">
              {{ $refs[dataListRef].translateText( col.prop, row[col.prop], col.dropdown_Id ) }}
            </el-tag>
            <el-tag v-else-if="row[col.prop] == '已分配'" color="#ff0000" style="color:black;border:0;color:#fff;">
              {{ $refs[dataListRef].translateText( col.prop, row[col.prop], col.dropdown_Id ) }}
            </el-tag>
            <el-tag v-else-if="row[col.prop] == 5" color="#6699FF" style="color:black;border:0;color:#fff;">
              {{ $refs[dataListRef].translateText( col.prop, row[col.prop], col.dropdown_Id ) }}
            </el-tag>
            <span v-else>
              {{ row[col.prop] }}
            </span>
          </template>
        </template>
        <!--连接字段-->
        <template v-else-if="col.prop == dataOptions.linkColumn">
          <el-link type="primary" @click.native="() => {linkEditor(row[dataOptions.idField]);}">{{ row[col.prop] }}</el-link>
        </template>
        <template v-else-if="col.options && col.options.dropdown_Id > 0">
          {{ $refs[dataListRef].translateText( col.prop, row[col.prop], col.options.dropdown_Id ) }}
        </template>
        <template v-else>
          <template v-if="['date', 'datetime'].indexOf(col.dataType)>=0 && col.formatter">
            {{ common.formatDate(row[col.prop], col.formatter) }}
          </template>
          <template v-else-if="['byte', 'int32', 'int64', 'decimal', 'double'].indexOf(col.dataType)>=0 && col.formatter">
            {{ common.formatNumber(row[col.prop], col.formatter) }}
          </template>
          <template v-else>
            {{ row[col.prop] }}
          </template>
        </template>
      </template>
    </yrt-data-list>
    <!--数据编辑器Editor-->
    <yrt-editor :ref="editorRef" :data-list-ref="dataListRef" v-bind="editorOptions" :data-options="dataOptions" :action.sync="editorOptions.action" :top.sync="editorOptions.top" :visible.sync="editorOptions.config.visible" :default-value="defaultValue" :detail-button-click="detailButtonClick" :auth-nodes="authNodes" :btn-read-only="btnReadOnly" :before-close="beforeClose" :use-detail-slot="['sortingStatus', 'lackStorage']" :on-save-before="onSaveBefore" :use-label-slot="useLabelSlot" @on-change="onChange" @on-item-click="(ref, val, itemData, field, formData)=>{onChange(ref, val, field, formData, itemData)}" @on-add-load-after="onAddLoadAfter" @on-edit-load-after="onEditLoadAfter" @on-detail-change="onDetailChange" @on-row-change="onRowChange" @on-load-dropdown-after="onLoadDropdownAfter" @on-save-after="onSaveAfter">
      <!--快递名称字段自定义标签插槽-->
      <template slot="label-expressCorpName">
        快递名
        <a href="javascript:;" style="color:blue;" @click="updateExpressCorp(1)">修改</a>
      </template>
      <template slot="label-expressCode">
        快递号
        <a href="javascript:;" style="color:blue;" @click="updateExpressCode(1)">修改</a>
      </template>
      <template slot="label-feeItem_Ids">
        一次性收费项
        <a href="javascript:;" style="color:blue;" @click="showFeeTtemPopup()">修改</a>
      </template>
      <!--自定义字段插槽-->
      <template slot="detail-column-slot" slot-scope="{ row, col }">
        <template v-if="col.prop == 'sortingStatus'">
          <detailstate-flow :load-options="stateLoadOptionsDetail" :where="{detailID: row.orderList_Id}">
            <template slot="content">
              <el-tag v-if="row[col.prop] == 1" color="#ffff33" style="color:black;border:0;cursor:pointer;">
                {{ $refs[dataListRef].translateText( col.prop, row[col.prop], col.dropdown_Id ) }}
              </el-tag>
              <el-tag v-else-if="row[col.prop] == 2" color="#00ff99" style="color:black;border:0;cursor:pointer;">
                {{ $refs[dataListRef].translateText( col.prop, row[col.prop], col.dropdown_Id ) }}
              </el-tag>
              <el-tag v-else-if="row[col.prop] == 4" color="green" style="color:black;border:0;color:#fff;cursor:pointer;">
                {{ $refs[dataListRef].translateText( col.prop, row[col.prop], col.dropdown_Id ) }}
              </el-tag>
              <el-tag v-else-if="row[col.prop] == 5" color="#6699FF" style="color:black;border:0;color:#fff;cursor:pointer;">
                {{ $refs[dataListRef].translateText( col.prop, row[col.prop], col.dropdown_Id ) }}
              </el-tag>
              <el-tag v-else-if="row[col.prop] == 3" color="#6699FF" style="color:black;border:0;color:#fff;cursor:pointer;">
                {{ $refs[dataListRef].translateText( col.prop, row[col.prop], col.dropdown_Id ) }}
              </el-tag>
              <el-tag v-else-if="row[col.prop] == 6" color="#6699FF" style="color:black;border:0;color:#fff;cursor:pointer;">
                {{ $refs[dataListRef].translateText( col.prop, row[col.prop], col.dropdown_Id ) }}
              </el-tag>
              <span v-else>
                {{ row[col.prop] }}
              </span>
            </template>
          </detailstate-flow>
        </template>
      </template>
      <!--自定义按钮插槽-->
      <template slot="footer-button-region" slot-scope="{ formData }">
        <!--自定义审核按钮-->
        <!-- <el-button :disabled="btnReadOnly.confirm" type="success" icon="el-icon-yrt-qiyong" @click.native="multiAuditing([formData])">审核</el-button>
        <el-button :disabled="btnReadOnly.sorting" type="success" icon="el-icon-yrt-shuaxin" @click.native="multiBatchSort([formData])">分拣</el-button> -->
      </template>
    </yrt-editor>
 
    <!--明细选择器-->
    <yrt-selector ref="selector-dialog" :config="selectorConfig" :visible.sync="selectorConfig.visible" @on-selected="onSelected"></yrt-selector>
    <!--物料库存选择器-->
    <yrt-selector ref="selector-position-dialog" :config="selectorPositionConfig" :visible.sync="selectorPositionConfig.visible" :url="selectorPositionConfig.url" @on-selected="onPositionSelected"></yrt-selector>
    <yrt-selector ref="selector-position-dialogs" :config="selectorPositionsConfig" :visible.sync="selectorPositionsConfig.visible" :url="selectorPositionsConfig.url" @on-selected="onPositionSelected"></yrt-selector>
    
  </div>
</template>
 
<script>
import baseLayout from '@/components/common/base-layout.vue'
import orderMixin from './components/order-mixin.vue' 
import orderMixinStatus from './components/order-mixin-status.vue'
import orderMixinSelect from './components/order-mixin-select.vue'  //这里面包含物料库存选择器 【Editby shaocx,2022-06-16】
import orderMixinEvent from './components/order-mixin-event.vue'
import orderMixinButton from './components/order-mixin-button.vue'
import yrtSelector from '@/components/common/yrtSelector.vue'
import stateFlow from '@/components/common/components/stateflow.vue'
import detailstateFlow from '@/components/common/components/detailstateflow.vue'
import detailRoleflow from '@/components/common/components/detailRoleflow.vue'
import ImportDialog from '@/components/common/components/import-common-dialog'
import orderAdd from './components/order-add.vue'
 
// import returnVue from "../../inbound/purchase/return.vue";
 
export default {
  name: 'outbound-sale-order-sd',
  components: {
    yrtSelector,
    stateFlow,
    detailstateFlow,
    detailRoleflow,
    ImportDialog,
    orderAdd
  },
  mixins: [baseLayout, orderMixin, orderMixinStatus, orderMixinSelect, orderMixinEvent, orderMixinButton],
  // 自定义处理权限函数
  doAuth(the) {
    // 判断当前版本是否拥有导入权限
    var authList = [{ name: '出库单批量导入', auth: 'allImport' }]
    const names = authList.map(item => {
      return item.name
    })
    the.common.isSaaSAuth(names, res => {
      authList.forEach(node => {
        let hasAuth = res.result
        if (hasAuth) {
          hasAuth = res.data.some(item => {
            return item.moduleName === node.name
          })
        }
        the.authNodes[node.auth] = hasAuth
      })
    })
  },
  data() {
    return {
      // 出库输送线ID
      transList: [12, 19, 30, 34, 51, 64, 67],
      taskForm: {
        outTransId: '',
        productStorage: 0,
        validQty: 0,
        orderType: 'SAP生产订单'
      },
      destinationList: [],
      ALLdestinationList: [],
      productList: [],
      aLLproductList: [],
      formLabelWidth: '120px',
      dialogFormVisible: false,
      // 明细拆分列表
      splitDetails: [],
      // 表单默认值,新建时用
      defaultValue: {
        statusID: 1,
        statusText: '待下架',
        consignor_Id: 30,
        consignorCode: 'HZ20180002',
        consignorName: '默认货主'
      },
      form: {
        storage_Id: null,
        consignor_Id: null,
        consignorName: null
      },
      storageNames: [],
      // 货主
      consignorNames: [],
      // 编辑页面主表标签使用插槽的字段
      useLabelSlot: ['expressCorpName', 'expressCode', 'feeItem_Ids'],
      sortingRuleForm: {
        productCode: '',
        positionName: '',
        batchNumber: '',
        produceDate: '',
        plateCode: '',
        singleSignCode: ''
      },
      winSortingRuleVisible: false,
      sortingRuleList: [],
      selectRuleRow: null,
      // 当前编辑数据
      formData: {
        storage_Id: 87,
        storageName: '立体库'
      },
      // 出库单导入对话框参数
      orderImportConfig: {
        // 显示导入对话框
        isShowDialog: false,
        title: '出库单批量导入',
        // 导入地址
        url: '/api/outbound/order/importExcel',
        // 模板地址
        templateUrl: 'https://auod-beijing.oss-cn-beijing.aliyuncs.com/node-wms/template/订单信息导入模板.xlsx'
      },
      // 出库区域
      orderExitList: [
        {
          key: 1,
          value: '西边焊接区'
        },
        {
          key: 2,
          value: '西边分拣区'
        },
        {
          key: 4,
          value: '东边分拣区'
        },
        {
          key: 5,
          value: '东边冲压区'
        }
      ]
    }
  },
  mounted() {
    this.getStorageList()
    this.getConsignorList()
    this.getAllproductList()
    this.getAlldestinationList()
  },
  // 自定义初始化数据
  init(the) {
    var userInfo = the.common.getUserInfo()
    // 设置经手人不是超级管理员,不允许编辑
    if (!userInfo.isAdministrator) {
      the.editorOptions.fields.forEach(cols => {
        cols.columns &&
          cols.columns.forEach(col => {
            col.fields.forEach(item => {
              if (item.options.prop === 'userTrueName') {
                item.options.disabled = true
              }
            })
          })
      })
    }
  },
  methods: {
    destinationChange() {
      // 通过目的地寻找物料信息
      // var destination_Id = this.taskForm.destination_Id;
      // var productList = this.aLLproductList.filter(v => v.destinationName.indexOf(destination_Id) !== -1);
      // this.productList = JSON.parse(JSON.stringify(productList));
    },
    // 获取库存数据
    productChange() {
      // 通过物料信息找出目的地
      var product_Id = this.taskForm.product_Id
      var productInfo = this.aLLproductList.find(v => v.product_Id === product_Id)
      var destinations = productInfo.destinationName.split('/')
      var destinationList = this.ALLdestinationList.filter(v => destinations.some(x => parseInt(x) === parseInt(v.destination_Id)))
      this.destinationList = destinationList
      this.taskForm.packingQuantity = productInfo.packingQuantity
      this.taskForm.orderType = productInfo.orderType
      // 合计库存数量
      this.getStockNumByProductId()
    },
    getStockNumByProductId() {
      const url = 'api/basicInfo/base/productInfo/getStockNumByProductId'
      const params = { id: this.taskForm.product_Id }
      var callback = res => {
        if (res.result) {
          this.taskForm.validQty = res.data.validQty
          this.taskForm.productStorage = res.data.productStorage
        }
      }
      this.common.ajax(url, params, callback, true)
    },
    getAllproductList() {
      const url = 'api/basicInfo/base/productInfo/getList'
      const params = {}
      var callback = res => {
        if (res.result) {
          this.aLLproductList = res.data
          this.productList = res.data
        }
      }
      this.common.ajax(url, params, callback, true)
    },
    // 获取目的地,焊装工位
    getAlldestinationList() {
      const url = 'api/basicInfo/base/destination/getList'
      const params = {}
      var callback = res => {
        if (res.result) {
          this.ALLdestinationList = res.data
          this.destinationList = res.data
          console.log(this.destinationList)
        }
      }
      this.common.ajax(url, params, callback, true)
    },
    addNewOrder() {
      debugger
      const url = 'api/outbound/order/addNewOrder'
      const params = { taskForm: this.taskForm }
      var callback = res => {
        this.common.showMsg(res)
        if (res.result) {
          this.dataList.reload()
          this.dialogFormVisible = false
        }
      }
      this.common.ajax(url, params, callback, true)
    },
    // 列表页面按钮点击事件
    buttonClick(authNode) {
      switch (authNode) {
        case 'delete':
          // 删除
          this.delete()
          return false
      }
    },
    // 一键出库
    quickOut() {
      // 获得已选中的ID
      var flag = false
      debugger
      const ids = this.dataListSelections.map((item, index, Array) => {
        if (item.statusText !== '下架中') {
          flag = true
        }
        if (item.sortingStatus !== 2) {
          flag = true
        }
        return item.order_Id
      })
      if (flag) {
        this.$message({
          message: '只有已分配且下架中的可以进行一键出库',
          type: 'warning'
        })
        return
      }
      if (ids.length !== 1) {
        this.$message({
          message: '请选中一行!',
          type: 'warning'
        })
        return
      }
      const ref = this.dataList
      var id = ids[0]
      const url = 'api/outbound/order/QingqiQuickOut'
      const params = {
        id: id
      }
      var callback = res => {
        this.common.showMsg(res)
        if (res.result) {
          ref.loadData()
        }
      }
      this.common.ajax(url, params, callback, true)
    },
    // 出库指令
    outCommand() {
      this.$confirm('确定要发送出库指令吗, 是否继续?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      })
        .then(() => {
          submit()
        })
        .catch(() => {
          this.$message({
            type: 'info',
            message: '已取消'
          })
        })
 
      const submit = () => {
        // 获得已选中的ID
        const ids = this.dataListSelections.map((item, index, Array) => {
          return item.order_Id
        })
        const ref = this.dataList
        const url = 'api/outbound/order/outCommand'
        const params = { ids: ids }
        var callback = res => {
          this.common.showMsg(res)
          if (res.result) {
            ref.loadData()
          }
        }
        this.common.ajax(url, params, callback, true)
      }
    },
    // 触发事件
    onChange(ref, val, field, formData) {
      debugger
      const baseCurrencyCode = this.masterData.baseCurrencyCode || ''
      this.$set(this.masterData, 'baseCurrencyCode', baseCurrencyCode)
      const storeCurrencyCode = this.masterData.storeCurrencyCode || ''
      this.$set(this.masterData, 'storeCurrencyCode', storeCurrencyCode)
      const orderCurrencyCode = this.masterData.orderCurrencyCode || ''
      this.$set(this.masterData, 'orderCurrencyCode', orderCurrencyCode)
      const giftMessage = this.masterData.giftMessage || ''
      this.$set(this.masterData, 'giftMessage', giftMessage)
      const tag = this.masterData.tag || ''
      this.$set(this.masterData, 'tag', tag)
      debugger
      // 计算套数
      if (field.options.prop === 'outNumber') {
        const outNumber = this.editor.formData['outNumber']
        // this.editor.changeValue("expandFields", 11);
        const expandFields = this.editor.formData['expandFields']
        var detailRows = formData['Sale_OrderList'].rows
        detailRows.forEach(item => {
          const count = item.quantityShipped / expandFields
          item.quantityOrder = (count || 0) * (outNumber || 0)
          item.__ischange__ = true
        })
      }
      // 根据移动类型不同  来设置下方文本框的禁用与否
      if (field.options.prop === 'email') {
        const email = this.editor.formData['email']
        var productCodeField = this.editorOptions.fields[2].columns[0].fields[0]
        productCodeField.options.readonly = true
        email
        // productCodeField = this.editorOptions.fields[2].columns[1].fields[0]; //销售订单号
        // productCodeField.options.readonly = true;
        if (email === '发料到销售订单231') {
          this.masterData.baseCurrencyCode = null
          this.masterData.giftMessage = null
          this.masterData.tag = null
          productCodeField = this.editorOptions.fields[2].columns[0].fields[0]
          productCodeField.options.required = false
          productCodeField.options.readonly = true
          productCodeField = this.editorOptions.fields[2].columns[1].fields[0]
          productCodeField.options.readonly = false
          productCodeField.options.required = true
          productCodeField = this.editorOptions.fields[2].columns[2].fields[0]
          productCodeField.options.readonly = false
          productCodeField.options.required = true
          productCodeField = this.editorOptions.fields[3].columns[1].fields[0]
          productCodeField.options.disabled = true
          // productCodeField.options.required = true;
          productCodeField = this.editorOptions.fields[3].columns[0].fields[0]
          // productCodeField.options.required = true;
          productCodeField.options.disabled = true
        } else if (email === '发料到成本中心201') {
          this.masterData.storeCurrencyCode = null
          this.masterData.orderCurrencyCode = null
          this.masterData.giftMessage = null
          this.masterData.tag = null
          productCodeField = this.editorOptions.fields[2].columns[1].fields[0]
          productCodeField.options.readonly = true
          productCodeField.options.required = false
          productCodeField = this.editorOptions.fields[2].columns[2].fields[0]
          productCodeField.options.required = false
          productCodeField.options.readonly = true
          productCodeField = this.editorOptions.fields[2].columns[0].fields[0]
          productCodeField.options.required = false
          productCodeField.options.readonly = true
          productCodeField = this.editorOptions.fields[3].columns[1].fields[0]
          productCodeField.options.disabled = true
          // productCodeField.options.required = true;
          productCodeField = this.editorOptions.fields[3].columns[0].fields[0]
          // productCodeField.options.required = true;
          productCodeField.options.disabled = true
        } else if (email === '发料到生产订单261') {
          this.masterData.orderCurrencyCode = null
          this.masterData.giftMessage = null
          this.masterData.tag = null
          productCodeField = this.editorOptions.fields[2].columns[1].fields[0]
          productCodeField.options.readonly = false
          productCodeField.options.required = false
          productCodeField = this.editorOptions.fields[2].columns[2].fields[0]
          productCodeField.options.required = false
          productCodeField.options.readonly = false
          productCodeField = this.editorOptions.fields[2].columns[0].fields[0]
          productCodeField.options.required = false
          productCodeField.options.readonly = false
          productCodeField = this.editorOptions.fields[3].columns[1].fields[0]
          productCodeField.options.disabled = true
          // productCodeField.options.required = true;
          productCodeField = this.editorOptions.fields[3].columns[0].fields[0]
          // productCodeField.options.required = true;
          productCodeField.options.disabled = true
        } else if (email === '暂存区发料到生产订单261') {
          this.masterData.orderCurrencyCode = null
          this.masterData.giftMessage = null
          this.masterData.tag = null
          productCodeField = this.editorOptions.fields[2].columns[1].fields[0]
          productCodeField.options.readonly = false
          productCodeField.options.required = false
          productCodeField = this.editorOptions.fields[2].columns[2].fields[0]
          productCodeField.options.required = false
          productCodeField.options.readonly = false
          productCodeField = this.editorOptions.fields[2].columns[0].fields[0]
          productCodeField.options.required = false
          productCodeField.options.readonly = false
          productCodeField = this.editorOptions.fields[3].columns[1].fields[0]
          productCodeField.options.disabled = true
          // productCodeField.options.required = true;
          productCodeField = this.editorOptions.fields[3].columns[0].fields[0]
          // productCodeField.options.required = true;
          productCodeField.options.disabled = true
        } else if (email === '311立库到平库') {
          this.masterData.storeCurrencyCode = null
          this.masterData.orderCurrencyCode = null
          this.masterData.baseCurrencyCode = null
          this.masterData.tag = 'G021'
          productCodeField = this.editorOptions.fields[3].columns[1].fields[0]
          productCodeField.options.readonly = true
          productCodeField.options.disabled = false
          // productCodeField.options.required = true;
          productCodeField = this.editorOptions.fields[3].columns[0].fields[0]
          // productCodeField.options.required = true;
          productCodeField.options.readonly = true
          productCodeField.options.disabled = false
          productCodeField = this.editorOptions.fields[2].columns[0].fields[0]
          productCodeField.options.required = false
          productCodeField.options.readonly = true
          productCodeField = this.editorOptions.fields[2].columns[1].fields[0]
          productCodeField.options.readonly = true
          productCodeField.options.required = false
          productCodeField = this.editorOptions.fields[2].columns[2].fields[0]
          productCodeField.options.readonly = true
          productCodeField.options.required = false
        }
      }
      // 生产订单号
      if (field.options.prop === 'baseCurrencyCode') {
        const baseCurrencyCode = this.editor.formData['baseCurrencyCode']
        var detailRowss = formData['Sale_OrderList'].rows
        detailRowss.forEach(item => {
          item.storeOrderId = baseCurrencyCode
          item.__ischange__ = true
        })
      }
      // 销售订单号
      if (field.options.prop === 'storeCurrencyCode') {
        const storeCurrencyCode = this.editor.formData['storeCurrencyCode']
        var detailRowsss = formData['Sale_OrderList'].rows
        detailRowsss.forEach(item => {
          item.packageName = storeCurrencyCode
          item.__ischange__ = true
        })
      }
      // 销售项号
      if (field.options.prop === 'orderCurrencyCode') {
        const orderCurrencyCode = this.editor.formData['orderCurrencyCode']
        var detailRowssss = formData['Sale_OrderList'].rows
        detailRowssss.forEach(item => {
          item.numberOfGiftBags = orderCurrencyCode
          item.__ischange__ = true
        })
      }
      // 移动类型
      if (field.options.prop === 'email') {
        const email = this.editor.formData['email']
        var detailRowsssss = formData['Sale_OrderList'].rows
        detailRowsssss.forEach(item => {
          item.extendField01 = email
          item.__ischange__ = true
        })
      }
    },
    // 将选择器选择中的数据填充到明细表中
    // onPositionSelected(rows) {
    //   rows.forEach(item => {
    //     item.containerNo = 1;
    //   });
    //   this.editor.addDetailDataRow(rows);
    //   this.selectorPositionConfig.visible = false;
    // },
    // 获取所属仓库下拉框
    getStorageList() {
      const url = 'api/basicInfo/base/storage/getList'
      const params = {}
      var callback = res => {
        if (res.result) {
          this.storageNames = res.data
        }
      }
      this.common.ajax(url, params, callback, true)
    },
    // 获取货主名称下拉框
    getConsignorList() {
      const url = '/api/basicInfo/base/consignor/getList'
      const params = {
        openNodeApi: true
      }
      var callback = res => {
        if (res.result) {
          this.consignorNames = res.data
        }
      }
      this.common.ajax(url, params, callback)
    },
    // 设置分拣规则
    setSortingRule(row) {
      this.winSortingRuleVisible = true
      this.selectRuleRow = row
      this.sortingRuleForm.productCode = this.selectRuleRow['productCode']
      this.getSortingRuleList()
    },
    // 获取分拣列表
    getSortingRuleList() {
      const url = '/api/outbound/order/getSortingRule'
      var orderList_Id = this.selectRuleRow['orderList_Id']
      const params = { orderList_Id: orderList_Id }
      var callback = res => {
        if (res.result) {
          this.sortingRuleList = res.data
        }
      }
      this.common.ajax(url, params, callback, true)
    },
    // 提交分拣规则
    submitSortingRuleData() {
      var consignor_Id = this.editor.formData['consignor_Id']
      var consignorCode = this.editor.formData['consignorCode']
      var consignorName = this.editor.formData['consignorName']
      var storage_Id = this.editor.formData['storage_Id']
      var storageName = this.editor.formData['storageName']
 
      var order_Id = this.editor.formData['order_Id']
      var orderCode = this.editor.formData['orderCode']
      var positionName = this.sortingRuleForm.positionName
      var batchNumber = this.sortingRuleForm.batchNumber
      var produceDate = this.sortingRuleForm.produceDate
      var plateCode = this.sortingRuleForm.plateCode
      var singleSignCode = this.sortingRuleForm.singleSignCode
      var product_Id = this.selectRuleRow['product_Id']
      var productCode = this.selectRuleRow['productCode']
      var productName = this.selectRuleRow['productName']
      var orderList_Id = this.selectRuleRow['orderList_Id']
 
      const url = '/api/outbound/order/setSortingRule'
      const params = {
        consignor_Id: consignor_Id,
        consignorCode: consignorCode,
        consignorName: consignorName,
        storage_Id: storage_Id,
        storageName: storageName,
 
        orderList_Id: orderList_Id,
        order_Id: order_Id,
        orderCode: orderCode,
 
        positionName: positionName,
        batchNumber: batchNumber,
        produceDate: produceDate,
        plateCode: plateCode,
        singleSignCode: singleSignCode,
 
        product_Id: product_Id,
        productCode: productCode,
        productName: productName
      }
      var callback = res => {
        if (res.result) {
          this.getSortingRuleList()
          this.sortingRuleForm.positionName = ''
          this.sortingRuleForm.batchNumber = ''
          this.sortingRuleForm.produceDate = ''
          this.sortingRuleForm.plateCode = ''
          this.sortingRuleForm.singleSignCode = ''
        }
      }
      this.common.ajax(url, params, callback, true)
    },
    // 关闭分拣规则
    deleteRule(rule_Id) {
      this.$confirm('确实要关闭当前规则吗?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      })
        .then(() => {
          const url = '/api/outbound/order/DeleteSortingRule'
          const params = { rule_Id: rule_Id }
          var callback = res => {
            this.common.showMsg(res)
            if (res.result) {
              this.getSortingRuleList()
            }
          }
          this.common.ajax(url, params, callback, true)
        })
        .catch(() => {
          this.$message({
            type: 'info',
            message: '已取消'
          })
        })
    },
    // 下拉框加载完毕后
    onLoadDropdownAfter(formData) {
      // 在新间时获取工厂名称第一条数据
      const consignorDropdownList = this.editor.getDropdownData(797)
      if (consignorDropdownList && consignorDropdownList.length) {
        // 只有新建时,默认值
        if (!formData.order_Id) {
          const firstItem = consignorDropdownList[0]
          this.defaultValue.consignor_Id = firstItem.consignor_Id
          this.defaultValue.consignorCode = firstItem.consignorCode
          this.defaultValue.consignorName = firstItem.consignorName
          this.defaultValue.storage_Id = 87
          this.defaultValue.storageName = '立体库'
          formData.consignor_Id = firstItem.consignor_Id
          formData.consignorCode = firstItem.consignorCode
          formData.storageName = '立体库'
          formData.storage_Id = 87
        }
      }
    },
    // 重置操作
    onSuperReset() {
      this.dataList.reload()
    },
    // 保存后事件
    onSaveAfter(formData) {
      var orderCode = this.masterData.orderCode
      var statusText = this.masterData.statusText
      const url = '/api/outbound/order/orderLog'
      const params = {
        orderCode: orderCode,
        statusText: statusText,
        orderType: '手动出库'
      }
      const ref = this.dataList
      var callback = res => {
        this.common.showMsg(res)
        if (res.result) {
          ref.loadData()
        }
      }
      this.common.ajax(url, params, callback, ref)
    },
    // 删除
    delete() {
      if (!this.dataListSelections.length) {
        this.$message.error('至少选中一行!')
        return
      }
      const order_Id = this.dataListSelections.map((item, index, Array) => {
        return item.order_Id
      })
      const orderCode = this.dataListSelections.map((item, index, Array) => {
        return item.orderCode
      })
 
      this.$confirm('确定要进行删除操作吗?', '删除', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      })
        .then(() => {
          const url = '/api/outbound/order/deleteOrderCode'
          const params = {
            ids: order_Id,
            orderCode: orderCode,
            orderType: '手动出库'
          }
          const ref = this.dataList
          var callback = res => {
            this.common.showMsg(res)
            if (res.result) {
              ref.loadData()
            }
          }
          this.common.ajax(url, params, callback, ref)
        })
        .catch(() => {
          this.$message({
            type: 'info',
            message: '已取消'
          })
        })
    }
  }
}
</script>
 
<style rel="stylesheet/scss" scoped>
.tip {
  padding: 8px 16px;
  background-color: #ecf8ff;
  border-radius: 4px;
  border-left: 5px solid #50bfff;
  margin: 5px 0;
}
.dialog-info {
  overflow: hidden;
  width: 100%;
}
.dialog-left {
  float: left;
  width: 45%;
}
.dialog-right {
  margin-left: 30px;
  float: left;
  width: 45%;
}
.deleteRule-span {
  cursor: pointer;
}
.page-list-container {
  min-height: calc(100vh - 110px);
  overflow: hidden;
  position: relative;
}
.scrollbar-wrap {
  margin-top: 20px;
  max-height: 400px;
  overflow-x: hidden;
  padding: 0px;
}
.msg-container {
  margin: 0;
  padding: 0;
  padding-bottom: 40px;
}
.msg-item {
  margin: 0;
  padding: 5px 0;
  word-wrap: break-word;
  font-size: 14px;
}
 
@media screen and (max-height: 900px) {
  .page-list-container {
    min-height: 600px;
  }
}
</style>