houseRecord.vue
40.2 KB
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
<template>
<el-row>
<el-card style="background-color: #F5F7FA">
<el-row class="toolbar" style="height:auto">
<el-form :model="addForm" :rules="rules" ref="addForm" :inline="true">
<el-divider content-position="left"><i class="el-icon-document"></i> 货物信息</el-divider>
<el-row>
<el-col :span="6">
<el-form-item label=" " :label-width="formLabelWidth" prop="serialnumber">
<el-input v-model="addForm.serialnumber" autocomplete="off" suffix-icon="el-icon-files" disabled>
<template slot="prepend">流  水</template>
</el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label=" " :label-width="formLabelWidth" prop="waybillmaster">
<el-input v-model="addForm.waybillmaster" autocomplete="off" suffix-icon="el-icon-document" clearable>
<template slot="prepend">主  单</template>
</el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label=" " :label-width="formLabelWidth" prop="waybill">
<el-input v-model="addForm.waybillsub" autocomplete="off" suffix-icon="el-icon-document" clearable>
<template slot="prepend">分  单</template>
</el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label=" " :label-width="formLabelWidth" prop="pcs">
<el-input v-model.number="addForm.pcs" autocomplete="off" suffix-icon="el-icon-files" clearable >
<template slot="prepend">件  数</template>
</el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label=" " :label-width="formLabelWidth" prop="weight">
<el-input v-model="addForm.weight" autocomplete="off" suffix-icon="el-icon-files" clearable>
<template slot="prepend">重  量</template>
</el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label=" " :label-width="formLabelWidth" prop="billweight">
<el-input v-model="addForm.billweight" autocomplete="off" suffix-icon="el-icon-files" clearable>
<template slot="prepend">计费重量</template>
</el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label=" " :label-width="formLabelWidth" prop="vol">
<div class="my-text-area">
<div class="el-input-group__prepend prepand">体  积</div>
<el-input v-model="addForm.vol"
type="textarea"
autosize
placeholder="请输入体积"
style="float: left;width:calc(100% - 89px)"
>
</el-input>
</div>
</el-form-item>
</el-col>
</el-row>
<el-divider content-position="left"><i class="el-icon-s-home"></i> 入库相关</el-divider>
<el-row>
<el-col :span="6">
<el-form-item label=" " :label-width="formLabelWidth" prop="area">
<el-autocomplete
v-model="addForm.area"
:fetch-suggestions="areaQuerySearch"
placeholder="请输入库区编号"
:trigger-on-focus="false"
value-key = "areano"
clearable
highlight-first-item
style="width: 100%"
>
<template slot="prepend">库  区</template>
<template slot-scope="{ item }">
<div class="name" style="float: left">{{ item.areano }}</div>
<div class="addr" style="float: right">{{ item.areaname }}</div>
</template>
</el-autocomplete>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label=" " :label-width="formLabelWidth" prop="location">
<el-autocomplete
v-model="addForm.location"
:fetch-suggestions="locationQuerySearch"
placeholder="请输入库位编号"
:trigger-on-focus="false"
value-key = "locationno"
clearable
highlight-first-item
style="width: 100%"
>
<template slot="prepend">库  位</template>
<template slot-scope="{ item }">
<div class="name" style="float: left">{{ item.locationno }}</div>
<div class="addr" style="float: right">{{ item.locationname }}</div>
</template>
</el-autocomplete>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label=" " :label-width="formLabelWidth" prop="transcar">
<el-input v-model="addForm.transcar" autocomplete="off" suffix-icon="el-icon-files" >
<template slot="prepend">运输车辆</template>
</el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label=" " :label-width="formLabelWidth" prop="customername">
<el-autocomplete
v-model="addForm.customername"
:fetch-suggestions="crmQuerySearch"
placeholder="请输入货主名称"
:trigger-on-focus="false"
value-key = "roleName"
clearable
highlight-first-item
style="width: 100%"
>
<template slot="prepend">货主名称</template>
<template slot-scope="{ item }">
<div class="name" style="float: left">{{ item.departmentid }}</div>
<div class="addr" style="float: right">{{ item.roleName }}</div>
</template>
</el-autocomplete>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label=" " :label-width="formLabelWidth" prop="opter">
<el-input v-model="addForm.opter" autocomplete="off" disabled suffix-icon="el-icon-files">
<template slot="prepend">经 办 人</template>
</el-input>
</el-form-item>
</el-col>
</el-row>
<!-- <el-row>
<el-col :span="7">
<el-form-item label="" :label-width="formLabelWidth" prop="house">
<el-input v-model="addForm.house" autocomplete="off" style="width: 300px">
<template slot="prepend">出入库仓库</template>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="" :label-width="formLabelWidth" prop="opttime">
<el-input v-model="addForm.opttime" autocomplete="off" style="width: 300px">
<template slot="prepend">出入库时间</template>
</el-input>
<el-date-picker
v-model="addForm.opttime"
type="datetime" size="mini"
value-format="yyyy-MM-dd HH:mm:ss"
format="yyyy-MM-dd HH:mm:ss"
style="width:300px"
placeholder="选择出入库时间">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="" :label-width="formLabelWidth" prop="station">
<el-input v-model="addForm.station" autocomplete="off" style="width: 300px">
<template slot="prepend">出入库场站</template>
</el-input>
</el-form-item>
</el-col>
</el-row>
-->
<el-divider content-position="left"><i class="el-icon-mobile-phone"></i> 业务属性</el-divider>
<el-row>
<el-col :span="6">
<el-form-item label=" " :label-width="formLabelWidth" prop="transtype">
<div class="my-text-area">
<div class="el-input-group__prepend prepand">交易类型</div>
<el-select v-model="addForm.transtype" placeholder="请选择交易类型" autocomplete="off">
<el-option
v-for="item in options1"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</div>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label=" " :label-width="formLabelWidth" prop="goodstype">
<div class="my-text-area">
<div class="el-input-group__prepend prepand">交易类型</div>
<el-select v-model="addForm.goodstype" placeholder="请选择出入库货物类型" autocomplete="off">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</div>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label=" " :label-width="formLabelWidth" prop="ietype">
<div class="my-text-area">
<div class="el-input-group__prepend prepand">交易类型</div>
<el-select v-model="addForm.ietype" placeholder="出入库类型" size="mini">
<el-option label="出入库类型-进" value="I"></el-option>
<el-option label="出入库类型-出" value="E"></el-option>
</el-select>
</div>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<!-- <el-form-item label="" :label-width="formLabelWidth" prop="status">-->
<!-- <el-input v-model="addForm.status" autocomplete="off" style="width: 300px">-->
<!-- <template slot="prepend">状  态</template>-->
<!-- </el-input>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="" :label-width="formLabelWidth" prop="status">-->
<!-- <el-select v-model="addForm.status" placeholder="请选择状态" size="mini" style="width: 300px">-->
<!-- <el-option label="状态-失败" value="0"></el-option>-->
<!-- <el-option label="状态-成功" value="1"></el-option>-->
<!-- </el-select>-->
<!-- </el-form-item>-->
</el-col>
</el-row>
<!-- <el-row>
<el-col :span="7">
<el-form-item label="" :label-width="formLabelWidth" prop="custel">
<el-input v-model="addForm.custel" autocomplete="off" style="width: 300px">
<template slot="prepend">出入库客户联系电话</template>
</el-input>
</el-form-item>
</el-col>
<el-col :span="10">
<el-form-item label="" :label-width="formLabelWidth" prop="customer">
<el-input v-model="addForm.customer" autocomplete="off" style="width: 300px">
<template slot="prepend">出入库客户联系人姓名</template>
</el-input>
</el-form-item>
</el-col>
</el-row>-->
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="apply_dialog.addDialog = false" >取 消</el-button>
<el-button type="primary" @click="dialogApply==='create'?add():edit()" >提 交</el-button>
</div>
</el-row>
<!-- 搜索区域-->
<el-row :gutter="10" class="toolbar">
<el-col :span="5.5">
<el-input v-model="queryInfo.waybill" prefix-icon="el-icon-search"
placeholder="货物单号" clearable>
<template slot="prepend">货物单号</template>
</el-input>
</el-col>
<el-col :span="5.5" :offset="1">
<el-input v-model="queryInfo.serialnumber" prefix-icon="el-icon-search"
placeholder="流水" clearable>
<template slot="prepend">流  水</template>
</el-input>
</el-col>
<el-col :span="8">
<el-button type="primary" icon="el-icon-search" @click="getList()">
查询
</el-button>
<el-button type="success" icon="el-icon-edit" @click="applyAdd()">直接入库</el-button>
<el-button type="success" icon="el-icon-edit" @click="batchAdd()">批量入库</el-button>
</el-col>
</el-row>
<!-- 列表区域-->
<el-row>
<el-table
:data="tableData"
border
@selection-change="trnSelectionChange"
:cell-style="{textAlign:'center'}"
style="border-radius: 10px 10px 0px 0px;line-height: 25px"
:header-cell-style="{background:'#6F8294',color:'#FFFFFF'}"
>
<el-table-column
type="selection"
:selectable="checkSelectable"
fixed="left"
width="55"
/>
<el-table-column
fixed
prop="waybill"
label="货物单号"
width="120">
</el-table-column>
<el-table-column
fixed
prop="serialnumber"
label="流水号"
width="120">
</el-table-column>
<el-table-column
prop="pcs"
label="件数"
width="60">
</el-table-column>
<el-table-column
prop="weight"
label="重量"
width="60">
</el-table-column>
<el-table-column
prop="billweight"
label="计费重量"
width="70">
</el-table-column>
<el-table-column
prop="vol"
label="体积"
width="60">
</el-table-column>
<el-table-column
prop="area"
label="库区"
width="60">
</el-table-column>
<el-table-column
prop="location"
label="库位"
width="60">
</el-table-column>
<el-table-column
prop="station"
label="出入库场站"
width="100">
</el-table-column>
<el-table-column
prop="status"
label="状态"
width="80">
<template slot-scope="scope">
<span v-if="scope.row.status ==='0'">失败</span>
<span v-if="scope.row.status ==='1'">成功</span>
</template>
</el-table-column>
<el-table-column
prop="transcar"
label="运输车辆信息"
width="100">
</el-table-column>
<el-table-column
prop="transtype"
label="交易类型"
width="100">
</el-table-column>
<!-- <el-table-column-->
<!-- prop="custel"-->
<!-- label="客户联系电话"-->
<!-- width="140">-->
<!-- </el-table-column>-->
<!-- <el-table-column-->
<!-- prop="customer"-->
<!-- label="联系人姓名"-->
<!-- width="100">-->
<!-- </el-table-column>-->
<el-table-column
prop="customername"
label="客户名称"
width="80">
</el-table-column>
<el-table-column
prop="goodstype"
label="货物类型"
width="80">
</el-table-column>
<el-table-column
prop="house"
label="出入库仓库"
width="100">
</el-table-column>
<el-table-column
prop="ietype"
label="类型"
width="60">
<template slot-scope="scope">
<span v-if="scope.row.ietype ==='I'">进</span>
<span v-if="scope.row.ietype ==='E'">出</span>
</template>
</el-table-column>
<el-table-column
prop="opter"
label="出入库经办人"
width="100">
</el-table-column>
<el-table-column
prop="opttime"
label="出入库时间"
width="140">
</el-table-column>
<el-table-column
fixed="right"
label="操作"
width="160">
<template slot-scope="scope">
<el-button type="success" size="mini" @click="applyEdit(scope.row)">编辑</el-button>
<el-button type="danger" size="mini" @click="applyDel(scope.$index,scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
</el-row>
<el-row style="margin-top: 10px" class="toolbar">
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="queryInfo.pageNum"
:page-size="queryInfo.pageSize"
:page-sizes="[10, 50, 100, 500]"
layout="total, sizes, prev, pager, next, jumper"
:total="total">
</el-pagination>
</el-row>
</el-card>
</el-row>
</template>
<script>
import {
selectInventroyrecords,
delInventoryrecord,
addInventoryrecord,
ediInventroyrecord,
selectAreas, selectLocations
} from '../../api/consigner/station';
import dateUtil from "@/utils/index"
import jsutil from "@/common/js/util";
import { getList as getCRMList } from '@/api/crm_api';
import { loginedUserInfo } from '@/api/user';
export default {
name: "inventroyrecord",
data() {
return {
queryInfo: {
waybill:'',
serialnumber:'',
// 当前页数
pageNum: 1,
// 每页大小
pageSize: 10,
},
total: 0,
tableData:[],
areaData:[],
locationData:[],
roles:[],
dialogMap: {
update: '编辑',
create: '新增'
},
dialogApply: 'create',
apply_dialog: {
// 添加对话框
addDialog: false,
// 编辑对话框
editDialog: false
},
addForm: {
area: '',
billweight: '',
custel: '',
customer: '',
customername: '',
goodstype: '运单',
house:'',
ietype:'I',
location:'',
opter:'',
opttime: '',
pcs: '',
serialnumber: '',
station: '',
status: '',
transcar: '',
transtype:'销售入库',
vol:'',
waybillmaster:'',
waybillsub:'',
weight:'',
remark:'',
remark1:'',
remark2:'',
remark3:'',
remark4:'',
remark5:'',
},
options: [{
value: '板箱',
label: '货物类型-板箱'
}, {
value: '运单',
label: '货物类型-运单'
}, {
value: '托盘',
label: '货物类型-托盘'
}],
options1: [{
value: '采购入库',
label: '交易类型-采购入库'
}, {
value: '生产入库',
label: '交易类型-生产入库'
}, {
value: '销售入库',
label: '交易类型-销售入库'
}],
formLabelWidth: '5px',
rules: {
pcs: [
{ required: true, message: '件数必填', trigger: 'blur' },
{ type:"number", message: '件数必须为整数'}
],
weight: [
{ required: true, message: '重量为必填项', trigger: 'blur' },
// eslint-disable-next-line no-useless-escape
{ pattern: /^([0-9]+)(\.\d{2})?$/, message: '只允许输入数字与小数,支持到小数点后两位' }
],
billweight: [
{ required: true, message: '计费重量为必填项', trigger: 'blur' },
{ pattern: /^([0-9]+)(\.\d{2})?$/, message: '只允许输入数字与小数,支持到小数点后两位' }
],
area: [
{ required: true, message: '库区为必填项', trigger: 'blur' }
],
location: [
{ required: true, message: '库位为必填项', trigger: 'blur' }
],
customername: [
{ required: true, message: '货主名称为必填项', trigger: 'blur' }
],
opter: [
{ required: true, message: '必须包含经办人信息', trigger: 'blur' }
]
},
}
},
methods: {
handleSizeChange(val) {
this.queryInfo.pageSize = val
this.getList()
},
handleCurrentChange(val) {
this.queryInfo.pageNum = val
this.getList()
},
getList() {
const _this = this
selectInventroyrecords(this.queryInfo).then((response) => {
const res = response.data
console.log(response.data)
if (res.code !== '200') {
return _this.$message.error('获取消息收发记录,失败!')
}
// 获取列表数据
_this.tableData = res.data.list
// 获取列表的总记录数
_this.total = res.data.total
_this.$message.success('获取消息收发记录,成功!')
}).catch(error => {
// 关闭加载
_this.$message.error(error.toString())
})
},
// 添加对话框,打开事件
applyAdd() {
this.addForm = {
area: '',
billweight: '',
custel: '',
customer: '',
customername: '',
goodstype: '',
house:'',
ietype:'',
location:'',
opter:'',
opttime: '',
pcs: '',
serialnumber: '',
station: '',
status: '',
transcar: '',
transtype:'',
vol:'',
waybill:'',
weight:'',
remark:'',
remark1:'',
remark2:'',
remark3:'',
remark4:'',
remark5:'',
uuid:''
};
this.dialogApply= 'create';
this.apply_dialog.addDialog = true;
},
batchAdd(){
this.$refs.addForm.validate(valid => {
// 未通过,表单预校验
if (!valid) return;
this.tableData.push(this.addForm);
})
},
// 添加功能
add() {
this.$refs.addForm.validate(valid => {
// 未通过,表单预校验
if (!valid) return;
addInventoryrecord(this.addForm).then((response) => {
let res = response.data;
// 添加失败
if (res.code !== '200') {
return this.$message.error(res.msg);
}
// 添加,成功
this.$message.success(res.msg);
// 隐藏对话框
this.apply_dialog.addDialog = false;
// 刷新列表
this.getList();
}).catch(error => {
this.$message.error(error.toString());
});
})
},
// 打开编辑
applyEdit(row) {
this.apply_dialog.addDialog = true;
this.dialogApply = 'update';
this.addForm=row;
},
// 编辑功能
edit() {
// 进行表单的预验证
this.$refs.addForm.validate(valid => {
// 未通过,表单预校验
if (!valid) return
ediInventroyrecord(this.addForm).then((response) => {
// console.log(row)
const res = response.data
if (res.code != '200') {
return this.$message.error(res.msg)
}
this.$message.success(res.msg)
// 隐藏对话框
this.apply_dialog.addDialog = false
// 刷新列表
this.getList()
}).catch(error => {
this.$message.error(error.toString())
})
})
},
// 删除
applyDel(index, row) {
// 弹框询问是否删除?
this.$confirm('此操作永久删除该消息收发记录, 是否继续?', '警告', {
confirmButtonText: '确定删除',
cancelButtonText: '取消',
type: 'warning'
}
).then(() => {
// console.log(row);
delInventoryrecord({uuid:row.uuid}).then((response) => {
// console.log(row)
const res = response.data
this.$message.success(res.msg)
this.getList()
}).catch(error => {
this.$message.error(res.msg)
})
}).catch(() => {
})
},
serialNumber:()=>{
let serialDate= new Date();
let serialCode = serialDate.format("yyyyMMddhhmmssS")
return serialCode
},
getAreaList() {
const _this = this
let para = {
// 当前页数
pageNum: 1,
// 每页大小
pageSize: 1000,
}
let ld = this.$loading({
text:"库区数加载中..."
})
selectAreas(para).then((response) => {
const res = response.data
if (res.code !== '200') {
return _this.$message.error('获取库区记录,失败!')
}
// 获取列表数据
_this.areaData = res.data.list
_this.$message.success('获取库区记录,成功!')
}).catch(error => {
// 关闭加载
_this.$message.error(error.toString())
}).finally(()=>{
ld.close()
})
},
areaQuerySearch(queryString, cb) {
var restaurants = this.areaData;
var results = queryString ? restaurants.filter(this.createFilter(queryString)) : restaurants;
// 调用 callback 返回建议列表的数据
cb(results);
},
createFilter(queryString) {
return (restaurant) => {
return (restaurant.areano.toLowerCase().indexOf(queryString.toLowerCase()) === 0);
};
},
getLocationList() {
const _this = this
let para = {
// 当前页数
pageNum: 1,
// 每页大小
pageSize: 1000,
}
let ld = this.$loading({
text:"库位数加载中..."
})
selectLocations(para).then((response) => {
const res = response.data
if (res.code !== '200') {
return _this.$message.error('获取库位记录,失败!')
}
// 获取列表数据
_this.locationData = res.data.list
_this.$message.success('获取库位记录,成功!')
}).catch(error => {
// 关闭加载
_this.$message.error(error.toString())
}).finally(()=>{
ld.close()
})
},
locationQuerySearch(queryString, cb){
var restaurants = this.locationData;
var results = queryString ? restaurants.filter(this.locationFilter(queryString)) : restaurants;
// 调用 callback 返回建议列表的数据
cb(results);
},
locationFilter(queryString) {
return (restaurant) => {
return (restaurant.locationno.toLowerCase().indexOf(queryString.toLowerCase()) === 0);
};
},
getRoles() {
let _this= this;
let ld = this.$loading({
text:"客户数据加载中..."
})
getCRMList({},1,2000).then((response) => {
const res = response.data
if (res.code !== '200') {
return _this.$message.error('获取库位记录,失败!')
}
// 获取列表数据
_this.roles = res.data.list
_this.$message.success('获取客户数据,成功!')
}).catch((error) => {
if(null!= error.response && error.response!==undefined){
let status= error.response.status;
let msg = error.response.statusText;
return _this.$message.error(status+msg)
}else {
return _this.$message.error(error.toString())
}
}).finally(()=>{
ld.close()
});
},
crmQuerySearch(queryString, cb){
var restaurants = this.roles;
var results = queryString ? restaurants.filter(this.crmFilter(queryString)) : restaurants;
// 调用 callback 返回建议列表的数据
cb(results);
},
crmFilter(queryString) {
return (restaurant) => {
if (restaurant.departmentid){
return (restaurant.departmentid.toLowerCase().indexOf(queryString.toLowerCase()) === 0);
}
};
},
},
mounted() {
this.getAreaList();
this.getLocationList();
this.getRoles();
this.addForm.serialnumber = this.serialNumber()
let userinfo = loginedUserInfo();
if (!jsutil.checkNull(userinfo) && !jsutil.checkNull(userinfo.username)){
this.$message.error("获取用户信息出错")
}else{
this.addForm.opter = userinfo.username
}
},
computed: {
},
}
</script>
<style scoped>
.toolbar{
height: 60px;
background-color: white;
/*line-height: 60px;*/
vertical-align: middle;
border-radius: 5px 5px 5px 5px;
padding: 10px 10px 0 10px;
box-shadow: 0px 5px 5px #e5e8eb;
}
.my-text-area .prepand{
float: left;
width:89px;
height: 28px;
font-size: 12px;
line-height: 28px;
}
</style>
<style>
.my-text-area .el-textarea__inner{
min-height: 28px;
height: 28px;
border-bottom-left-radius: 0;
border-top-left-radius: 0;
}
</style>