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
<template>
  <div class="indexs">
    <el-card>
      <el-row>
        <el-button type="success" plain @click="exportExcel" >导出Excel</el-button>
        <el-button v-if="roleDelete" type="warning" plain @click="deleteStock" >删除</el-button>
        <el-button v-if="roleModifi" type="info" plain @click="updataStock" >修改库存</el-button>
         <el-select v-model="positionTypeValue" placeholder="选择货位类型" class="positionTypevalue" clearable>
               <el-option
                    v-for="item in positionType"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value">
               </el-option>
         </el-select> 
    <el-select  v-model="inStoreDaysFilterTypeValue" placeholder="在库天数选择条件">
               <el-option
                    v-for="item in InStoreDaysFilterType"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value">
               </el-option>
         </el-select> 
           <el-input v-model="inStoreDaysValue" placeholder="在库天数" style="width:100px;"></el-input>
        <el-select  v-model="QueryBarCodeFlagValue" placeholder="是否二维码">
               <el-option
                    v-for="item in IsQrCodeFilterType"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value">
               </el-option>
         </el-select> 
          <el-input v-model="searchParam.BarCode" placeholder="条码" class="searchParam"></el-input>
         <br/>
          <el-input v-model="searchParam.materialName" placeholder="物料名称" class="searchParam"></el-input>
          <el-input v-model="searchParam.materialCode" placeholder="物料编号" class="searchParam"></el-input>
          <el-input v-model="searchParam.purchaseCode" placeholder="采购单号" class="searchParam"></el-input>
          <el-input v-model="searchParam.positionName" placeholder="货位名称" class="searchParam"></el-input>
          <el-input v-model="searchParam.placeCode" placeholder="托盘号" class="searchParam"></el-input>
          <el-input v-model="searchParam.tranckNnmber" placeholder="跟踪号" class="searchParam"></el-input>
            <el-date-picker
            v-model="datatime"
            size="large"
            type="datetimerange"
            value-format="yyyy-MM-dd HH:mm:ss"
            range-separator="至"
            start-placeholder="开始日期"
            end-placeholder="结束日期"
            class="positionname"
          >
          </el-date-picker>
           <el-checkbox   size="large"  v-model="searchParam.IsLocked">库存锁定</el-checkbox>
             <el-checkbox   size="large" v-model="searchParam.IsFreeze">标记无货</el-checkbox>
              <el-checkbox   size="large" v-model="searchParam.ContainerNo">正在出库中</el-checkbox>
               <el-checkbox   size="large" v-model="searchParam.OnlyLocked">仅锁定,非出库中</el-checkbox>
             &nbsp;&nbsp;&nbsp;
            <el-button type="success" plain @click="find(1)" >查询</el-button>
             <el-button type="info" plain @click="reset" >重置</el-button>
             &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
             <el-tag style="background:#aa7798;color:white">库存锁定</el-tag>
              <el-tag style="background:#5666ab;color:white">标记无货</el-tag>
               <el-tag style="background:#e91d1d;color:white">正在出库中</el-tag>
                 <el-tag style="background:#00ae9d;color:white">仅锁定,非出库中</el-tag>
      </el-row>
      <!-- 显示库存明细 -->
      <el-table ref= "table"  :max-height="tableHeight" :data="TakeStocklist"  border stripe  show-summary :summary-method="getSummaries" :cell-style="cellStyle"  @header-click="headerClick"  >
        <el-table-column
      type="selection"
      width="55">
    </el-table-column>
        <el-table-column
        label="序号"
      type="index"
      width="50"
     
      >
      
    </el-table-column>
        <el-table-column label="库存id" prop="ProductPosition_Id" width="80" v-if="false"></el-table-column>
        <el-table-column label="采购单号" prop="PoCode" width="110" ></el-table-column>
        <el-table-column label="采购项号" prop="ItemNumber" width="80"></el-table-column>
        <el-table-column label="销售单号" prop="SaleCode" width="110" ></el-table-column>
        <el-table-column label="销售项号" prop="ExtendField08" width="80"></el-table-column>
        <el-table-column label="跟踪号" prop="ExtendField04" width="80"></el-table-column>
        <el-table-column label="货位名称" prop="PositionName" width="110"></el-table-column>
        <el-table-column label="托盘号" prop="PlateCode" width="110"></el-table-column>
        <el-table-column label="物料编号" prop="ProductCode" ></el-table-column>
        <el-table-column label="物料名称" prop="ProductName" ></el-table-column>
        <el-table-column label="库存量" prop="ProductStorage" width="100"></el-table-column>
        <el-table-column label="库存单位" prop="SmallUnit" width="80"></el-table-column>
        <el-table-column label="助力臂" prop="IsBoosterArm" width="80"></el-table-column>
        <el-table-column label="入库时间" prop="InStorageDate" width="110"  ></el-table-column>
        <el-table-column label="在库天数" prop="InStoreDays" width="80"  ></el-table-column>
        <el-table-column label="限用日期" prop="LimitDate" width="110"   ></el-table-column>
        <el-table-column label="物理高度" prop="PhysicsHeight" width="80"  ></el-table-column>
        <el-table-column label="逻辑高度" prop="LogicHeight" width="80"  ></el-table-column>
        <el-table-column label="是否匹配了高库位" prop="IsInMoreHighPosition" width="80"></el-table-column>
        <el-table-column label="库位说明" prop="PositionRemark" ></el-table-column>
        <el-table-column label="备注" prop="OpRemark" ></el-table-column>
        <el-table-column label="物料锁定时间" prop="DoContainerNoTime" ></el-table-column>
        <el-table-column label="是否二维码" prop="IsQrCode" width="80"></el-table-column>
        <el-table-column label="条码" prop="BarCode" width="80"  ></el-table-column>
      </el-table>
      <el-pagination
        :current-page="queryInfo.pagenum"
        :page-sizes="[5,10, 15, 20,50,100,200,500,1000]"
        :page-size="queryInfo.pagesize"
        :total="total"
        layout="total, sizes, prev, pager, next, jumper"
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
      >
      </el-pagination>
    </el-card>
    <el-dialog :visible.sync="dialogFormVisible" title="库存修改" width="30%" :close-on-click-modal="false">
      <el-form label-width="100">
        <el-form-item label="跟踪号">
          <el-col :span="18">
            <el-input v-model="taskForm.tracknumber"></el-input>
          </el-col>
        </el-form-item>
          <el-form-item label="库存量">
          <el-col :span="18">
            <el-input v-model="taskForm.productStorage"></el-input>
          </el-col>
        </el-form-item>
             <el-form-item label="限用日期">
          <el-col :span="18">
            <el-date-picker
      v-model="taskForm.LimitDate"
      type="datetime"
      placeholder="选择日期时间">
    </el-date-picker>
          </el-col>
        </el-form-item>
        <el-form-item label="销售单号">
          <el-col :span="18">
            <el-input  disabled="true"  v-model="taskForm.saleCode"></el-input>
          </el-col>
        </el-form-item>
        <el-form-item label="销售项号">
          <el-col :span="18">
            <el-input  disabled="true"  v-model="taskForm.saleItem"></el-input>
          </el-col>
        </el-form-item>
        <el-form-item label="物料编号">
          <el-col :span="20">
            <el-select disabled="true" v-model="taskForm.productCode" :remote-method="remoteMethod" filterable clearable remote reserve-keyword placeholder="请选择零件号" width="300px">
              <el-option v-for="item in productList" :key="item.product_Id" :label="item.productCode" :value="item.productCode">
              </el-option>
            </el-select>
          </el-col>
          <!-- <el-input v-model="name"></el-input>  product_Id-->
        </el-form-item>
          <el-form-item label="物料名称">
          <el-col :span="18">
            <el-input disabled="true" v-model="taskForm.ProductName"></el-input>
          </el-col>
        </el-form-item>
         <el-form-item label="货位名称">
          <el-col :span="18">
            <el-input disabled="true" v-model="taskForm.PositionName"></el-input>
          </el-col>
        </el-form-item>
           <el-form-item label="托盘号">
          <el-col :span="18">
            <el-input disabled="true" v-model="taskForm.PlateCode"></el-input>
          </el-col>
        </el-form-item>
      
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click="dialogFormVisible = false">取 消</el-button>
        <el-button type="primary" @click="updateProductPosition">确 定</el-button>
      </div>
 
    </el-dialog>
    <el-dialog
  title="提示"
         :visible.sync="dialogVisible"
  width="30%"
  :before-close="handleClose">
  <span>这是一段信息</span>
  <span slot="footer" class="dialog-footer">
    <el-button @click="dialogVisible = false">取 消</el-button>
    <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
  </span>
