Allocatearrive.vue
11.3 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
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
<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 class="row-bg">
<el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="10px" class="demo-ruleForm":label-position="labelPosition">
<el-row>
<el-col :span="6">
<el-form-item label="" prop="awba">
<el-input v-model="ruleForm.awba" style="width: 200px">
<template slot="prepend">运 单 号</template>
</el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="5">
<el-form-item label="" prop="carrier">
<el-input v-model="ruleForm.carrier" style="width: 160px" onkeyup="this.value=this.value.toUpperCase()">
<template slot="prepend">承 运 人</template>
</el-input>
</el-form-item>
</el-col>
<el-col :span="5">
<el-form-item label="" prop="flightno">
<el-input v-model="ruleForm.flightno" style="width: 160px">
<template slot="prepend">航 班 号</template>
</el-input>
</el-form-item>
</el-col>
<el-col :span="7">
<el-form-item label="" required>
<el-form-item prop="flightdate">
<div class="ip">
航班日期
</div>
<el-date-picker type="date" placeholder="选择日期" v-model="ruleForm.flightdate" style="width: 125px;"></el-date-picker>
</el-form-item>
</el-form-item>
</el-col>
<el-col :span="7">
<el-form-item label="" prop="customcode">
<div class="ip">
海关关区
</div>
<el-select v-model="ruleForm.customcode" placeholder="请选择海关关区" style="width:125px">
<el-option v-for="item in options2" :key="item.value" :label="item.label"
:value="item.value" ></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="5" style="margin-top: -20px">
<el-form-item label="" prop="turnpiece">
<el-input v-model="ruleForm.turnpiece" style="width: 160px">
<template slot="prepend">运抵件数</template>
</el-input>
</el-form-item>
</el-col>
<el-col :span="5" style="margin-top: -20px">
<el-form-item label="" prop="turnweight">
<el-input v-model="ruleForm.turnweight" style="width: 160px">
<template slot="prepend">运抵重量</template>
</el-input>
</el-form-item>
</el-col>
<el-col :span="7" style="margin-top: -20px">
<el-form-item label="" prop="turnunloading">
<div class="ip">
运抵到达
</div>
<el-select v-model="ruleForm.turnunloading" placeholder="请选择运抵到达地" style="width:125px">
<el-option v-for="item in options" :key="item.value" :label="item.label"
:value="item.value" ></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="7" style="margin-top: -20px">
<el-form-item label="" prop="goodsname">
<el-input v-model="ruleForm.goodsname" style="width: 200px">
<template slot="prepend">货物描述</template>
</el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="4" :offset="10" style="margin-bottom: 10px">
<el-button type="primary" @click="submitForm('ruleForm')">保存</el-button>
<el-button @click="back">返回</el-button>
</el-col>
</el-row>
</el-form>
</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>
.ip{
max-width: 100px;
margin-right: -5px;
display: inline-block;
background-color: #6F8294;
color: #ffffff;
border: 1px solid #DCDFE6;
vertical-align: middle;
padding: 0 18px;
white-space: nowrap;
border-top-right-radius: 0px;
border-top-left-radius: 4px;
border-bottom-left-radius: 4px;
border-bottom-right-radius: 0px;
font-size: 10px;
}
.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 { addAllocatArrive } from '../../api/Allocat'
export default {
data(){
return{
ruleForm: {
awba: '',
carrier: '',
flightno: '',
flightdate:'',
turnpiece:'',
turnweight:'',
customcode:'',
turnunloading:'',
goodsname:'',
status:'22'
},
rules: {
awba: [
{ required: true, message: '请输入运单号', trigger: 'blur' },
],
carrier: [
{ required: true, message: '请输入承运人', trigger: 'blur' }
],
flightno: [
{ required: true, message: '请输入航班号', trigger: 'blur' }
],
goodsname: [
{ 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) {
addAllocatArrive(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;
}
});
},
// 过滤中英文
inputMe(e){
return e.replace(/[^a-zA-Z0-9.-]/g,'').toUpperCase();
},
getDefaultData(){
this.ruleForm=this.$route.params;
},
DialogVisible(){
this.centerDialogVisible=false;
this.$router.push({name:'运单分拨申报',params:{awba:this.ruleForm.awba}});
},
back(){
this.$router.go(-1);//返回上一层
},
},
activated(){
this.getDefaultData();
}
}
</script>