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
<template>
<el-dialog :title="$t('批量提货')" visible :before-close="closeDialog" :close-on-click-modal="false">
<el-form :model="form">
<el-tabs v-model="current" type="card">
<el-tab-pane :label="$t('全部提货')" name="createOrderPickupBatch">
<el-form-item :label="$t('订单号') + '/' + this.$t('提单号')" required>
<el-input v-model="form.orderId" :placeholder="$t('例:NA2200001L')"></el-input>
<div>{{$t('注:单号之间使用逗号或空格隔开')}}</div>
</el-form-item>
<el-form-item :label="$t('提货时间')">
<el-date-picker v-model="form.pickTime" placeholder="" value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>
</el-form-item>
</el-tab-pane>
<el-tab-pane :label="$t('分批提货')" name="createOrderPickupSplitBatch">
// TODO
</el-tab-pane>
</el-tabs>
<el-form-item label="">
<el-button type="primary" @click="submit">{{$t('提交')}}</el-button>
</el-form-item>
</el-form>
</el-dialog>
</template>
<script>
import {createOrderPickupBatch, createOrderPickupSplitBatch} from '@/api/ecw/order'
export default {
props:{
},
data(){
return {
current: 'createOrderPickupBatch',
show: false,
form:{
orderId: '',
pickTime: '',
pickType: 1
},
}
},
computed:{
},
created(){
},
methods:{
submit(){
if(this.form.orderId == '' || this.form.pickTime==''){
return this.$message.error(this.$t('请填写订单号和提货时间'))
}
let orderIdArr = this.form.orderId.replace(/,/g, ' ').split(' ').filter(item => item !='')
let data = []
for(let orderId of orderIdArr){
data.push({
pickType: 1,
orderId,
pickTime: this.form.pickTime
})
}
({createOrderPickupBatch, createOrderPickupSplitBatch}[this.current])(data).then(res => {
this.$message.success(this.$t("操作成功"));
this.form.orderId = ''
})
},
closeDialog(){
this.show = false
this.$emit('close');
}
}
}
</script>