</el-dialog>
  </div>
</template>
<script>
import { parseTime } from '@/utils'
import Cookies from 'js-cookie'
import { userInfoCookie, menuListCookie } from '@/utils/auth'
import { getDate } from '@/utils/dateTime'
//import DropdownMenu from '@/components/DropdownMenu.vue'
export default {
  // components: { DropdownMenu },
  data() {
    return {
      tableHeight:window.innerHeight-274,
      roleModifi: false,
      roleDelete: false,
      searchParam: {
        materialName: null,
        BarCode:null,
        materialCode: null,
        purchaseCode: null,
        positionName: null,
        placeCode: null,
        tranckNnmber: null,
        IsLocked:false,
        OnlyLocked:false,
        ContainerNo:false,
        IsFreeze:false
      },
      movepositionName: '',
      queryInfo: {
        // 当前页
        pagenum: 1,
        // 每页显示多少条信息s
        pagesize: 5
      },
      TakeStocklist: [],
      TakeStocklistAll: [],
      total: 0,
      datatime: '',
      positionType: [{ value: '1', label: '常规货位' }, { value: '4', label: '暂存区' }, { value: '6', label: '空托盘' }],
      positionTypeValue: '1',
      InStoreDaysFilterType: [{ value: '1', label: '大于' }, { value: '2', label: '大于等于' }, { value: '3', label: '等于' }, { value: '4', label: '小于' },
       { value: '5', label: '小于等于' }],
      IsQrCodeFilterType: [{ value: '0', label: '都查询' }, { value: '1', label: '仅查询一维码' }, { value: '2', label: '仅查询二维码' }],
       inStoreDaysFilterTypeValue:'',
       QueryBarCodeFlagValue:'',
       inStoreDaysValue:'',
      dialogFormVisible: false,
      productList: [],
      updateDate: null,
      taskForm: {
        userName:'',
        stockId: null,
        tracknumber: null,
        saleCode: null,
        productCode: null,
        productStorage: null,
        saleItem: null,
        ProductName:null,
        PositionName:null,
        PlateCode:null,
        LimitDate:null
      }
    }
  },
  created() {},
  mounted() {
    this.find(1)
  },
  methods: {
    // 监听 pagesize 改变
    handleSizeChange(newSizd) {
      this.queryInfo.pagesize = newSizd
      this.queryInfo.pagenum = 1
      this.find(1)
    },
    // 监听 页码值改变
    handleCurrentChange(newpage) {
      this.queryInfo.pagenum = newpage
 
      this.find(2)
    },
    //每行点击事件
    headerClick(column, event) {
      //debugger
      if (event.target && event.target.innerText === '#') {
        this.showAttrDialog = true
      }
    },
    userStatusChange(userinfo) {
      console.log(userinfo)
    },
    
    formatJson(filterVal, jsonData) {
      return jsonData.map(v =>
        filterVal.map(j => {
          if (j === 'timestamp') {
            return parseTime(v[j])
          } else {
            return v[j]
          }
        })
      )
    },
    cellStyle({ row, rowIndex }) {
      if (row.IsLocked === 1 && row.ContainerNo != '1') {//仅锁定,非出库中
        return 'background: #00ae9d;color:white'
      } 
      else if (row.IsLocked === 1) {
        return 'background: #aa7798;color:white'
      } else if (row.ContainerNo === '1') {
        //return 'background: #aa7798;color:white'
        return 'background: #e91d1d;color:white'  //改为显示红色,表示正在出库 【Editby shaocx,2022-06-07】
      } else if (row.IsFreeze === 0) {
        return 'background: #5666ab;color:white'
      }
      return ''
    },
    find(ischang = 1) {
      if (ischang == 1) {
        this.queryInfo.pagenum = 1
      }
      const url = '/api/task/productStockInfo'
      const params = {
        search: this.searchParam,
        queryInfo: this.queryInfo,
        positionTypeValue: this.positionTypeValue,
        inStoreDaysFilterTypeValue:this.inStoreDaysFilterTypeValue,
        QueryBarCodeFlagValue:this.QueryBarCodeFlagValue,
        inStoreDaysValue:this.inStoreDaysValue,
        datatime: this.datatime,
        role_Id: userInfoCookie.getUserInfo().role_Id
      }
      var callback = res => {
        //debugger
        if (res.result === true) {
          res.data.forEach(item => {
            if (item.IsBoosterArm === 0) item.IsBoosterArm = '否'
            if (item.IsBoosterArm === 1) item.IsBoosterArm = '是'
            if (item.IsInMoreHighPosition === 1) item.IsInMoreHighPosition = '是'
            if (item.IsQrCode){
              item.IsQrCode = '是'  
            }else{
              item.IsQrCode = '否'
            }
            item.InStorageDate = getDate(item.InStorageDate)
            item.LimitDate = getDate(item.LimitDate)
            item.DoContainerNoTime = getDate(item.DoContainerNoTime)
          })
          if (res.msg === '0-1') {
            this.roleModifi = true
          }
          if (res.msg === '1-0') {
            this.roleDelete = true
          }
          if (res.msg === '1-1') {
            this.roleDelete = true
            this.roleModifi = true
          }
          this.TakeStocklist = res.data
          this.TakeStocklistAll = res.data2
          this.total = res.countPrint
        } else {
          this.TakeStocklist = []
          this.TakeStocklistAll = []
          this.total = 0
          return this.$message.success('当前条件 查不到数据!')
        }
      }
      this.common.ajax(url, params, callback, true)
    },
 
find_export(ischang = 1) {
      if (ischang == 1) {
        this.queryInfo.pagenum = 1
      }
      const url = '/api/task/productStockInfo'
      const params = {
         IsLoadAllData:true,//加载全部
        /*
        search: this.searchParam,
        queryInfo: this.queryInfo,
        positionTypeValue: this.positionTypeValue,
        datatime: this.datatime,
        role_Id: userInfoCookie.getUserInfo().role_Id
        //*/
          search: this.searchParam,
        queryInfo: this.queryInfo,
        positionTypeValue: this.positionTypeValue,
        inStoreDaysFilterTypeValue:this.inStoreDaysFilterTypeValue,
        QueryBarCodeFlagValue:this.QueryBarCodeFlagValue,
        inStoreDaysValue:this.inStoreDaysValue,
        datatime: this.datatime,
        role_Id: userInfoCookie.getUserInfo().role_Id
      }
      var callback = res => {
        //debugger
        if (res.result === true) {
          res.data2.forEach(item => {
            if (item.IsBoosterArm === 0) item.IsBoosterArm = '否'
            if (item.IsBoosterArm === 1) item.IsBoosterArm = '是'
            item.InStorageDate = getDate(item.InStorageDate)
            item.LimitDate = getDate(item.LimitDate)
            if (item.IsQrCode){
              item.IsQrCode = '是'  
            }else{
              item.IsQrCode = '否'
            }
          })
          if (res.msg === '0-1') {
            this.roleModifi = true
          }
          if (res.msg === '1-0') {
            this.roleDelete = true
          }
          if (res.msg === '1-1') {
            this.roleDelete = true
            this.roleModifi = true
          }
          this.TakeStocklistAll = res.data2
          this.do_exportExcel()
        } else {
          this.TakeStocklistAll = []
          return this.$message.success('当前条件 查不到数据!')
        }
      }
      this.common.ajax(url, params, callback, true)
    },
do_exportExcel() {
      // import("@/vendor/Export2Excel")
      this.downloadLoading = true
      import('@/vendor/Export2Excel').then(excel => {
        const tHeader = [
          '采购单号',
          '采购项号',
          '销售单号',
          '销售项号',
          '跟踪号',
          '货位名称',
          '托盘号',
          '物料编号',
          '物料名称',
          '库存量',
          '库存单位',
          '助力臂',
          '入库时间',
          '在库天数',
          '限用日期',
          '是否二维码',
          '条码'
        ]
        const filterVal = [
          'PoCode',
          'ItemNumber',
          'SaleCode',
          'ExtendField08',
          'ExtendField04',
          'PositionName',
          'PlateCode',
          'ProductCode',
          'ProductName',
          'ProductStorage',
          'SmallUnit',
          'IsBoosterArm',
          'InStorageDate',
          'InStoreDays',
          'LimitDate',
          'IsQrCode',
          'BarCode'
        ]
        //debugger
        const data = this.formatJson(filterVal, this.TakeStocklistAll)
        excel.export_json_to_excel({
          header: tHeader,
          data,
          filename: '库存明细'
        })
        this.downloadLoading = false
      })
    },
  exportExcel() {
      this.find_export(1)
    },
 
    getSummaries(param) {
      const { columns, data } = param
      const sums = []
      columns.forEach((column, index) => {
        if (index === 0) {
          sums[index] = '合计'
          return
        }
        if (index != 11) {
          sums[index] = ''
          return
        }
        const values = data.map(item => Number(item[column.property]))
        if (!values.every(value => isNaN(value))) {
          sums[index] = values.reduce((prev, curr) => {
            const value = Number(curr)
            if (!isNaN(value)) {
              return prev + curr
            } else {
              return prev
            }
          }, 0)
          sums[index] += ' '
        } else {
          sums[index] = 'N/A'
        }
        sums[index] = Number(sums[index]).toFixed(2)
      })
 
      return sums
    },
 
    dateFormat(row, column) {
      var date = row[column.property]
 
      // if (date == undefined) {
      //   return "";
      // }
 
      return moment(date).format('YYYY-MM-DD HH:mm:ss')
    },
    reset() {
      this.searchParam.materialName = null
      this.searchParam.BarCode = null;
      this.searchParam.materialCode = null
      this.searchParam.purchaseCode = null
      this.searchParam.positionName = null
      this.searchParam.placeCode = null
      this.searchParam.tranckNnmber = null
      this.searchParam.IsLocked=false
      this.searchParam.OnlyLocked=false
      this.searchParam.IsFreeze=false
      this.searchParam.ContainerNo=false
 
      this.inStoreDaysFilterTypeValue=''
      this.QueryBarCodeFlagValue=''
      this.inStoreDaysValue=''
 
      this.movepositionName = ''
      this.positionTypeValue = '1'
      this.datatime = ''
      this.find(1)
    },
    //移库
    moveStock() {
      this.$confirm('确定要进行移库操作吗?', '移库操作', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      })
        .then(() => {
          const url = '/api/task/moveStock'
 
          const params = {
            positionname: this.movepositionName,
            username: userInfoCookie.getUserInfo().userTrueName
          }
          const ref = this.dataList
          var callback = res => {
            if (res.result) {
              return this.$message.success('移库成功')
            } else {
              return this.$message.error('移库失败')
            }
          }
          this.common.ajax(url, params, callback, ref)
        })
        .catch(() => {
          this.$message({
            type: 'info',
            message: '已取消'
          })
        })
    },
    //删除库存
    deleteStock() {
      //debugger
      var ss = this.$refs.table.selection
      if (!ss.length) {
        this.$message.error('请选中一行!')
        return
      }
      if (ss.length !== 1) {
        this.$message.error('只能选中一行!')
        return
      }
      var deleteid = ss[0].ProductPosition_Id
      this.$confirm('确定要进行删除操作吗?', '删除', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      })
        .then(() => {
          const url = '/api/task/deleteProductStock'
          const params = {
            id: deleteid,
            userName:userInfoCookie.getUserInfo().userTrueName //增加 登陆人
          }
          //debugger
          const ref = this.dataList
          var callback = res => {
            this.common.showMsg(res)
 
            if (res.result) {
              this.$refs.table.clearSelection()
              this.find(1)
              return this.$message.success('删除成功')
            } else {
              this.$refs.table.clearSelection()
 
              //return this.$message.error('托盘只有一条数据不可以删除')
              return this.$message.error('删除失败,可能托盘只有一条数据,不可以被删除')
            }
          }
          this.common.ajax(url, params, callback, ref)
        })
        .catch(() => {
          this.$message({
            type: 'info',
            message: '已取消'
          })
        })
    },
    //向修改页面内赋值
    updataStock() {
      var ss = this.$refs.table.selection
      this.updateDate = ss
      if (!ss.length) {
        this.$message.error('请选中一行!')
        return
      }
      if (ss.length !== 1) {
        this.$message.error('只能选中一行!')
        return
      }
      this.dialogFormVisible = true
      var rows = JSON.parse(JSON.stringify(ss))
      rows.forEach(item => {
        this.taskForm.productCode = item.ProductCode
        this.taskForm.stockId = item.ProductPosition_Id
        this.taskForm.tracknumber = item.ExtendField04 //跟踪号
        this.taskForm.saleCode = item.SaleCode //销售单号
        this.taskForm.saleItem = item.ExtendField08 //销售项号
        this.taskForm.productStorage = item.ProductStorage //库存数量
        this.taskForm.ProductName=item.ProductName //物料名称
        this.taskForm.PositionName=item.PositionName 
        this.taskForm.PlateCode=item.PlateCode 
        this.taskForm.LimitDate=item.LimitDate
      })
      this.$refs.table.clearSelection()
    },
    // 获取所有物料基础信息
    remoteMethod(query) {
      const url = 'api/basicInfo/base/productInfo/getList'
      const params = { name: query }
 
      var callback = res => {
        if (res.result) {
          //debugger
          // this.ALLproductList = res.data;
          this.productList = res.data
        }
      }
      this.common.ajax(url, params, callback, true)
    },
    // 更新库存
    updateProductPosition() {
      const url = '/api/task/updateProductStock'
      this.taskForm.userName= userInfoCookie.getUserInfo().userTrueName //增加 登陆人
      const params = {
        taskForm: this.taskForm
      }
      const ref = this.dataList
      var callback = res => {
        this.common.showMsg(res)
        this.$refs.table.clearSelection()
        this.find(1)
        this.taskForm.productCode = null
        this.taskForm.stockId = null
        this.taskForm.tracknumber = null
        this.taskForm.saleCode = null
        this.taskForm.saleItem = null
        this.taskForm.productStorage = null
        this.taskForm.ProductName=null //物料名称
        this.taskForm.PositionName = null
        this.taskForm.PlateCode = null
        this.taskForm.LimitDate=null
        this.dialogFormVisible = false
        if (res.result) {
          return this.$message.success('修改成功')
        } else {
          return this.$message.error('修改失败:'+res.msg)
        }
      }
      this.common.ajax(url, params, callback, ref)
    }
  }
}
</script>
<style lang="postcss" scoped>
.el-table .el-pagination {
  margin-top: 10px;
  line-height: 30px;
  margin-bottom: 0%;
}
.el-row {
  text-align: left;
}
.positionname {
  width: 400px;
}
.searchParam {
  width: 230px;
}
.positionTypevalue {
  width: 150px;
}
.el-card {
  padding: 0%;
  margin-bottom: 0%;
}
thead .el-table-column--selection .cell {
  display: none;
}
.displayneed {
  //display: none;
 
  display: inline-block;
  width: 150px;
}
.el-table .warning-row {
  background: #aa7798;
}
 
.el-table .success-row {
  background: #bb3455;
}
.el-table .tr {
  background: white;
}
.el-card {
  padding: 0%;
  margin-bottom: 0%;
  /* 84 = navbar + tags-view = 50 +34 */
  max-height: calc(100vh - 104px);
}
.el-scrollbar{
    .el-scrollbar__bar.is-vertical {
      opacity: 1;/* 改为0不显示滚动条*/
      width:5;
    }
  }
 
</style>