|
1
2
3
4
5
6
7
8
9
|
<template>
<j-modal
:title="title"
:width="width"
:visible="visible"
:confirmLoading="confirmLoading"
switchFullscreen
@ok="handleOk"
@cancel="handleCancel"
|
|
10
11
|
cancelText="关闭"
>
|
|
12
13
14
15
16
|
<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="containerCode">
|
|
17
|
<a-input v-model="model.containerCode" placeholder="请输入容器编码" style="width: 100%" />
|
|
18
19
20
21
22
|
</a-form-model-item>
</a-col>
</a-row>
</a-form-model>
</a-spin>
|
|
23
24
25
26
|
<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.taskQty" :value="text" />
</span>
|
|
27
28
29
30
31
|
</a-table>
</j-modal>
</template>
<script>
|
|
32
33
34
35
36
37
38
|
import { httpAction } from '@/api/manage'
import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { filterMultiDictText } from '@/components/dict/JDictSelectUtil'
import { validateDuplicateValue } from '@/utils/util'
import { searchMaterialByCode } from '@/api/api'
import { listReceiveByReceiptId } from '@/api/api'
|
|
39
|
|
|
40
|
export default {
|
|
41
|
name: 'ReceiveModal',
|
|
42
43
44
45
46
47
48
49
50
51
|
components: {},
props: {
mainId: {
type: String,
required: false,
default: ''
}
},
data() {
return {
|
|
52
|
title: '操作',
|
|
53
54
55
56
57
58
59
|
width: 800,
visible: false,
materialList: {},
querySource: {},
dataSource: [],
model: {},
labelCol: {
|
|
60
61
|
xs: { span: 24 },
sm: { span: 5 }
|
|
62
63
|
},
wrapperCol: {
|
|
64
65
|
xs: { span: 24 },
sm: { span: 16 }
|
|
66
67
68
69
70
|
},
columns: [
{
title: '物料编码',
dataIndex: 'materialCode',
|
|
71
72
|
align: 'center',
width: 124
|
|
73
|
},
|
|
74
75
76
|
{
title: '物料名称',
dataIndex: 'materialName',
|
|
77
78
|
align: 'center',
width: 96
|
|
79
|
},
|
|
80
81
82
|
{
title: '物料规格',
dataIndex: 'materialSpec',
|
|
83
84
|
align: 'center',
width: 96
|
|
85
|
},
|
|
86
87
88
|
{
title: '库存状态',
dataIndex: 'inventoryStatus',
|
|
89
90
|
align: 'center',
width: 96
|
|
91
92
93
94
|
},
{
title: '批次',
dataIndex: 'batch',
|
|
95
|
align: 'center'
|
|
96
|
},
|
|
97
98
99
|
{
title: '可收数量',
dataIndex: 'qty',
|
|
100
101
|
align: 'center',
width: 80
|
|
102
103
104
105
|
},
{
title: '收货数量',
dataIndex: 'action',
|
|
106
107
108
|
align: 'center',
key: 'action',
scopedSlots: { customRender: 'action' }
|
|
109
|
}
|
|
110
111
112
|
],
confirmLoading: false,
validatorRules: {
|
|
113
|
containerCode: [{ required: true, message: '请输入容器编码!' }]
|
|
114
|
},
|
|
115
116
|
dictOptions: {},
superFieldList:[],
|
|
117
|
url: {
|
|
118
119
|
add: '/receipt/receiveHeader/receiving',
edit: '/receipt/receiptHeader/editReceiptDetail'
|
|
120
|
}
|
|
121
122
123
|
}
},
created() {
|
|
124
|
//备份model原始值
|
|
125
126
127
|
// this.searchReceive()
this.getSuperFieldList()
// this.modelDefault = JSON.parse(JSON.stringify(this.model))
|
|
128
129
|
},
methods: {
|
|
130
131
132
133
|
// add() {
// this.edit(this.modelDefault)
// this.model.inventoryStatus = 'good'
// },
|
|
134
|
edit(record) {
|
|
135
136
137
|
this.model = Object.assign({}, record)
this.visible = true
this.searchReceive()
|
|
138
|
},
|
|
139
140
141
142
|
// show(record) {
// this.model = Object.assign({}, record)
// this.visible = true
// },
|
|
143
|
close() {
|
|
144
145
146
|
this.$emit('close')
this.visible = false
this.$refs.form.clearValidate()
|
|
147
148
|
},
searchReceive() {
|
|
149
150
151
152
|
const that = this
that.querySource.receiptCode = that.model.code
listReceiveByReceiptId(that.querySource).then(res => {
that.dataSource = res.result
|
|
153
154
|
})
},
|
|
155
156
157
158
159
160
|
initDictConfig() {},
getSuperFieldList() {
let fieldList = []
fieldList.push({type:'string',value:'inventoryStatus',text:'库存状态',dictCode:'inventory_status'})
this.superFieldList = fieldList
},
|
|
161
|
handleOk() {
|
|
162
163
|
console.log('handleOk')
const that = this
|
|
164
165
166
|
// 触发表单验证
this.$refs.form.validate(valid => {
if (valid) {
|
|
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
|
that.confirmLoading = true
let httpurl = ''
let method = ''
httpurl += this.url.add
method = 'post'
if (this.dataSource[0] == null) {
that.confirmLoading = false
that.$message.warning('入库单没有详情!')
return
}
this.dataSource[0].containerCode = this.model.containerCode
httpAction(httpurl, this.dataSource, method)
.then(res => {
if (res.success) {
that.$message.success(res.message)
that.$emit('ok')
that.close()
} else {
that.$message.warning(res.message)
}
})
.finally(() => {
that.confirmLoading = false
})
|
|
191
192
193
194
195
196
197
|
} else {
return false
}
})
},
handleCancel() {
this.close()
|
|
198
|
}
|
|
199
|
}
|
|
200
|
}
|
|
201
|
</script>
|