Importallocation.vue
8.5 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
<template>
<el-container>
<el-main>
<el-row class="row-bg">
<el-col :span="24"><div class="grid-content content co">分拨运单管理</div></el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm":label-position="labelPosition">
<el-form-item label="运单号" prop="awba">
<el-input v-model="ruleForm.awba"></el-input>
</el-form-item>
<el-form-item label="承运人" prop="carrier">
<el-input v-model="ruleForm.carrier"></el-input>
</el-form-item>
<el-form-item label="航班号" prop="flightno">
<el-input v-model="ruleForm.flightno"></el-input>
</el-form-item>
<el-form-item label="拖车号" prop="pno">
<el-input v-model="ruleForm.pno"></el-input>
</el-form-item>
<el-form-item label="航班日期" required>
<el-col :span="24">
<el-form-item prop="flightdate">
<el-date-picker type="date" placeholder="选择日期" v-model="ruleForm.flightdate" style="width: 100%;"></el-date-picker>
</el-form-item>
</el-col>
</el-form-item>
<el-form-item label="分拨件数" prop="turnpiece">
<el-input v-model="ruleForm.turnpiece"></el-input>
</el-form-item>
<el-form-item label="分拨重量" prop="turnweight">
<el-input v-model="ruleForm.turnweight"></el-input>
</el-form-item>
<el-form-item label="海关关区" prop="customcode">
<el-col :span="24">
<el-select v-model="ruleForm.customcode" placeholder="请选择海关关区" style="width:100%">
<el-option v-for="item in options2" :key="item.value" :label="item.label"
:value="item.value" ></el-option>
</el-select>
</el-col>
</el-form-item>
<el-form-item label="分拨到达" prop="turnunloading">
<el-col :span="24">
<el-select v-model="ruleForm.turnunloading" placeholder="请选择分拨到达地" style="width:100%">
<el-option v-for="item in options" :key="item.value" :label="item.label"
:value="item.value" ></el-option>
</el-select>
</el-col>
</el-form-item>
</el-form>
</el-col>
<el-col :span="12">
<el-button type="primary" @click="submitForm('ruleForm')">保存</el-button>
<el-button type="primary" @click="submitSend('ruleForm')">保存发送</el-button>
</el-col>
</el-row>
<!--对话提示框-->
<el-row>
<el-dialog
title="系统提示"
:visible.sync="centerDialogVisible"
width="30%"
center>
<span>{{msg}}</span>
<span slot="footer" class="dialog-footer">
<el-button @click="DialogVisible">取 消</el-button>
<el-button type="primary" @click="DialogVisible">确 定</el-button>
</span>
</el-dialog>
</el-row>
</el-main>
</el-container>
</template>
<style scoped>
.co{height: 36px;line-height: 36px;}
.co{border-left: 4px #409EFF solid;padding-left: 10px;background-color: #f9fafc;margin-bottom: 2px}
.row-bg{background-color: white;padding:0px;}
</style>
<script>
import { addAllocatImport } from '../../api/Allocat'
export default {
data(){
return{
ruleForm: {
awba: '',
carrier: '',
flightno: '',
flightdate:'',
turnpiece:'',
turnweight:'',
customcode:'',
turnunloading:'',
pno:''
},
rules: {
awba: [
{ required: true, message: '请输入运单号', trigger: 'blur' },
],
carrier: [
{ required: true, message: '请输入承运人', trigger: 'blur' }
],
flightno: [
{ required: true, message: '请输入航班号', trigger: 'blur' }
],
turnpiece: [
{ required: true, message: '请输入分拨件数', trigger: 'blur' }
],
turnweight: [
{ required: true, message: '请输入分拨重量', trigger: 'blur' }
],
flightdate: [
{required: true, message: '航班日期必须选择', trigger: 'change'}
],
customcode: [
{ required: true, message: '请选择海关关区', trigger: 'change' }
],
turnunLoading: [
{ required: true, message: '请选择分拨到达地', trigger: 'change' }
],
},
options2: [
{
value: '4604',
label: '4604'
}, {
value: '4620',
label: '4620'
}, {
value: '4613',
label: '4613'
}],
options: [
{
value: 'CNZGZ460044/4620',
label: 'CNZGZ460044/4620'
}, {
value: 'CNCGO460011/4604',
label: 'CNCGO460011/4604'
}, {
value: 'CNCGO460011/4613',
label: 'CNCGO460011/4613'
}],
labelPosition:'left',
centerDialogVisible:false,
msg:'',
code:''
}
},
methods:{
submitForm(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
addAllocatImport(this.ruleForm).then(res=>{
let response=res.data;
//console.log(res);
this.code=response.code;
if(this.code=='200'){
this.centerDialogVisible=true;
this.msg=response.msg;
}else{
this.centerDialogVisible=true;
this.msg=response.msg;
}
});
} else {
console.log('error submit!!');
return false;
}
});
},
getDefaultData(){
this.ruleForm=this.$route.params;
},
DialogVisible(){
this.centerDialogVisible=false;
this.$router.push({name:'运单分拨申报',params:{awba:this.ruleForm.awba}});
}
},
mounted(){
this.getDefaultData();
}
}
</script>