materiaTrack.vue
13.7 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
<template>
<page-layout :title="info" logo="https://gw.alipayobjects.com/zos/rmsportal/nxkuOJlFJuAUhzlMTCEe.png">
<page-header v-if="!$route.meta.pageHeader" :title="title" :logo="logo" :avatar="avatar">
<slot slot="action" name="action"></slot>
<slot slot="content" name="headerContent"></slot>
<div slot="content" v-if="!this.$slots.headerContent && desc">
<p style="font-size: 14px;color: rgba(0,0,0,.65)">{{ desc }}</p>
<div class="link">
<template v-for="(link, index) in linkList">
<a :key="index" :href="link.href">
<a-icon :type="link.icon"/>
<span>{{ link.title }}</span>
</a>
</template>
</div>
</div>
<slot slot="extra" name="extra"></slot>
<div slot="pageMenu">
<div class="page-menu-search" >
<a-input-search style="width: 80%; max-width: 522px;" v-model="queryParam.code" @search="searchAll" placeholder="支持料号何图号查询..." size="large" enterButton="搜索" />
</div>
</div>
</page-header>
<a-card :bordered="false" title="流程进度">
<a-steps :direction="isMobile() && 'vertical' || 'horizontal'" :current="basicSource.flowindex" progressDot>
<a-step v-for="sa in basicSource.flow" :title="sa">
</a-step>
</a-steps>
</a-card>
<a-card style="margin-top: 24px;" :bordered="false" title="基本信息">
<detail-list>
<detail-list-item term="物料名称">{{basicSource.name}}</detail-list-item>
<detail-list-item term="物料编码">{{basicSource.code}}</detail-list-item>
<detail-list-item term="关联编码">{{basicSource.linkCode}}</detail-list-item>
<detail-list-item term="物料规格">{{basicSource.spec}}</detail-list-item>
<detail-list-item term="制造方式">{{basicSource.attr}}</detail-list-item>
<detail-list-item term="设计类型">{{basicSource.type}}</detail-list-item>
<detail-list-item term="设计重量">{{basicSource.dsnweight}}</detail-list-item>
<detail-list-item term="形状尺寸">{{basicSource.shape}}</detail-list-item>
<detail-list-item term="工艺信息">{{basicSource.process}}</detail-list-item>
</detail-list>
<detail-list title="库存信息" style="color: #9e9e9e">
<detail-list-item term="WMS库存"><a @click="inventoryClick">{{basicSource.qty}}</a></detail-list-item>
<detail-list-item term="该数据更新时间">{{basicSource.qtyTime}}</detail-list-item>
</detail-list>
</a-card>
<!-- <a-card style="margin-top: 24px" :bordered="false" title="近半年出入库记录">-->
<!-- <div class="no-data"><a-icon type="frown-o"/>暂无数据</div>-->
<!-- </a-card>-->
<!-- 操作 -->
<a-card
style="margin-top: 24px"
:bordered="false"
:tabList="tabList"
:activeTabKey="activeTabKey"
@tabChange="(key) => {this.activeTabKey = key}"
>
<a-table
v-if="activeTabKey === '1'"
:columns="operationColumns"
:dataSource="operation1"
:pagination="false"
>
<template
slot="status"
slot-scope="status">
<a-badge :status="status | statusTypeFilter" :text="status | statusFilter"/>
</template>
</a-table>
<a-table
v-if="activeTabKey === '2'"
:columns="operationColumns2"
:dataSource="operation2"
:pagination="false"
>
<template
slot="status"
slot-scope="status">
<a-badge :status="status | statusTypeFilter" :text="status | statusFilter"/>
</template>
<span slot="departWorking" slot-scope="text, record">
<a @click="departWorking(record)">{{record.projectName}}</a>
</span>
<span slot="openPlan" slot-scope="text, record">
<a @click="openPlan(record)">{{ record.status }}</a>
</span>
</a-table>
<a-table
v-if="activeTabKey === '3'"
:columns="operationColumns3"
:dataSource="operation3"
:pagination="false"
>
<template
slot="status"
slot-scope="status">
<a-badge :status="status | statusTypeFilter" :text="status | statusFilter"/>
</template>
</a-table>
<j-popup
v-show="showRentPrise"
ref="inventory_details"
code="find_inventory"
:param="inventoryParam"
org-fields="username"
dest-fields="popup"
field="popup"/>
<j-popup
v-show="showRentPrise"
ref="depart_details"
code="departWorking"
:param="materialParam"
org-fields="username"
dest-fields="popup"
field="popup"/>
<j-popup
v-show="showRentPrise"
ref="getPlanProcess"
code="getProcessPlan"
:param="processParam"
org-fields="username"
dest-fields="popup"
field="popup"/>
</a-card>
</page-layout>
</template>
<script>
import { mixinDevice } from '@/utils/mixin.js'
import PageLayout from '@/components/page/PageLayout'
import DetailList from '@/components/tools/DetailList'
import {getMaterialBasicInfo,getProjectByCode,getProcessPlan,getPurcahseByCode} from "../../api/api";
const DetailListItem = DetailList.Item
export default {
name: "materiaTrack",
components: {
PageLayout,
DetailList,
DetailListItem
},
mixins: [mixinDevice],
data () {
return {
queryParam: {},
basicSource:[],
inventoryParam:{code:''},
materialParam:{code:''},
processParam:{no:'',headerId:''},
index:1,
status:[
{name:"采购"},
{name:"到货"},
{name:"收货"}
],
tabList: [
{
key: '1',
tab: '项目信息'
},
{
key: '2',
tab: '生产计划'
},
{
key: '3',
tab: '采购计划'
}
],
activeTabKey: '1',
info:'huaheng',
operationColumns: [
{
title: '项目名称',
dataIndex: 'field0047',
key: 'field0047'
},
{
title: '工作令',
dataIndex: 'field0056',
key: 'field0056'
},
{
title: '系统成套编码',
dataIndex: 'field0057',
key: 'field0057'
},
{
title: '机械成套编码',
dataIndex: 'field0054',
key: 'field0054'
}, {
title: '电气成套编码',
dataIndex: 'field0055',
key: 'field0055'
},{
title: '软件成套编码',
dataIndex: 'field0192',
key: 'field0192'
},{
title: '物料名称',
dataIndex: 'name',
key: 'name'
},{
title: '单位',
dataIndex: 'f02',
key: 'f02'
},
{
title: '需求总数',
dataIndex: 'bnum',
key: 'bnum'
}
],
operationColumns2: [
{
title: '项目名称',
dataIndex: 'projectName',
key: 'projectName',
scopedSlots:{
customRender:'departWorking'
}
},
{
title: '工作令',
dataIndex: 'orderNo',
key: 'orderNo'
},
{
title: '部件号',
dataIndex: 'partNo',
key: 'partNo'
},
{
title: '项目进度',
dataIndex: 'progress',
key: 'progress'
}, {
title: '计划完成时间',
dataIndex: 'completionTime',
key: 'completionTime'
},{
title: '实际完成时间',
dataIndex: 'actualCompletionTime',
key: 'actualCompletionTime'
},{
title: '项目状态',
dataIndex: 'headStatus',
key: 'headStatus'
},
{
title: '名称',
dataIndex: 'name',
key: 'name'
},{
title: '图号',
dataIndex: 'drawingNo',
key: 'drawingNo'
},{
title: '数量',
dataIndex: 'qty',
key: 'qty'
},
{
title: '完成时间',
dataIndex: 'completeDate',
key: 'completeDate'
},{
title: '状态',
dataIndex: 'status',
key: 'status',
scopedSlots:{
customRender:'openPlan'
}
}
],
operationColumns3: [
{
title: '项目名称',
dataIndex: 'projectName',
key: 'projectName'
},
{
title: '工作令',
dataIndex: 'workNo',
key: 'workNo'
},
{
title: '采购单号',
dataIndex: 'code',
key: 'code'
}, {
title: '编码',
dataIndex: 'materialCode',
key: 'materialCode'
}, {
title: '名称',
dataIndex: 'materialName',
key: 'materialName'
}, {
title: '单位',
dataIndex: 'unit',
key: 'unit'
}
, {
title: '规格',
dataIndex: 'spec',
key: 'spec'
}, {
title: '数量',
dataIndex: 'qty',
key: 'qty'
},{
title: '收货',
dataIndex: 'inQty',
key: 'inQty'
}
,{
title: '收货时间',
dataIndex: 'receiptTime',
key: 'receiptTime',
align: 'center',
scopedSlots: {
customRender: 'tradeTime'
}
},
{
title: '状态',
dataIndex: 'status',
key: 'status',
align: 'center',
scopedSlots: { customRender: 'status' }
},
{
title: '供应商',
dataIndex: 'supplier',
key: 'supplier'
},
{
title: '预计',
dataIndex: 'planEndTime',
key: 'planEndTime',
align: 'center',
scopedSlots: {
customRender: 'tradeTime'
}
},{
title: '领料',
dataIndex: 'outQty',
key: 'outQty',
},
{
title: '领料时间',
dataIndex: 'pickingTime',
key: 'pickingTime',
align: 'center',
scopedSlots: {
customRender: 'tradeTime'
}
},
{
title: '备注',
dataIndex: 'remark',
key: 'remark'
}
],
operation1: [],
operation2: [],
operation3: [],
}
},
methods: {
searchAll(){
if (this.queryParam.code==undefined){
this.$message.error("请输入料号或图号");
return false;
}
let params = {
'code': this.queryParam.code
}
this.basicSource=[];
getMaterialBasicInfo(params).then(res => {
if (res.success) {
this.loading = false
if (res.result==undefined){
this.$message.warn("查询无结果!!!");
return false;
}
this.basicSource = res.result
this.info=res.result.name
}else{
this.$message.error("查询异常!!!");
}
})
this.operation1=[];
getProjectByCode(params).then(res => {
if (res.success) {
this.operation1 = res.result
this.loading = false
}
})
this.operation2=[];
getProcessPlan(params).then(res => {
if (res.success) {
this.operation2 = res.result
this.loading = false
}
})
this.operation3=[];
getPurcahseByCode(params).then(res => {
if (res.success) {
this.operation3 = res.result
this.loading = false
}
})
},
openPlan(data){
this.processParam['no'] = "'"+data.no+"'";
this.processParam['headerId'] ="''"+data.headerId+"''";
this.$refs.getPlanProcess.openModal();
},
departWorking(data){
this.materialParam['code'] = "'"+data.headerId+"'";
this.$refs.depart_details.openModal();
},
inventoryClick(){
this.inventoryParam['code'] = "'"+this.queryParam.code+"'";
this.$refs.inventory_details.openModal();
},
},
filters: {
statusFilter(status) {
const statusMap = {
'agree': '成功',
'reject': '驳回'
}
return statusMap[status]
},
statusTypeFilter(type) {
const statusTypeMap = {
'agree': 'success',
'reject': 'error'
}
return statusTypeMap[type]
}
}
}
</script>
<style lang="less" scoped>
.detail-layout {
margin-left: 44px;
}
.text {
color: rgba(0, 0, 0, .45);
}
.heading {
color: rgba(0, 0, 0, .85);
font-size: 20px;
}
.no-data {
color: rgba(0, 0, 0, .25);
text-align: center;
line-height: 64px;
font-size: 16px;
i {
font-size: 24px;
margin-right: 16px;
position: relative;
top: 3px;
}
}
.mobile {
.detail-layout {
margin-left: unset;
}
.text {
}
.status-list {
text-align: left;
}
}
</style>