InventoryBomChildList.vue
6.21 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
<template>
<div>
<a-table
size="middle"
bordered
:rowKey="record => record.id"
:loading="loading"
:columns="columns"
:dataSource="dataSource"
:pagination="false"
class="j-table-force-nowrap"
@change="handleTableChange">
<span slot="stockCategory_dictText" slot-scope="stockCategory_dictText">
<a-tag :key="stockCategory_dictText" :color="getStatusColor(stockCategory_dictText)">
{{ stockCategory_dictText }}
</a-tag>
</span>
<span slot="recordStatus_dictText" slot-scope="recordStatus_dictText">
<a-tag :key="recordStatus_dictText" :color="getStatusColor(recordStatus_dictText)">
{{ recordStatus_dictText }}
</a-tag>
</span>
</a-table>
</div>
</template>
<script>
import {JeecgListMixin} from '@/mixins/JeecgListMixin'
import {getAction} from '@api/manage'
import '@/assets/less/TableExpand.less'
import {} from "@/api/api";
export default {
name: 'InventoryBomChildList',
mixins: [JeecgListMixin],
components: {},
props: {
record: {
type: Object,
default: null,
},
isLoad: {
type: Boolean,
default: false,
}
},
data() {
return {
description: '物料移动类型明细页面',
columns: [
{
title: '库存详情ID',
align: 'center',
dataIndex: 'id',
// fixed: "left",
// width: 100,
},
{
title: '物料编码',
align: 'center',
dataIndex: 'materialCode'
},
{
title: '物料名称',
align: 'center',
dataIndex: 'materialName'
},
{
title: '数量',
align: 'center',
dataIndex: 'qty'
},
{
title: '任务锁定数量',
align: 'center',
dataIndex: 'taskQty'
},
{
title: '库区',
align: "center",
dataIndex: 'zoneCode'
},
{
title: '容器编码',
align: 'center',
dataIndex: 'containerCode'
},
{
title: '库位编码',
align: 'center',
dataIndex: 'locationCode'
},
{
title: '入库日期',
align: 'center',
dataIndex: 'receiptDate'
},
{
title: '库龄(天)',
align: 'center',
dataIndex: 'inventoryAge'
},
],
// 字典选项
dictOptions: {},
url: {
list: '/inventory/inventoryBom/childList'
},
superFieldList: [],
}
},
created() {
this.getSuperFieldList();
},
computed: {},
watch: {
record: {
immediate: true,
handler() {
if (this.record != null) {
this.loadData(this.record)
}
}
}
},
methods: {
getStatusColor(status) {
const colors = {
'可用': 'green',
'待质检': 'purple',
'不合格': 'red',
'锁定': 'red',
'冻结': 'red',
'空闲': 'green',
'有货': 'purple',
'满盘': 'blue',
'待处理': 'orange',
'处理中': 'blue',
'处理完成': 'green',
'未识别': 'red',
default: 'cyan'
};
return colors[status] || colors.default;
},
loadData(record) {
if (!record) {
return;
}
this.loading = true;
this.dataSource = [];
getAction(this.url.list, {
materialCode: record.materialCode,
warehouseCode: record.warehouseCode,
}).then((res) => {
if (res.success) {
this.dataSource = res.result;
}
}).finally(() => {
this.loading = false
})
},
initDictConfig() {
},
getSuperFieldList() {
let fieldList = [];
fieldList.push({type: 'int', value: 'materialDocItem', text: '物料凭证行号', dictCode: ''})
fieldList.push({type: 'int', value: 'movementType', text: '移动类型', dictCode: ''})
fieldList.push({type: 'string', value: 'material', text: '物料号', dictCode: ''})
fieldList.push({type: 'string', value: 'plant', text: '工厂号', dictCode: ''})
fieldList.push({type: 'string', value: 'storageLocation', text: '存储地点', dictCode: ''})
fieldList.push({type: 'string', value: 'stockCategory', text: '库存状态', dictCode: ''})
fieldList.push({type: 'string', value: 'suNumber', text: '唯一号', dictCode: ''})
fieldList.push({type: 'string', value: 'container', text: '托盘号', dictCode: ''})
fieldList.push({type: 'string', value: 'purchaseOrder', text: '采购订单号', dictCode: ''})
fieldList.push({type: 'string', value: 'item', text: '采购订单行号', dictCode: ''})
fieldList.push({type: 'string', value: 'supplier', text: '供应商编码', dictCode: ''})
fieldList.push({type: 'BigDecimal', value: 'quantity', text: '数量', dictCode: ''})
fieldList.push({type: 'string', value: 'wbsElement', text: '项目号', dictCode: ''})
fieldList.push({type: 'string', value: 'productionOrder', text: '生产订单号', dictCode: ''})
fieldList.push({type: 'string', value: 'inOut', text: '库存标识', dictCode: ''})
fieldList.push({type: 'string', value: 'headerText', text: '物料凭证描述', dictCode: ''})
fieldList.push({type: 'string', value: 'salesOrder', text: '销售订单号', dictCode: ''})
fieldList.push({type: 'string', value: 'salesOrderItem', text: '销售订单行号', dictCode: ''})
fieldList.push({type: 'string', value: 'reference', text: '关联号', dictCode: ''})
fieldList.push({type: 'string', value: 'deliveryLocation', text: '送货位置', dictCode: ''})
fieldList.push({type: 'datetime', value: 'deliveryTime', text: '送货时间'})
fieldList.push({type: 'string', value: 'netWork', text: '网络', dictCode: ''})
fieldList.push({type: 'string', value: 'orderId', text: '订单号', dictCode: ''})
fieldList.push({type: 'string', value: 'clientId', text: 'SAP收货标记', dictCode: ''})
this.superFieldList = fieldList
},
}
}
</script>
<style lang="less" scoped>
@import '~@assets/less/common.less';
::v-deep .ant-empty-normal {
margin: 0px;
}
</style>