|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
<template>
<j-modal
:title="title"
:width="width"
:visible="visible"
:confirmLoading="confirmLoading"
switchFullscreen
@ok="handleOk"
@cancel="handleCancel"
cancelText="关闭"
>
<a-spin :spinning="confirmLoading">
<a-form-model ref="form" :model="model" :rules="validatorRules">
<a-row>
<a-col :span="24">
<a-form-model-item label="出库口" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="outPortCode">
|
谭毅彬
authored
|
17
18
19
20
21
22
|
<a-select
show-search
placeholder="请选择出库口"
option-filter-prop="children"
v-model="model.outPortCode"
>
|
|
23
24
25
26
27
28
29
30
31
|
<a-select-option v-for="item in portList" :key="item.name" :value="item.code">
{{ item.name }}
</a-select-option>
</a-select>
</a-form-model-item>
</a-col>
</a-row>
</a-form-model>
</a-spin>
|
xcq
authored
|
32
33
34
35
36
37
38
39
40
41
42
43
44
|
<a-table ref="table" rowKey="id" size="middle" :columns="columns" :dataSource="dataSource" :pagination="false">
<span slot="action" slot-scope="text, record">
<a-input-number placeholder="" v-model="record.shipmentQty" :value="text" />
</span>
<span slot="inventoryStatus" slot-scope="inventoryStatus">
<a-tag :key="inventoryStatus" color="blue" :color="getStatusColor(inventoryStatus)">
{{ solutionInvStatus(inventoryStatus) }}
</a-tag>
</span>
</a-table>
|
|
45
46
47
48
|
</j-modal>
</template>
<script>
|
谭毅彬
authored
|
49
|
import { getZoneList, selectOutPort, shipmentInventoryDetail } from '@/api/api'
|
xcq
authored
|
50
|
import {getAction} from "@api/manage";
|
|
51
52
|
export default {
|
谭毅彬
authored
|
53
54
|
name: 'QuickShipmentDetailModal',
components: {},
|
|
55
56
57
|
data() {
return {
title: '操作',
|
xcq
authored
|
58
|
width: 800,
|
|
59
60
|
portList: [],
inventoryDetailList: [],
|
xcq
authored
|
61
|
dataSource: [],
|
|
62
63
64
65
66
67
68
69
70
71
72
|
querySource: {},
visible: false,
model: {},
labelCol: {
xs: { span: 24 },
sm: { span: 5 }
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 }
},
|
xcq
authored
|
73
74
|
columns: [
{
|
肖超群
authored
|
75
76
77
78
79
|
title: '容器编码',
dataIndex: 'containerCode',
align: 'center',
},
{
|
xcq
authored
|
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
|
title: '物料编码',
dataIndex: 'materialCode',
align: 'center',
width: 124
},
{
title: '物料名称',
dataIndex: 'materialName',
align: 'center',
width: 96
},
{
title: '库存状态',
align: 'center',
dataIndex: 'inventoryStatus_dictText',
scopedSlots: {customRender: 'inventoryStatus_dictText'}
},
{
title: '批次',
dataIndex: 'batch',
align: 'center'
},
{
title: '库存数量',
dataIndex: 'qty',
align: 'center',
width: 80
},
{
title: '出库数量',
dataIndex: 'shipmentQty',
align: 'center',
key: 'action',
scopedSlots: { customRender: 'action' }
},
],
url: {
pageByMainIds: "/inventory/inventoryDetail/pageByMainIds",
},
|
|
119
120
121
122
123
124
125
126
127
128
|
// 选择用户查询条件配置
selectUserQueryConfig: [],
confirmLoading: false,
validatorRules: {
outPortCode: [{ required: true, message: '请选择出库口!' }]
}
}
},
created() {
//备份model原始值
|
谭毅彬
authored
|
129
|
this.modelDefault = JSON.parse(JSON.stringify(this.model))
|
|
130
131
132
133
134
135
|
},
methods: {
add() {
this.edit(this.modelDefault)
},
edit(record) {
|
谭毅彬
authored
|
136
137
138
139
|
this.visible = true
this.model.containerCode = record[0].containerCode
this.inventoryDetailList = record
this.getPortList()
|
xcq
authored
|
140
|
this.searchInventoryDetailList();
|
|
141
142
143
144
145
146
147
148
149
150
|
},
close() {
this.$emit('close')
this.visible = false
this.$refs.form.clearValidate()
},
getPortList() {
this.querySource.containerCode = this.model.containerCode
selectOutPort(this.querySource).then(res => {
if (res.success) {
|
谭毅彬
authored
|
151
152
|
this.portList = res.result
this.visible = true
|
|
153
154
155
|
}
})
},
|
xcq
authored
|
156
157
158
159
160
161
162
163
164
165
166
167
168
|
searchInventoryDetailList(){
let params = {
inventoryHeaderIds:""
};
this.inventoryDetailList.forEach(x=>{
params.inventoryHeaderIds+= + x.inventoryHeaderId + ","
})
debugger
getAction(this.url.pageByMainIds, params).then((res) => {
this.dataSource = res.result.records
this.inventoryDetailList = res.result.records
})
},
|
|
169
|
handleOk() {
|
谭毅彬
authored
|
170
171
|
if (this.model.outPortCode === '') {
this.$message.warning('请选择出库口')
|
|
172
|
}
|
谭毅彬
authored
|
173
174
|
this.inventoryDetailList.forEach(x => {
x['toPortCode'] = this.model.outPortCode
|
|
175
|
})
|
谭毅彬
authored
|
176
|
shipmentInventoryDetail(this.inventoryDetailList).then(res => {
|
|
177
|
if (res.success) {
|
谭毅彬
authored
|
178
|
this.$message.success(res.message)
|
xcq
authored
|
179
|
this.$emit('ok')
|
|
180
|
} else {
|
谭毅彬
authored
|
181
|
this.$message.error(res.message)
|
|
182
|
}
|
谭毅彬
authored
|
183
184
|
})
this.$emit('ok', this.model.outPortCode)
|
|
185
186
187
188
189
190
191
192
|
this.close()
},
handleCancel() {
this.close()
}
}
}
</script>
|