正在显示
6 个修改的文件
包含
902 行增加
和
2 行删除
src/api/consigner/consignee.js
0 → 100644
1 | +import axios from 'axios' | ||
2 | +import http from "../http"; | ||
3 | + | ||
4 | + | ||
5 | +let baseUrl = 'wltp-flight-consigneeconsigner/consignee' | ||
6 | + | ||
7 | +export const getList = params => { return axios.get(`${baseUrl}/list`, { params: params }); }; | ||
8 | + | ||
9 | +export const remove = params => { return axios.delete(`${baseUrl}/remove`, { params: params }); }; | ||
10 | + | ||
11 | +export const add = params => { return http.post(`${baseUrl}/add`,params)}; | ||
12 | + | ||
13 | +export const edit = params => { return http.put(`${baseUrl}/edit`,params)}; | ||
14 | + | ||
15 | + |
src/api/consigner/consigner.js
0 → 100644
1 | +import axios from 'axios' | ||
2 | +import http from '../http.js' | ||
3 | + | ||
4 | + | ||
5 | +let baseUrl = 'wltp-flight-consigneeconsigner/consigner' | ||
6 | + | ||
7 | +export const getList = params => { return axios.get(`${baseUrl}/list`, { params: params }); }; | ||
8 | + | ||
9 | +export const remove = params => { return axios.delete(`${baseUrl}/remove`, { params: params }); }; | ||
10 | + | ||
11 | +export const add = params => { return http.post(`${baseUrl}/add`,params)}; | ||
12 | + | ||
13 | +export const edit = params => { return http.put(`${baseUrl}/edit`,params)}; | ||
14 | + | ||
15 | + |
@@ -83,6 +83,8 @@ import queryDeparture from './views/airtransport/queryDeparture.vue' | @@ -83,6 +83,8 @@ import queryDeparture from './views/airtransport/queryDeparture.vue' | ||
83 | import queryDeclare from './views/airtransport/queryDeclare.vue' | 83 | import queryDeclare from './views/airtransport/queryDeclare.vue' |
84 | import outConfigure from './views/airtransport/outConfigure.vue' | 84 | import outConfigure from './views/airtransport/outConfigure.vue' |
85 | import queryFlightConfigure from './views/airtransport/queryFlightConfigure.vue' | 85 | import queryFlightConfigure from './views/airtransport/queryFlightConfigure.vue' |
86 | +import Consigner from './views/consigner/consigner.vue' | ||
87 | +import Consignee from './views/consigner/consignee.vue' | ||
86 | 88 | ||
87 | 89 | ||
88 | 90 | ||
@@ -265,6 +267,16 @@ let routes = [ | @@ -265,6 +267,16 @@ let routes = [ | ||
265 | ] | 267 | ] |
266 | }, | 268 | }, |
267 | { | 269 | { |
270 | + path: '/con', | ||
271 | + component: Home, | ||
272 | + name: '收发货人管理', | ||
273 | + iconCls:'el-icon-goods', | ||
274 | + children:[ | ||
275 | + {path:'/consigner',component:Consigner,name:'发货人管理'}, | ||
276 | + {path:'/consignee',component:Consignee,name:'收货人管理'}, | ||
277 | + ] | ||
278 | + }, | ||
279 | + { | ||
268 | path: '/out', | 280 | path: '/out', |
269 | component: Home, | 281 | component: Home, |
270 | name: '出港申报', | 282 | name: '出港申报', |
src/views/consigner/consignee.vue
0 → 100644
1 | +<template> | ||
2 | + <section> | ||
3 | + <!--工具条--> | ||
4 | + <el-col :span="24" class="toolbar" style="padding-bottom: 0px;"> | ||
5 | + <el-form :inline="true" :model="filters"> | ||
6 | + <el-form-item> | ||
7 | + <el-input v-model="filters.companyName" placeholder="关键字查询"></el-input> | ||
8 | + </el-form-item> | ||
9 | + <el-form-item> | ||
10 | + <el-button type="primary" v-on:click="getConsigner()">查询</el-button> | ||
11 | + </el-form-item> | ||
12 | + <el-form-item> | ||
13 | + <el-button type="primary" @click="companyAdd">新增</el-button> | ||
14 | + </el-form-item> | ||
15 | + </el-form> | ||
16 | + </el-col> | ||
17 | + | ||
18 | + <!--列表--> | ||
19 | + <el-table :data="consignerList" highlight-current-row v-loading="listLoading" @selection-change="selsChange" style="width: 100%;"> | ||
20 | + <el-table-column type="selection" width="55"> | ||
21 | + </el-table-column> | ||
22 | + <el-table-column label="序号" type="index"> | ||
23 | + </el-table-column> | ||
24 | + <el-table-column prop="companyName" label="收货人公司" sortable> | ||
25 | + </el-table-column> | ||
26 | + <el-table-column prop="conCity" label="收货人城市" sortable> | ||
27 | + </el-table-column> | ||
28 | + <el-table-column prop="country" label="收货人国家代码" sortable> | ||
29 | + </el-table-column> | ||
30 | + <el-table-column prop="conPhone" label="收货人电话" sortable> | ||
31 | + </el-table-column> | ||
32 | + <el-table-column prop="enterprise" label="收货人企业代码" sortable> | ||
33 | + </el-table-column> | ||
34 | + <el-table-column label="操作" min-width="150"> | ||
35 | + <template slot-scope="scope"> | ||
36 | + <el-button size="small" @click="handleEdit(scope.$index, scope.row)">编辑</el-button> | ||
37 | + <el-button type="danger" size="small" @click="handleDel(scope.$index, scope.row)">删除</el-button> | ||
38 | + </template> | ||
39 | + </el-table-column> | ||
40 | + </el-table> | ||
41 | + | ||
42 | + <!--编辑界面--> | ||
43 | + <el-dialog title="编辑" :visible.sync="editFormVisible" :close-on-click-modal="false"> | ||
44 | + <el-form :model="editForm" label-width="100px" :rules="editFormRules" ref="editForm"> | ||
45 | + <el-form-item label="ID"> | ||
46 | + <span>{{editForm.id}}</span> | ||
47 | + </el-form-item> | ||
48 | + <el-form-item label="公司" prop="companyName"> | ||
49 | + <el-input v-model="editForm.companyName" auto-complete="on" placeholder="公司"></el-input> | ||
50 | + </el-form-item> | ||
51 | + <el-form-item label="收货人名称" prop="conName"> | ||
52 | + <el-input v-model="editForm.conName" auto-complete="on" placeholder="收货人名称"></el-input> | ||
53 | + </el-form-item> | ||
54 | + <el-form-item label="电话" prop="conPhone"> | ||
55 | + <el-input v-model="editForm.conPhone" auto-complete="on" placeholder="电话"></el-input> | ||
56 | + </el-form-item> | ||
57 | + <el-form-item label="传真" prop="conFax"> | ||
58 | + <el-input v-model="editForm.conFax" auto-complete="on" placeholder="传真"></el-input> | ||
59 | + </el-form-item> | ||
60 | + <el-form-item label="国家代码" prop="country"> | ||
61 | + <el-input v-model="editForm.country" auto-complete="on" placeholder="国家代码"></el-input> | ||
62 | + </el-form-item> | ||
63 | + <el-form-item label="城市" prop="conCity"> | ||
64 | + <el-input v-model="editForm.conCity" auto-complete="on" placeholder="城市"></el-input> | ||
65 | + </el-form-item> | ||
66 | + <el-form-item label="邮编" prop="conPostcode"> | ||
67 | + <el-input v-model="editForm.conPostcode" auto-complete="on" placeholder="邮编"></el-input> | ||
68 | + </el-form-item> | ||
69 | + <el-form-item label="地址" prop="conAddress"> | ||
70 | + <el-input v-model="editForm.conAddress" auto-complete="on" placeholder="地址"></el-input> | ||
71 | + </el-form-item> | ||
72 | + <el-form-item label="收货人AEO" prop="conAeo"> | ||
73 | + <el-input v-model="editForm.conAeo" auto-complete="on" placeholder="收货人AEO"></el-input> | ||
74 | + </el-form-item> | ||
75 | + <el-row> | ||
76 | + <el-col :span="6"> | ||
77 | + <el-form-item label="企业代码" prop="enterprise"> | ||
78 | + <el-select v-model="editForm.enterprise" placeholder="请选择"> | ||
79 | + <el-option | ||
80 | + v-for="item in options" | ||
81 | + :key="item.value" | ||
82 | + :label="item.label" | ||
83 | + :value="item.value"> | ||
84 | + </el-option> | ||
85 | + </el-select> | ||
86 | + </el-form-item> | ||
87 | + </el-col> | ||
88 | + <el-col :span="10"> | ||
89 | + <el-form-item label="+" prop="enterprise"> | ||
90 | + <el-input v-model="editForm.ent"/> | ||
91 | + </el-form-item> | ||
92 | + </el-col> | ||
93 | + </el-row> | ||
94 | + </el-form> | ||
95 | + <div slot="footer" class="dialog-footer"> | ||
96 | + <el-button @click.native="editFormVisible = false">取消</el-button> | ||
97 | + <el-button type="primary" @click.native="editSubmit">提交</el-button> | ||
98 | + </div> | ||
99 | + </el-dialog> | ||
100 | + | ||
101 | + <!--新增界面--> | ||
102 | + <el-dialog title="新增" :visible.sync="addFormVisible" :close-on-click-modal="false"> | ||
103 | + <el-form :model="addForm" label-width="100px" :rules="addFormRules" ref="addForm"> | ||
104 | + <el-form-item label="公司" prop="companyName"> | ||
105 | + <el-input v-model="addForm.companyName" auto-complete="on" placeholder="公司"></el-input> | ||
106 | + </el-form-item> | ||
107 | + <el-form-item label="收货人名称" prop="conName"> | ||
108 | + <el-input v-model="addForm.conName" auto-complete="on" placeholder="收货人名称"></el-input> | ||
109 | + </el-form-item> | ||
110 | + <el-form-item label="电话" prop="conPhone"> | ||
111 | + <el-input v-model="addForm.conPhone" auto-complete="on" placeholder="电话"></el-input> | ||
112 | + </el-form-item> | ||
113 | + <el-form-item label="传真" prop="conFax"> | ||
114 | + <el-input v-model="addForm.conFax" auto-complete="on" placeholder="传真"></el-input> | ||
115 | + </el-form-item> | ||
116 | + <el-form-item label="国家代码" prop="country"> | ||
117 | + <el-input v-model="addForm.country" auto-complete="on" placeholder="国家代码"></el-input> | ||
118 | + </el-form-item> | ||
119 | + <el-form-item label="城市" prop="conCity"> | ||
120 | + <el-input v-model="addForm.conCity" auto-complete="on" placeholder="城市"></el-input> | ||
121 | + </el-form-item> | ||
122 | + <el-form-item label="邮编" prop="conPostcode"> | ||
123 | + <el-input v-model="addForm.conPostcode" auto-complete="on" placeholder="邮编"></el-input> | ||
124 | + </el-form-item> | ||
125 | + <el-form-item label="地址" prop="conAddress"> | ||
126 | + <el-input v-model="addForm.conAddress" auto-complete="on" placeholder="地址"></el-input> | ||
127 | + </el-form-item> | ||
128 | + <el-form-item label="收货人AEO" prop="conAeo"> | ||
129 | + <el-input v-model="addForm.conAeo" auto-complete="on" placeholder="收货人AEO"></el-input> | ||
130 | + </el-form-item> | ||
131 | + <el-row> | ||
132 | + <el-col :span="6"> | ||
133 | + <el-form-item label="企业代码" prop="enterprise"> | ||
134 | + <el-select v-model="addForm.enterprise" placeholder="请选择"> | ||
135 | + <el-option | ||
136 | + v-for="item in options" | ||
137 | + :key="item.value" | ||
138 | + :label="item.label" | ||
139 | + :value="item.value"> | ||
140 | + </el-option> | ||
141 | + </el-select> | ||
142 | + </el-form-item> | ||
143 | + </el-col> | ||
144 | + <el-col :span="10"> | ||
145 | + <el-form-item label="+" prop="enterprise"> | ||
146 | + <el-input v-model="addForm.ent"/> | ||
147 | + </el-form-item> | ||
148 | + </el-col> | ||
149 | + </el-row> | ||
150 | + </el-form> | ||
151 | + <div slot="footer" class="dialog-footer"> | ||
152 | + <el-button @click.native="addFormVisible = false">取消</el-button> | ||
153 | + <el-button type="primary" @click.native="addSubmit">提交</el-button> | ||
154 | + </div> | ||
155 | + </el-dialog> | ||
156 | + </section> | ||
157 | +</template> | ||
158 | + | ||
159 | +<script> | ||
160 | + import util from '../../common/js/util' | ||
161 | + import NProgress from 'nprogress' | ||
162 | + import { getList, remove, add, edit} from '../../api/consigner/consignee'; | ||
163 | + import moment from 'moment' | ||
164 | + | ||
165 | + export default { | ||
166 | + data() { | ||
167 | + return { | ||
168 | + | ||
169 | + options: [{ | ||
170 | + value: 'USCI', | ||
171 | + label: 'USCI' | ||
172 | + }, { | ||
173 | + value: 'OC', | ||
174 | + label: 'OC' | ||
175 | + }, { | ||
176 | + value: '9999', | ||
177 | + label: '9999' | ||
178 | + }], | ||
179 | + | ||
180 | + filters: { | ||
181 | + companyName: '' | ||
182 | + }, | ||
183 | + consignerList: [], | ||
184 | + total: 0, | ||
185 | + pageSize: 1, | ||
186 | + limitSize: 5, | ||
187 | + listLoading: false, | ||
188 | + //编辑界面是否显示 | ||
189 | + editFormVisible: false, | ||
190 | + editLoading: false, | ||
191 | + editFormRules: { | ||
192 | + | ||
193 | + companyName: [ | ||
194 | + { required: true, message: '不能为空!!!', trigger: 'blur' } | ||
195 | + ], | ||
196 | + | ||
197 | + conName: [ | ||
198 | + { required: true, message: '不能为空!!!', trigger: 'blur' } | ||
199 | + ], | ||
200 | + country: [ | ||
201 | + { required: true, message: '不能为空!!!', trigger: 'blur' } | ||
202 | + ], | ||
203 | + enterprise: [ | ||
204 | + { required: true, message: '不能为空!!!', trigger: 'blur' } | ||
205 | + ], | ||
206 | + conCity: [ | ||
207 | + { required: true, message: '不能为空!!!', trigger: 'blur' } | ||
208 | + ] | ||
209 | + }, | ||
210 | + //编辑界面数据 | ||
211 | + editForm: { | ||
212 | + id:'', | ||
213 | + companyName: '', | ||
214 | + conAddress: '', | ||
215 | + conAeo: '', | ||
216 | + conCity: '', | ||
217 | + conFax: '', | ||
218 | + conName: '', | ||
219 | + conPhone: '', | ||
220 | + conPostcode: '', | ||
221 | + country: '', | ||
222 | + enterprise: '', | ||
223 | + ent: '' | ||
224 | + }, | ||
225 | + //新增界面是否显示 | ||
226 | + addFormVisible: false, | ||
227 | + addFormRules: { | ||
228 | + companyName: [ | ||
229 | + { required: true, message: '不能为空!!!', trigger: 'blur' } | ||
230 | + ], | ||
231 | + conName: [ | ||
232 | + { required: true, message: '不能为空!!!', trigger: 'blur' } | ||
233 | + ], | ||
234 | + country: [ | ||
235 | + { required: true, message: '不能为空!!!', trigger: 'blur' } | ||
236 | + ], | ||
237 | + enterprise: [ | ||
238 | + { required: true, message: '不能为空!!!', trigger: 'blur' } | ||
239 | + ], | ||
240 | + conCity: [ | ||
241 | + { required: true, message: '不能为空!!!', trigger: 'blur' } | ||
242 | + ] | ||
243 | + }, | ||
244 | + | ||
245 | + //新增界面数据 | ||
246 | + addForm: { | ||
247 | + companyName: '', | ||
248 | + conAddress: '', | ||
249 | + conAeo: '', | ||
250 | + conCity: '', | ||
251 | + conFax: '', | ||
252 | + conName: '', | ||
253 | + conPhone: '', | ||
254 | + conPostcode: '', | ||
255 | + country: '', | ||
256 | + enterprise: '', | ||
257 | + ent: '' | ||
258 | + } | ||
259 | + } | ||
260 | + }, | ||
261 | + mounted() { | ||
262 | + this.getConsigner(); | ||
263 | + | ||
264 | + }, | ||
265 | + methods: { | ||
266 | + | ||
267 | + //获取收货人列表 | ||
268 | + getConsigner() { | ||
269 | + let para = { | ||
270 | + pageSize: this.pageSize, | ||
271 | + limitSize: this.limitSize, | ||
272 | + companyName: this.filters.companyName | ||
273 | + }; | ||
274 | + this.listLoading = true; | ||
275 | + getList(para).then((res) => { | ||
276 | + this.total = res.data.data.total; | ||
277 | + this.consignerList = res.data.data.list; | ||
278 | + this.listLoading = false; | ||
279 | + }).catch((error) => { | ||
280 | + this.listLoading = false; | ||
281 | + if(null!= error.response && error.response!==undefined){ | ||
282 | + let status= error.response.status; | ||
283 | + let msg = error.response.statusText; | ||
284 | + alert(status+msg); | ||
285 | + }else { | ||
286 | + alert(error); | ||
287 | + } | ||
288 | + | ||
289 | + }); | ||
290 | + | ||
291 | + }, | ||
292 | + | ||
293 | + | ||
294 | + //删除 | ||
295 | + handleDel: function (index, row) { | ||
296 | + this.$confirm('确认删除该记录吗?', '提示', { | ||
297 | + type: 'warning' | ||
298 | + }).then(() => { | ||
299 | + this.listLoading = true; | ||
300 | + let para = {id: row.id }; | ||
301 | + remove(para).then((res) => { | ||
302 | + if (res.data.code == 200){ | ||
303 | + this.listLoading = false; | ||
304 | + this.$message({ | ||
305 | + message: '删除成功', | ||
306 | + type: 'success' | ||
307 | + }); | ||
308 | + this.getConsigner(); | ||
309 | + }else { | ||
310 | + this.listLoading = false; | ||
311 | + this.$message({ | ||
312 | + message: '删除失败', | ||
313 | + type: 'error' | ||
314 | + }); | ||
315 | + this.getConsigner(); | ||
316 | + } | ||
317 | + | ||
318 | + }).catch((error) => { | ||
319 | + this.listLoading = false; | ||
320 | + alert(error); | ||
321 | + }); | ||
322 | + }).catch(); | ||
323 | + }, | ||
324 | + /** | ||
325 | + * 显示编辑界面 | ||
326 | + * @param index | ||
327 | + * @param row 为这行的数据对象 | ||
328 | + */ | ||
329 | + handleEdit: function (index, row) { | ||
330 | + this.editFormVisible = true; | ||
331 | + this.editForm = Object.assign({}, row); | ||
332 | + this.getConsigner(); | ||
333 | + }, | ||
334 | + | ||
335 | + //编辑 | ||
336 | + editSubmit: function () { | ||
337 | + | ||
338 | + this.$refs.editForm.validate((valid) => { | ||
339 | + if (valid) { | ||
340 | + this.$confirm('确认提交吗?', '提示', {}).then(() => { | ||
341 | + this.editLoading = true; | ||
342 | + let para = Object.assign({}, this.editForm); | ||
343 | + this.editLoading = true; | ||
344 | + edit(para).then((res) => { | ||
345 | + if (res.data.code == 200){ | ||
346 | + this.$message({ | ||
347 | + message: '提交成功', | ||
348 | + type: 'success' | ||
349 | + }); | ||
350 | + this.$refs['editForm'].resetFields(); | ||
351 | + this.editFormVisible = false; | ||
352 | + this.getConsigner(); | ||
353 | + }else { | ||
354 | + this.$message({ | ||
355 | + message: '提交失败', | ||
356 | + type: 'error' | ||
357 | + }); | ||
358 | + } | ||
359 | + | ||
360 | + }).catch(error => alert(error)); | ||
361 | + }); | ||
362 | + } | ||
363 | + }); | ||
364 | + }, | ||
365 | + | ||
366 | + //显示新增界面,每次点开初始化数据 | ||
367 | + companyAdd: function () { | ||
368 | + this.addFormVisible = true; | ||
369 | + this.getConsigner(); | ||
370 | + }, | ||
371 | + //新增 | ||
372 | + addSubmit: function () { | ||
373 | + this.$refs.addForm.validate((valid) => { | ||
374 | + if (valid) { | ||
375 | + this.$confirm('确认提交吗?', '提示', {}).then(() => { | ||
376 | + //NProgress.start(); | ||
377 | + this.listLoading = true; | ||
378 | + this.addForm.enterprise = this.addForm.enterprise+"+"+this.addForm.ent; | ||
379 | + let para = Object.assign({}, this.addForm); | ||
380 | + add(para).then((res) => { | ||
381 | + if (res.data.code == 200){ | ||
382 | + //NProgress.done(); | ||
383 | + this.$message({ | ||
384 | + message: '提交成功', | ||
385 | + type: 'success' | ||
386 | + }); | ||
387 | + this.$refs['addForm'].resetFields(); | ||
388 | + this.addFormVisible = false; | ||
389 | + this.getConsigner(); | ||
390 | + }else { | ||
391 | + this.$message({ | ||
392 | + message: '提交失败', | ||
393 | + type: 'error' | ||
394 | + }); | ||
395 | + } | ||
396 | + }).catch(error => alert(error)); | ||
397 | + }); | ||
398 | + } | ||
399 | + }); | ||
400 | + }, | ||
401 | + selsChange: function (sels) { | ||
402 | + this.sels = sels; | ||
403 | + }, | ||
404 | + //批量删除 | ||
405 | + batchRemove: function () { | ||
406 | + var ids = this.sels.map(item => item.id).toString(); | ||
407 | + this.$confirm('确认删除选中记录吗?', '提示', { | ||
408 | + type: 'warning' | ||
409 | + }).then(() => { | ||
410 | + this.listLoading = true; | ||
411 | + //NProgress.start(); | ||
412 | + let para = { ids: ids }; | ||
413 | + batchRemove(para).then((res) => { | ||
414 | + this.listLoading = false; | ||
415 | + //NProgress.done(); | ||
416 | + this.$message({ | ||
417 | + message: '删除成功', | ||
418 | + type: 'success' | ||
419 | + }); | ||
420 | + this.getConsigner(); | ||
421 | + }); | ||
422 | + }).catch(() => { | ||
423 | + | ||
424 | + }); | ||
425 | + } | ||
426 | + }, | ||
427 | + | ||
428 | + } | ||
429 | +</script> |
src/views/consigner/consigner.vue
0 → 100644
1 | +<template> | ||
2 | + <section> | ||
3 | + <!--工具条--> | ||
4 | + <el-col :span="24" class="toolbar" style="padding-bottom: 0px;"> | ||
5 | + <el-form :inline="true" :model="filters"> | ||
6 | + <el-form-item> | ||
7 | + <el-input v-model="filters.companyName" placeholder="关键字查询"></el-input> | ||
8 | + </el-form-item> | ||
9 | + <el-form-item> | ||
10 | + <el-button type="primary" v-on:click="getConsigner()">查询</el-button> | ||
11 | + </el-form-item> | ||
12 | + <el-form-item> | ||
13 | + <el-button type="primary" @click="companyAdd">新增</el-button> | ||
14 | + </el-form-item> | ||
15 | + </el-form> | ||
16 | + </el-col> | ||
17 | + | ||
18 | + <!--列表--> | ||
19 | + <el-table :data="consignerList" highlight-current-row v-loading="listLoading" @selection-change="selsChange" style="width: 100%;"> | ||
20 | + <el-table-column type="selection" width="55"> | ||
21 | + </el-table-column> | ||
22 | + <el-table-column label="序号" type="index"> | ||
23 | + </el-table-column> | ||
24 | + <el-table-column prop="companyName" label="发货人公司" sortable> | ||
25 | + </el-table-column> | ||
26 | + <el-table-column prop="conCity" label="发货人城市" sortable> | ||
27 | + </el-table-column> | ||
28 | + <el-table-column prop="country" label="发货人国家代码" sortable> | ||
29 | + </el-table-column> | ||
30 | + <el-table-column prop="conPhone" label="发货人电话" sortable> | ||
31 | + </el-table-column> | ||
32 | + <el-table-column prop="enterprise" label="发货人企业代码" sortable> | ||
33 | + </el-table-column> | ||
34 | + <el-table-column label="操作" min-width="150"> | ||
35 | + <template slot-scope="scope"> | ||
36 | + <el-button size="small" @click="handleEdit(scope.$index, scope.row)">编辑</el-button> | ||
37 | + <el-button type="danger" size="small" @click="handleDel(scope.$index, scope.row)">删除</el-button> | ||
38 | + </template> | ||
39 | + </el-table-column> | ||
40 | + </el-table> | ||
41 | + | ||
42 | + <!--编辑界面--> | ||
43 | + <el-dialog title="编辑" :visible.sync="editFormVisible" :close-on-click-modal="false"> | ||
44 | + <el-form :model="editForm" label-width="100px" :rules="editFormRules" ref="editForm"> | ||
45 | + <el-form-item label="ID"> | ||
46 | + <span>{{editForm.id}}</span> | ||
47 | + </el-form-item> | ||
48 | + <el-form-item label="公司" prop="companyName"> | ||
49 | + <el-input v-model="editForm.companyName" auto-complete="on" placeholder="公司"></el-input> | ||
50 | + </el-form-item> | ||
51 | + <el-form-item label="发货人名称" prop="conName"> | ||
52 | + <el-input v-model="editForm.conName" auto-complete="on" placeholder="发货人名称"></el-input> | ||
53 | + </el-form-item> | ||
54 | + <el-form-item label="电话" prop="conPhone"> | ||
55 | + <el-input v-model="editForm.conPhone" auto-complete="on" placeholder="电话"></el-input> | ||
56 | + </el-form-item> | ||
57 | + <el-form-item label="传真" prop="conFax"> | ||
58 | + <el-input v-model="editForm.conFax" auto-complete="on" placeholder="传真"></el-input> | ||
59 | + </el-form-item> | ||
60 | + <el-form-item label="国家代码" prop="country"> | ||
61 | + <el-input v-model="editForm.country" auto-complete="on" placeholder="国家代码"></el-input> | ||
62 | + </el-form-item> | ||
63 | + <el-form-item label="城市" prop="conCity"> | ||
64 | + <el-input v-model="editForm.conCity" auto-complete="on" placeholder="城市"></el-input> | ||
65 | + </el-form-item> | ||
66 | + <el-form-item label="邮编" prop="conPostcode"> | ||
67 | + <el-input v-model="editForm.conPostcode" auto-complete="on" placeholder="邮编"></el-input> | ||
68 | + </el-form-item> | ||
69 | + <el-form-item label="地址" prop="conAddress"> | ||
70 | + <el-input v-model="editForm.conAddress" auto-complete="on" placeholder="地址"></el-input> | ||
71 | + </el-form-item> | ||
72 | + <el-form-item label="发货人AEO" prop="conAeo"> | ||
73 | + <el-input v-model="editForm.conAeo" auto-complete="on" placeholder="发货人AEO"></el-input> | ||
74 | + </el-form-item> | ||
75 | + <el-row> | ||
76 | + <el-col :span="6"> | ||
77 | + <el-form-item label="企业代码" prop="enterprise"> | ||
78 | + <el-select v-model="editForm.enterprise" placeholder="请选择"> | ||
79 | + <el-option | ||
80 | + v-for="item in options" | ||
81 | + :key="item.value" | ||
82 | + :label="item.label" | ||
83 | + :value="item.value"> | ||
84 | + </el-option> | ||
85 | + </el-select> | ||
86 | + </el-form-item> | ||
87 | + </el-col> | ||
88 | + <el-col :span="10"> | ||
89 | + <el-form-item label="+" prop="enterprise"> | ||
90 | + <el-input v-model="editForm.ent"/> | ||
91 | + </el-form-item> | ||
92 | + </el-col> | ||
93 | + </el-row> | ||
94 | + </el-form> | ||
95 | + <div slot="footer" class="dialog-footer"> | ||
96 | + <el-button @click.native="editFormVisible = false">取消</el-button> | ||
97 | + <el-button type="primary" @click.native="editSubmit" :loading="editLoading">提交</el-button> | ||
98 | + </div> | ||
99 | + </el-dialog> | ||
100 | + | ||
101 | + <!--新增界面--> | ||
102 | + <el-dialog title="新增" :visible.sync="addFormVisible" :close-on-click-modal="false"> | ||
103 | + <el-form :model="addForm" label-width="100px" :rules="addFormRules" ref="addForm"> | ||
104 | + <el-form-item label="公司" prop="companyName"> | ||
105 | + <el-input v-model="addForm.companyName" auto-complete="on" placeholder="公司"></el-input> | ||
106 | + </el-form-item> | ||
107 | + <el-form-item label="发货人名称" prop="conName"> | ||
108 | + <el-input v-model="addForm.conName" auto-complete="on" placeholder="发货人名称"></el-input> | ||
109 | + </el-form-item> | ||
110 | + <el-form-item label="电话" prop="conPhone"> | ||
111 | + <el-input v-model="addForm.conPhone" auto-complete="on" placeholder="电话"></el-input> | ||
112 | + </el-form-item> | ||
113 | + <el-form-item label="传真" prop="conFax"> | ||
114 | + <el-input v-model="addForm.conFax" auto-complete="on" placeholder="传真"></el-input> | ||
115 | + </el-form-item> | ||
116 | + <el-form-item label="国家代码" prop="country"> | ||
117 | + <el-input v-model="addForm.country" auto-complete="on" placeholder="国家代码"></el-input> | ||
118 | + </el-form-item> | ||
119 | + <el-form-item label="城市" prop="conCity"> | ||
120 | + <el-input v-model="addForm.conCity" auto-complete="on" placeholder="城市"></el-input> | ||
121 | + </el-form-item> | ||
122 | + <el-form-item label="邮编" prop="conPostcode"> | ||
123 | + <el-input v-model="addForm.conPostcode" auto-complete="on" placeholder="邮编"></el-input> | ||
124 | + </el-form-item> | ||
125 | + <el-form-item label="地址" prop="conAddress"> | ||
126 | + <el-input v-model="addForm.conAddress" auto-complete="on" placeholder="地址"></el-input> | ||
127 | + </el-form-item> | ||
128 | + <el-form-item label="发货人AEO" prop="conAeo"> | ||
129 | + <el-input v-model="addForm.conAeo" auto-complete="on" placeholder="发货人AEO"></el-input> | ||
130 | + </el-form-item> | ||
131 | + <el-row> | ||
132 | + <el-col :span="6"> | ||
133 | + <el-form-item label="企业代码" prop="enterprise"> | ||
134 | + <el-select v-model="addForm.enterprise" placeholder="请选择"> | ||
135 | + <el-option | ||
136 | + v-for="item in options" | ||
137 | + :key="item.value" | ||
138 | + :label="item.label" | ||
139 | + :value="item.value"> | ||
140 | + </el-option> | ||
141 | + </el-select> | ||
142 | + </el-form-item> | ||
143 | + </el-col> | ||
144 | + <el-col :span="10"> | ||
145 | + <el-form-item label="+" prop="enterprise"> | ||
146 | + <el-input v-model="addForm.ent"/> | ||
147 | + </el-form-item> | ||
148 | + </el-col> | ||
149 | + </el-row> | ||
150 | + </el-form> | ||
151 | + <div slot="footer" class="dialog-footer"> | ||
152 | + <el-button @click.native="addFormVisible = false">取消</el-button> | ||
153 | + <el-button type="primary" @click.native="addSubmit">提交</el-button> | ||
154 | + </div> | ||
155 | + </el-dialog> | ||
156 | + </section> | ||
157 | +</template> | ||
158 | + | ||
159 | +<script> | ||
160 | + import util from '../../common/js/util' | ||
161 | + import NProgress from 'nprogress' | ||
162 | + import { getList, remove, add, edit} from '../../api/consigner/consigner'; | ||
163 | + import moment from 'moment' | ||
164 | + | ||
165 | + export default { | ||
166 | + data() { | ||
167 | + return { | ||
168 | + | ||
169 | + options: [{ | ||
170 | + value: 'USCI', | ||
171 | + label: 'USCI' | ||
172 | + }, { | ||
173 | + value: 'OC', | ||
174 | + label: 'OC' | ||
175 | + }, { | ||
176 | + value: '9999', | ||
177 | + label: '9999' | ||
178 | + }], | ||
179 | + | ||
180 | + filters: { | ||
181 | + companyName: '' | ||
182 | + }, | ||
183 | + consignerList: [], | ||
184 | + total: 0, | ||
185 | + pageSize: 1, | ||
186 | + limitSize: 5, | ||
187 | + listLoading: false, | ||
188 | + //编辑界面是否显示 | ||
189 | + editFormVisible: false, | ||
190 | + editLoading: false, | ||
191 | + editFormRules: { | ||
192 | + | ||
193 | + companyName: [ | ||
194 | + { required: true, message: '不能为空!!!', trigger: 'blur' } | ||
195 | + ], | ||
196 | + | ||
197 | + conName: [ | ||
198 | + { required: true, message: '不能为空!!!', trigger: 'blur' } | ||
199 | + ], | ||
200 | + country: [ | ||
201 | + { required: true, message: '不能为空!!!', trigger: 'blur' } | ||
202 | + ], | ||
203 | + enterprise: [ | ||
204 | + { required: true, message: '不能为空!!!', trigger: 'blur' } | ||
205 | + ], | ||
206 | + conCity: [ | ||
207 | + { required: true, message: '不能为空!!!', trigger: 'blur' } | ||
208 | + ] | ||
209 | + }, | ||
210 | + //编辑界面数据 | ||
211 | + editForm: { | ||
212 | + id:'', | ||
213 | + companyName: '', | ||
214 | + conAddress: '', | ||
215 | + conAeo: '', | ||
216 | + conCity: '', | ||
217 | + conFax: '', | ||
218 | + conName: '', | ||
219 | + conPhone: '', | ||
220 | + conPostcode: '', | ||
221 | + country: '', | ||
222 | + enterprise: '', | ||
223 | + ent: '' | ||
224 | + }, | ||
225 | + //新增界面是否显示 | ||
226 | + addFormVisible: false, | ||
227 | + addFormRules: { | ||
228 | + companyName: [ | ||
229 | + { required: true, message: '不能为空!!!', trigger: 'blur' } | ||
230 | + ], | ||
231 | + conName: [ | ||
232 | + { required: true, message: '不能为空!!!', trigger: 'blur' } | ||
233 | + ], | ||
234 | + country: [ | ||
235 | + { required: true, message: '不能为空!!!', trigger: 'blur' } | ||
236 | + ], | ||
237 | + enterprise: [ | ||
238 | + { required: true, message: '不能为空!!!', trigger: 'blur' } | ||
239 | + ], | ||
240 | + conCity: [ | ||
241 | + { required: true, message: '不能为空!!!', trigger: 'blur' } | ||
242 | + ] | ||
243 | + }, | ||
244 | + | ||
245 | + //新增界面数据 | ||
246 | + addForm: { | ||
247 | + companyName: '', | ||
248 | + conAddress: '', | ||
249 | + conAeo: '', | ||
250 | + conCity: '', | ||
251 | + conFax: '', | ||
252 | + conName: '', | ||
253 | + conPhone: '', | ||
254 | + conPostcode: '', | ||
255 | + country: '', | ||
256 | + enterprise: '', | ||
257 | + ent: '' | ||
258 | + } | ||
259 | + } | ||
260 | + }, | ||
261 | + mounted() { | ||
262 | + this.getConsigner(); | ||
263 | + | ||
264 | + }, | ||
265 | + methods: { | ||
266 | + | ||
267 | + //获取发货人列表 | ||
268 | + getConsigner() { | ||
269 | + let para = { | ||
270 | + pageSize: this.pageSize, | ||
271 | + limitSize: this.limitSize, | ||
272 | + companyName: this.filters.companyName | ||
273 | + }; | ||
274 | + this.listLoading = true; | ||
275 | + getList(para).then((res) => { | ||
276 | + this.total = res.data.data.total; | ||
277 | + this.consignerList = res.data.data.list; | ||
278 | + this.listLoading = false; | ||
279 | + }).catch((error) => { | ||
280 | + this.listLoading = false; | ||
281 | + if(null!= error.response && error.response!==undefined){ | ||
282 | + let status= error.response.status; | ||
283 | + let msg = error.response.statusText; | ||
284 | + alert(status+msg); | ||
285 | + }else { | ||
286 | + alert(error); | ||
287 | + } | ||
288 | + | ||
289 | + }); | ||
290 | + | ||
291 | + }, | ||
292 | + | ||
293 | + | ||
294 | + //删除 | ||
295 | + handleDel: function (index, row) { | ||
296 | + this.$confirm('确认删除该记录吗?', '提示', { | ||
297 | + type: 'warning' | ||
298 | + }).then(() => { | ||
299 | + this.listLoading = true; | ||
300 | + let para = {id: row.id }; | ||
301 | + remove(para).then((res) => { | ||
302 | + if (res.data.code == 200){ | ||
303 | + this.listLoading = false; | ||
304 | + this.$message({ | ||
305 | + message: '删除成功', | ||
306 | + type: 'success' | ||
307 | + }); | ||
308 | + this.getConsigner(); | ||
309 | + }else { | ||
310 | + this.listLoading = false; | ||
311 | + this.$message({ | ||
312 | + message: '删除失败', | ||
313 | + type: 'error' | ||
314 | + }); | ||
315 | + this.getConsigner(); | ||
316 | + } | ||
317 | + | ||
318 | + }).catch((error) => { | ||
319 | + this.listLoading = false; | ||
320 | + alert(error); | ||
321 | + }); | ||
322 | + }).catch(); | ||
323 | + }, | ||
324 | + /** | ||
325 | + * 显示编辑界面 | ||
326 | + * @param index | ||
327 | + * @param row 为这行的数据对象 | ||
328 | + */ | ||
329 | + handleEdit: function (index, row) { | ||
330 | + this.editFormVisible = true; | ||
331 | + this.editForm = Object.assign({}, row); | ||
332 | + this.getConsigner(); | ||
333 | + }, | ||
334 | + | ||
335 | + //编辑 | ||
336 | + editSubmit: function () { | ||
337 | + | ||
338 | + this.$refs.editForm.validate((valid) => { | ||
339 | + if (valid) { | ||
340 | + this.$confirm('确认提交吗?', '提示', {}).then(() => { | ||
341 | + this.editLoading = true; | ||
342 | + let para = Object.assign({}, this.editForm); | ||
343 | + this.editLoading = true; | ||
344 | + edit(para).then((res) => { | ||
345 | + if (res.data.code == 200){ | ||
346 | + this.$message({ | ||
347 | + message: '提交成功', | ||
348 | + type: 'success' | ||
349 | + }); | ||
350 | + this.$refs['editForm'].resetFields(); | ||
351 | + this.editFormVisible = false; | ||
352 | + this.getConsigner(); | ||
353 | + }else { | ||
354 | + this.$message({ | ||
355 | + message: '提交失败', | ||
356 | + type: 'error' | ||
357 | + }); | ||
358 | + } | ||
359 | + | ||
360 | + }).catch(error => alert(error)); | ||
361 | + }); | ||
362 | + } | ||
363 | + }); | ||
364 | + }, | ||
365 | + | ||
366 | + //显示新增界面,每次点开初始化数据 | ||
367 | + companyAdd: function () { | ||
368 | + this.addFormVisible = true; | ||
369 | + this.getConsigner(); | ||
370 | + }, | ||
371 | + //新增 | ||
372 | + addSubmit: function () { | ||
373 | + this.$refs.addForm.validate((valid) => { | ||
374 | + if (valid) { | ||
375 | + this.$confirm('确认提交吗?', '提示', {}).then(() => { | ||
376 | + //NProgress.start(); | ||
377 | + this.listLoading = true; | ||
378 | + this.addForm.enterprise = this.addForm.enterprise+"+"+this.addForm.ent; | ||
379 | + let para = Object.assign({}, this.addForm); | ||
380 | + add(para).then((res) => { | ||
381 | + if (res.data.code == 200){ | ||
382 | + //NProgress.done(); | ||
383 | + this.$message({ | ||
384 | + message: '提交成功', | ||
385 | + type: 'success' | ||
386 | + }); | ||
387 | + this.$refs['addForm'].resetFields(); | ||
388 | + this.addFormVisible = false; | ||
389 | + this.getConsigner(); | ||
390 | + }else { | ||
391 | + this.$message({ | ||
392 | + message: '提交失败', | ||
393 | + type: 'error' | ||
394 | + }); | ||
395 | + } | ||
396 | + }).catch(error => alert(error)); | ||
397 | + }); | ||
398 | + } | ||
399 | + }); | ||
400 | + }, | ||
401 | + selsChange: function (sels) { | ||
402 | + this.sels = sels; | ||
403 | + }, | ||
404 | + //批量删除 | ||
405 | + batchRemove: function () { | ||
406 | + var ids = this.sels.map(item => item.id).toString(); | ||
407 | + this.$confirm('确认删除选中记录吗?', '提示', { | ||
408 | + type: 'warning' | ||
409 | + }).then(() => { | ||
410 | + this.listLoading = true; | ||
411 | + //NProgress.start(); | ||
412 | + let para = { ids: ids }; | ||
413 | + batchRemove(para).then((res) => { | ||
414 | + this.listLoading = false; | ||
415 | + //NProgress.done(); | ||
416 | + this.$message({ | ||
417 | + message: '删除成功', | ||
418 | + type: 'success' | ||
419 | + }); | ||
420 | + this.getConsigner(); | ||
421 | + }); | ||
422 | + }).catch(() => { | ||
423 | + | ||
424 | + }); | ||
425 | + } | ||
426 | + }, | ||
427 | + | ||
428 | + } | ||
429 | +</script> |
-
请 注册 或 登录 后发表评论