|
|
1
|
+<template>
|
|
|
2
|
+ <div>
|
|
|
3
|
+ <div>
|
|
|
4
|
+ <el-form :inline="true" :model="formInline" class="demo-form-inline">
|
|
|
5
|
+ <el-form-item label="主单号">
|
|
|
6
|
+ <el-input v-model="formInline.awba" placeholder="主单号"></el-input>
|
|
|
7
|
+ </el-form-item>
|
|
|
8
|
+ <el-form-item label="车号">
|
|
|
9
|
+ <el-input v-model="formInline.licenseno" placeholder="车号"></el-input>
|
|
|
10
|
+ </el-form-item>
|
|
|
11
|
+ <el-form-item>
|
|
|
12
|
+ <div class="block">
|
|
|
13
|
+ <span class="demonstration">日期</span>
|
|
|
14
|
+ <el-date-picker
|
|
|
15
|
+ v-model="value2"
|
|
|
16
|
+ type="daterange"
|
|
|
17
|
+ align="right"
|
|
|
18
|
+ unlink-panels
|
|
|
19
|
+ range-separator="至"
|
|
|
20
|
+ start-placeholder="开始日期"
|
|
|
21
|
+ end-placeholder="结束日期"
|
|
|
22
|
+ value-format="yyyy-MM-dd HH:mm:ss"
|
|
|
23
|
+ :picker-options="pickerOptions">
|
|
|
24
|
+ </el-date-picker>
|
|
|
25
|
+ </div>
|
|
|
26
|
+ </el-form-item>
|
|
|
27
|
+ <el-form-item>
|
|
|
28
|
+ <el-button type="primary" @click="getLists">查询</el-button>
|
|
|
29
|
+ </el-form-item>
|
|
|
30
|
+ <el-form-item>
|
|
|
31
|
+ <el-button type="success" @click="addVehicle">新增</el-button>
|
|
|
32
|
+ </el-form-item>
|
|
|
33
|
+ <el-form-item>
|
|
|
34
|
+ <el-button type="danger" @click="onPaidan">派单</el-button>
|
|
|
35
|
+ </el-form-item>
|
|
|
36
|
+ <el-form-item>
|
|
|
37
|
+ <el-form-item>
|
|
|
38
|
+ <el-upload
|
|
|
39
|
+ class="upload-demo"
|
|
|
40
|
+ action=""
|
|
|
41
|
+ :before-upload="beforeUpload"
|
|
|
42
|
+ :http-request="uploadFile"
|
|
|
43
|
+ :show-file-list="false"
|
|
|
44
|
+ >
|
|
|
45
|
+ <el-button size="small" type="primary">导入运单</el-button>
|
|
|
46
|
+ </el-upload>
|
|
|
47
|
+ </el-form-item>
|
|
|
48
|
+
|
|
|
49
|
+ <el-button type="success" @click="exportToExcel">导出 Excel</el-button>
|
|
|
50
|
+ </el-form-item>
|
|
|
51
|
+ </el-form>
|
|
|
52
|
+ </div>
|
|
|
53
|
+ <div>
|
|
|
54
|
+ <el-table
|
|
|
55
|
+ ref="multipleTable"
|
|
|
56
|
+ :data="tableData"
|
|
|
57
|
+ tooltip-effect="dark"
|
|
|
58
|
+ style="width: 100%"
|
|
|
59
|
+ @selection-change="handleSelectionChange">
|
|
|
60
|
+ <el-table-column
|
|
|
61
|
+ type="selection"
|
|
|
62
|
+ width="55">
|
|
|
63
|
+ </el-table-column>
|
|
|
64
|
+ <el-table-column
|
|
|
65
|
+ prop="customer"
|
|
|
66
|
+ label="客户名称"
|
|
|
67
|
+ width="120">
|
|
|
68
|
+ </el-table-column>
|
|
|
69
|
+ <el-table-column
|
|
|
70
|
+ prop="taketime"
|
|
|
71
|
+ label="日期"
|
|
|
72
|
+ width="120">
|
|
|
73
|
+ </el-table-column>
|
|
|
74
|
+ <el-table-column
|
|
|
75
|
+ prop="orig"
|
|
|
76
|
+ label="始发地"
|
|
|
77
|
+ show-overflow-tooltip>
|
|
|
78
|
+ </el-table-column>
|
|
|
79
|
+ <el-table-column
|
|
|
80
|
+ prop="dest"
|
|
|
81
|
+ label="目的地"
|
|
|
82
|
+ show-overflow-tooltip>
|
|
|
83
|
+ </el-table-column>
|
|
|
84
|
+ <el-table-column
|
|
|
85
|
+ prop="licenseno"
|
|
|
86
|
+ label="车号"
|
|
|
87
|
+ width="90">
|
|
|
88
|
+ <template slot-scope="scope">
|
|
|
89
|
+ <a type="text" style="color: #409eff;text-decoration: underline" class="tableInline"
|
|
|
90
|
+ @click="getReCord(scope.row)">{{scope.row.licenseno}}</a>
|
|
|
91
|
+ </template>
|
|
|
92
|
+ </el-table-column>
|
|
|
93
|
+ <el-table-column
|
|
|
94
|
+ prop="dispatch"
|
|
|
95
|
+ label="派单号"
|
|
|
96
|
+ width="150">
|
|
|
97
|
+ <template slot-scope="scope">
|
|
|
98
|
+ <router-link :to="{name:'派单记录', query:{jilu:scope.row}}">
|
|
|
99
|
+ <a>
|
|
|
100
|
+ {{scope.row.dispatch}}
|
|
|
101
|
+ </a>
|
|
|
102
|
+ </router-link>
|
|
|
103
|
+ </template>
|
|
|
104
|
+ </el-table-column>
|
|
|
105
|
+ <el-table-column
|
|
|
106
|
+ prop="awbh"
|
|
|
107
|
+ label="分单号"
|
|
|
108
|
+ width="140">
|
|
|
109
|
+ </el-table-column>
|
|
|
110
|
+ <el-table-column
|
|
|
111
|
+ prop="awba"
|
|
|
112
|
+ label="主单号"
|
|
|
113
|
+ width="110">
|
|
|
114
|
+ </el-table-column>
|
|
|
115
|
+ <el-table-column
|
|
|
116
|
+ prop="deststation"
|
|
|
117
|
+ label="目的港"
|
|
|
118
|
+ show-overflow-tooltip>
|
|
|
119
|
+ </el-table-column>
|
|
|
120
|
+ <el-table-column
|
|
|
121
|
+ prop="pcs"
|
|
|
122
|
+ label="件数"
|
|
|
123
|
+ show-overflow-tooltip>
|
|
|
124
|
+ </el-table-column>
|
|
|
125
|
+ <el-table-column
|
|
|
126
|
+ prop="weight"
|
|
|
127
|
+ label="毛重"
|
|
|
128
|
+ show-overflow-tooltip>
|
|
|
129
|
+ </el-table-column>
|
|
|
130
|
+ <el-table-column
|
|
|
131
|
+ prop="vol"
|
|
|
132
|
+ label="体积"
|
|
|
133
|
+ show-overflow-tooltip>
|
|
|
134
|
+ </el-table-column>
|
|
|
135
|
+ <el-table-column
|
|
|
136
|
+ prop="charge"
|
|
|
137
|
+ label="应收"
|
|
|
138
|
+ show-overflow-tooltip>
|
|
|
139
|
+ </el-table-column>
|
|
|
140
|
+ <el-table-column
|
|
|
141
|
+ fixed="right"
|
|
|
142
|
+ label="操作"
|
|
|
143
|
+ width="100">
|
|
|
144
|
+ <template slot-scope="scope">
|
|
|
145
|
+ <el-button @click="ediVehicle(scope.row)" type="text" size="small">编辑</el-button>
|
|
|
146
|
+ <el-button @click="delVehicleWaybill(scope.row.id)" type="text" size="small">删除</el-button>
|
|
|
147
|
+ </template>
|
|
|
148
|
+ </el-table-column>
|
|
|
149
|
+ </el-table>
|
|
|
150
|
+ </div>
|
|
|
151
|
+ <div>
|
|
|
152
|
+ <div class="block">
|
|
|
153
|
+ <el-row>
|
|
|
154
|
+ <el-col :span="14">
|
|
|
155
|
+ <el-pagination
|
|
|
156
|
+ @size-change="handleSizeChange"
|
|
|
157
|
+ @current-change="handleCurrentChange"
|
|
|
158
|
+ :current-page="formInline.pageNum"
|
|
|
159
|
+ :page-sizes="[20, 30, 40, 100]"
|
|
|
160
|
+ :page-size="formInline.pageSize"
|
|
|
161
|
+ layout="total, sizes, prev, pager, next, jumper"
|
|
|
162
|
+ :total="total">
|
|
|
163
|
+ </el-pagination>
|
|
|
164
|
+ </el-col>
|
|
|
165
|
+ </el-row>
|
|
|
166
|
+ </div>
|
|
|
167
|
+ </div>
|
|
|
168
|
+ <div>
|
|
|
169
|
+ <el-dialog
|
|
|
170
|
+ :title="'车载运单'+textMap[dialogStatus]"
|
|
|
171
|
+ :visible.sync="dialogVisible"
|
|
|
172
|
+ width="75%"
|
|
|
173
|
+ :before-close="handleClose">
|
|
|
174
|
+ <el-form :inline="true" label-width="80px" :model="submitForm"
|
|
|
175
|
+ class="demo-form-inline">
|
|
|
176
|
+ <el-form-item label="客户名称">
|
|
|
177
|
+ <el-select v-model="submitForm.customer"
|
|
|
178
|
+ @click.native="getUsers"
|
|
|
179
|
+ default-first-option
|
|
|
180
|
+ :loading="loading" clearable placeholder="请选择"
|
|
|
181
|
+ style="width: 157px">
|
|
|
182
|
+ <el-option
|
|
|
183
|
+ v-for="item in usernames"
|
|
|
184
|
+ :key="item.roleName"
|
|
|
185
|
+ :label="item.roleName"
|
|
|
186
|
+ :value="item.roleName"
|
|
|
187
|
+ :disabled="item.disabled">
|
|
|
188
|
+ </el-option>
|
|
|
189
|
+ </el-select>
|
|
|
190
|
+ </el-form-item>
|
|
|
191
|
+ <el-form-item label="日期">
|
|
|
192
|
+ <div class="block">
|
|
|
193
|
+ <el-date-picker
|
|
|
194
|
+ style="width: 157px"
|
|
|
195
|
+ v-model="submitForm.taketime"
|
|
|
196
|
+ type="date"
|
|
|
197
|
+ format="yyyy-MM-dd"
|
|
|
198
|
+ placeholder="选择日期">
|
|
|
199
|
+ </el-date-picker>
|
|
|
200
|
+ </div>
|
|
|
201
|
+ </el-form-item>
|
|
|
202
|
+ <el-form-item label="始发地">
|
|
|
203
|
+ <el-input v-model="submitForm.orig" placeholder="始发地"></el-input>
|
|
|
204
|
+ </el-form-item>
|
|
|
205
|
+ <el-form-item label="目的地">
|
|
|
206
|
+ <el-input v-model="submitForm.dest" placeholder="目的地"></el-input>
|
|
|
207
|
+ </el-form-item>
|
|
|
208
|
+ <el-form-item label="车号">
|
|
|
209
|
+ <el-input v-model="submitForm.licenseno" placeholder="车号"></el-input>
|
|
|
210
|
+ </el-form-item>
|
|
|
211
|
+ <el-form-item label="派单号">
|
|
|
212
|
+ <el-input v-model="submitForm.dispatch" placeholder="派单号"></el-input>
|
|
|
213
|
+ </el-form-item>
|
|
|
214
|
+ <el-form-item label="分单号">
|
|
|
215
|
+ <el-input v-model="submitForm.awbh" placeholder="分单号"></el-input>
|
|
|
216
|
+ </el-form-item>
|
|
|
217
|
+ <el-form-item label="主单号">
|
|
|
218
|
+ <el-input v-model="submitForm.awba" placeholder="主单号"></el-input>
|
|
|
219
|
+ </el-form-item>
|
|
|
220
|
+ <el-form-item label="目的港">
|
|
|
221
|
+ <el-input v-model="submitForm.deststation" placeholder="目的港"></el-input>
|
|
|
222
|
+ </el-form-item>
|
|
|
223
|
+ <el-form-item label="件数">
|
|
|
224
|
+ <el-input v-model="submitForm.pcs" placeholder="件数"></el-input>
|
|
|
225
|
+ </el-form-item>
|
|
|
226
|
+ <el-form-item label="毛重">
|
|
|
227
|
+ <el-input v-model="submitForm.weight" placeholder="毛重"></el-input>
|
|
|
228
|
+ </el-form-item>
|
|
|
229
|
+ <el-form-item label="体积">
|
|
|
230
|
+ <el-input v-model="submitForm.vol" placeholder="体积"></el-input>
|
|
|
231
|
+ </el-form-item>
|
|
|
232
|
+ <el-form-item label="应收">
|
|
|
233
|
+ <el-input v-model="submitForm.charge" placeholder="应收"></el-input>
|
|
|
234
|
+ </el-form-item>
|
|
|
235
|
+ <el-form-item label="危险品">
|
|
|
236
|
+ <el-select v-model="submitForm.isdangerous" style="width: 157px">
|
|
|
237
|
+ <el-option
|
|
|
238
|
+ v-for="item in options"
|
|
|
239
|
+ :key="item.value"
|
|
|
240
|
+ :label="item.label"
|
|
|
241
|
+ :value="item.value">
|
|
|
242
|
+ </el-option>
|
|
|
243
|
+ </el-select>
|
|
|
244
|
+ </el-form-item>
|
|
|
245
|
+ <el-form-item label="尺寸">
|
|
|
246
|
+ <el-input v-model="submitForm.means" placeholder="尺寸"></el-input>
|
|
|
247
|
+ </el-form-item>
|
|
|
248
|
+ <el-form-item label="备注">
|
|
|
249
|
+ <el-input v-model="submitForm.remark" placeholder="备注"></el-input>
|
|
|
250
|
+ </el-form-item>
|
|
|
251
|
+
|
|
|
252
|
+ </el-form>
|
|
|
253
|
+ <span slot="footer" class="dialog-footer" style="margin-right: 50px">
|
|
|
254
|
+ <el-button @click="dialogVisible = false">取 消</el-button>
|
|
|
255
|
+ <el-button type="primary" @click="dialogStatus==='create'?addVehicleWaybill():ediVehicleWaybill()">确 定</el-button>
|
|
|
256
|
+ </span>
|
|
|
257
|
+ </el-dialog>
|
|
|
258
|
+ </div>
|
|
|
259
|
+ <div>
|
|
|
260
|
+ <el-dialog
|
|
|
261
|
+ title="派单申请"
|
|
|
262
|
+ :visible.sync="PDdialogVisible"
|
|
|
263
|
+ width="30%"
|
|
|
264
|
+ :before-close="handleClose">
|
|
|
265
|
+ <el-form :model="PDForm" :rules="rules" ref="PDForm" label-width="100px" :label-position="labelPosition"
|
|
|
266
|
+ class="demo-ruleForm">
|
|
|
267
|
+ <el-form-item label="车号" prop="licenseno">
|
|
|
268
|
+ <el-input v-model="PDForm.licenseno"></el-input>
|
|
|
269
|
+ </el-form-item>
|
|
|
270
|
+ <el-form-item label="派单号" prop="dispatch">
|
|
|
271
|
+ <el-input v-model="PDForm.dispatch"></el-input>
|
|
|
272
|
+ </el-form-item>
|
|
|
273
|
+ <el-form-item label="始发地" prop="orig">
|
|
|
274
|
+ <el-input v-model="PDForm.orig"></el-input>
|
|
|
275
|
+ </el-form-item>
|
|
|
276
|
+ <el-form-item label="目的地" prop="dest">
|
|
|
277
|
+ <el-input v-model="PDForm.dest"></el-input>
|
|
|
278
|
+ </el-form-item>
|
|
|
279
|
+ <el-form-item>
|
|
|
280
|
+ <el-button type="primary" @click="submitPDForm('PDForm')">派单</el-button>
|
|
|
281
|
+ <el-button @click="resetForm('PDForm')">取消</el-button>
|
|
|
282
|
+ </el-form-item>
|
|
|
283
|
+ </el-form>
|
|
|
284
|
+
|
|
|
285
|
+ </el-dialog>
|
|
|
286
|
+ </div>
|
|
|
287
|
+ <div>
|
|
|
288
|
+ <el-dialog
|
|
|
289
|
+ :visible.sync="CardialogVisible"
|
|
|
290
|
+ width="65%"
|
|
|
291
|
+ :before-close="handleClose">
|
|
|
292
|
+ <el-descriptions class="margin-top" title="车辆信息" :column="3" :size="size" border>
|
|
|
293
|
+ <template slot="extra">
|
|
|
294
|
+ <el-button type="primary" @click="CardialogVisible = false">关闭</el-button>
|
|
|
295
|
+ </template>
|
|
|
296
|
+ <el-descriptions-item>
|
|
|
297
|
+ <template slot="label">
|
|
|
298
|
+ <i class="el-icon-user"></i>
|
|
|
299
|
+ 司机
|
|
|
300
|
+ </template>
|
|
|
301
|
+ {{carinfo.veOwnerName}}
|
|
|
302
|
+ </el-descriptions-item>
|
|
|
303
|
+ <el-descriptions-item>
|
|
|
304
|
+ <template slot="label">
|
|
|
305
|
+ <i class="el-icon-mobile-phone"></i>
|
|
|
306
|
+ 手机号
|
|
|
307
|
+ </template>
|
|
|
308
|
+ {{carinfo.ownerInsideTel}}
|
|
|
309
|
+ </el-descriptions-item>
|
|
|
310
|
+ <el-descriptions-item>
|
|
|
311
|
+ <template slot="label">
|
|
|
312
|
+ <i class="el-icon-truck"></i>
|
|
|
313
|
+ 车号
|
|
|
314
|
+ </template>
|
|
|
315
|
+ {{carinfo.domesticLisenceNo}}
|
|
|
316
|
+ </el-descriptions-item>
|
|
|
317
|
+ <el-descriptions-item>
|
|
|
318
|
+ <template slot="label">
|
|
|
319
|
+ <i class="el-icon-tickets"></i>
|
|
|
320
|
+ 驾驶证有效期
|
|
|
321
|
+ </template>
|
|
|
322
|
+ <el-tag size="small">{{carinfo.veFactoryDate}}</el-tag>
|
|
|
323
|
+ </el-descriptions-item>
|
|
|
324
|
+ <el-descriptions-item>
|
|
|
325
|
+ <template slot="label">
|
|
|
326
|
+ <i class="el-icon-shopping-cart-full"></i>
|
|
|
327
|
+ 车自重
|
|
|
328
|
+ </template>
|
|
|
329
|
+ {{carinfo.selfWt}}
|
|
|
330
|
+ </el-descriptions-item>
|
|
|
331
|
+ <el-descriptions-item>
|
|
|
332
|
+ <template slot="label">
|
|
|
333
|
+ <i class="el-icon-office-building"></i>
|
|
|
334
|
+ 地址
|
|
|
335
|
+ </template>
|
|
|
336
|
+ {{carinfo.proposer}}
|
|
|
337
|
+ </el-descriptions-item>
|
|
|
338
|
+ </el-descriptions>
|
|
|
339
|
+ </el-dialog>
|
|
|
340
|
+ </div>
|
|
|
341
|
+ </div>
|
|
|
342
|
+</template>
|
|
|
343
|
+<script>
|
|
|
344
|
+ import {
|
|
|
345
|
+ getUserList,
|
|
|
346
|
+ addVehicleWaybill,
|
|
|
347
|
+ delVehicleWaybill,
|
|
|
348
|
+ ediVehicleWaybill,
|
|
|
349
|
+ selectNewInventroyrecords,
|
|
|
350
|
+ paidan,
|
|
|
351
|
+ UploadExcel
|
|
|
352
|
+ } from "../../api/consigner/vehicle";
|
|
|
353
|
+ import {list} from "../../api/road_verecord/verecord";
|
|
|
354
|
+ import XLSX from 'xlsx';
|
|
|
355
|
+ import { saveAs } from 'file-saver';
|
|
|
356
|
+
|
|
|
357
|
+ export default {
|
|
|
358
|
+ data() {
|
|
|
359
|
+ return {
|
|
|
360
|
+ size: 'medium',
|
|
|
361
|
+ PDForm: {
|
|
|
362
|
+ licenseno: '',
|
|
|
363
|
+ orig: '',
|
|
|
364
|
+ dest: '',
|
|
|
365
|
+ dispatch: ''
|
|
|
366
|
+ },
|
|
|
367
|
+ rules: {
|
|
|
368
|
+ licenseno: [
|
|
|
369
|
+ {required: true, message: '请输入车号', trigger: 'blur'},
|
|
|
370
|
+ {min: 3, max: 15, message: '长度在 3 到 15 个字符', trigger: 'blur'}
|
|
|
371
|
+ ],
|
|
|
372
|
+ dispatch: [
|
|
|
373
|
+ {required: true, message: '请输入派单号', trigger: 'blur'},
|
|
|
374
|
+ {min: 3, max: 17, message: '长度在 3 到 17 个字符', trigger: 'blur'}
|
|
|
375
|
+ ],
|
|
|
376
|
+ orig: [
|
|
|
377
|
+ {required: true, message: '请输入始发地', trigger: 'blur'},
|
|
|
378
|
+ {min: 2, max: 100, message: '长度在 2 到 100 个字符', trigger: 'blur'}
|
|
|
379
|
+ ],
|
|
|
380
|
+ dest: [
|
|
|
381
|
+ {required: true, message: '请输入目的地', trigger: 'blur'},
|
|
|
382
|
+ {min: 2, max: 100, message: '长度在 3 到 100 个字符', trigger: 'blur'}
|
|
|
383
|
+ ],
|
|
|
384
|
+ },
|
|
|
385
|
+ labelPosition: 'left',
|
|
|
386
|
+ tableData: [],
|
|
|
387
|
+ multipleSelection: [],
|
|
|
388
|
+ formInline: {
|
|
|
389
|
+ awba: '',
|
|
|
390
|
+ licenseno: '',
|
|
|
391
|
+ starttime: '',
|
|
|
392
|
+ endtime: '',
|
|
|
393
|
+ pageNum: 1,
|
|
|
394
|
+ pageSize: 20
|
|
|
395
|
+ },
|
|
|
396
|
+ dialogStatus: '',
|
|
|
397
|
+ loading: false,
|
|
|
398
|
+ listLoading: false,
|
|
|
399
|
+ value2: '',
|
|
|
400
|
+ total: 0,
|
|
|
401
|
+ pickerOptions: {
|
|
|
402
|
+ shortcuts: [{
|
|
|
403
|
+ text: '最近一周',
|
|
|
404
|
+ onClick(picker) {
|
|
|
405
|
+ const end = new Date();
|
|
|
406
|
+ const start = new Date();
|
|
|
407
|
+ start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
|
|
|
408
|
+ picker.$emit('pick', [start, end]);
|
|
|
409
|
+ }
|
|
|
410
|
+ }, {
|
|
|
411
|
+ text: '最近一个月',
|
|
|
412
|
+ onClick(picker) {
|
|
|
413
|
+ const end = new Date();
|
|
|
414
|
+ const start = new Date();
|
|
|
415
|
+ start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
|
|
|
416
|
+ picker.$emit('pick', [start, end]);
|
|
|
417
|
+ }
|
|
|
418
|
+ }, {
|
|
|
419
|
+ text: '最近三个月',
|
|
|
420
|
+ onClick(picker) {
|
|
|
421
|
+ const end = new Date();
|
|
|
422
|
+ const start = new Date();
|
|
|
423
|
+ start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
|
|
|
424
|
+ picker.$emit('pick', [start, end]);
|
|
|
425
|
+ }
|
|
|
426
|
+ }]
|
|
|
427
|
+ },
|
|
|
428
|
+ currentPage4: 4,
|
|
|
429
|
+ submitForm: {
|
|
|
430
|
+ awba: "",
|
|
|
431
|
+ awbh: "",
|
|
|
432
|
+ charge: 0,
|
|
|
433
|
+ createtime: "",
|
|
|
434
|
+ customer: "",
|
|
|
435
|
+ dest: "",
|
|
|
436
|
+ deststation: "",
|
|
|
437
|
+ dispatch: "",
|
|
|
438
|
+ id: "",
|
|
|
439
|
+ isdangerous: 0,
|
|
|
440
|
+ licenseno: "",
|
|
|
441
|
+ means: "",
|
|
|
442
|
+ orig: "",
|
|
|
443
|
+ pcs: 0,
|
|
|
444
|
+ pic: "",
|
|
|
445
|
+ relevance: "",
|
|
|
446
|
+ remark: "",
|
|
|
447
|
+ remark1: "",
|
|
|
448
|
+ remark2: "",
|
|
|
449
|
+ taketime: "",
|
|
|
450
|
+ vol: 0,
|
|
|
451
|
+ weight: 0
|
|
|
452
|
+ },
|
|
|
453
|
+ dialogVisible: false,
|
|
|
454
|
+ PDdialogVisible: false,
|
|
|
455
|
+ CardialogVisible: false,
|
|
|
456
|
+ usernames: [],
|
|
|
457
|
+ options: [
|
|
|
458
|
+ {
|
|
|
459
|
+ value: 0,
|
|
|
460
|
+ label: '否'
|
|
|
461
|
+ }, {
|
|
|
462
|
+ value: 1,
|
|
|
463
|
+ label: '是'
|
|
|
464
|
+ }
|
|
|
465
|
+ ],
|
|
|
466
|
+ textMap: {
|
|
|
467
|
+ update: '编辑',
|
|
|
468
|
+ create: '新增'
|
|
|
469
|
+ },
|
|
|
470
|
+ carinfo: {
|
|
|
471
|
+ domesticLisenceNo: '',
|
|
|
472
|
+ veOwnerName: '',
|
|
|
473
|
+ ownerInsideTel: '',
|
|
|
474
|
+ proposer: '',
|
|
|
475
|
+ selfWt: '',
|
|
|
476
|
+ veFactoryDate: '',
|
|
|
477
|
+ veTon: '',
|
|
|
478
|
+ trailerLicenseNo: '',
|
|
|
479
|
+ trailerFrameNo: ''
|
|
|
480
|
+ },
|
|
|
481
|
+ }
|
|
|
482
|
+ },
|
|
|
483
|
+
|
|
|
484
|
+ methods: {
|
|
|
485
|
+ //导入运单excel
|
|
|
486
|
+ beforeUpload(file) {
|
|
|
487
|
+ // 检查文件类型
|
|
|
488
|
+ const isExcel = file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' || file.type === 'application/vnd.ms-excel';
|
|
|
489
|
+ if (!isExcel) {
|
|
|
490
|
+ this.$message.error('上传文件只能是 Excel 格式!');
|
|
|
491
|
+ return false; // 取消文件上传
|
|
|
492
|
+ }
|
|
|
493
|
+ return true; // 允许上传
|
|
|
494
|
+
|
|
|
495
|
+ },
|
|
|
496
|
+ uploadFile({ file, onSuccess, onError }){
|
|
|
497
|
+ // 生成 FormData 对象
|
|
|
498
|
+ const formData = new FormData();
|
|
|
499
|
+ formData.append('file', file);
|
|
|
500
|
+ UploadExcel(formData).then((response) => {
|
|
|
501
|
+ const res = response.data
|
|
|
502
|
+ if (res.code !== '200') {
|
|
|
503
|
+ return this.$message.error(res.msg);
|
|
|
504
|
+ }
|
|
|
505
|
+ this.$message.success(res.msg);
|
|
|
506
|
+ this.getLists();
|
|
|
507
|
+ onSuccess(response.data); // 调用 onSuccess 回调通知上传成功
|
|
|
508
|
+ }).catch(error => {
|
|
|
509
|
+ // 关闭加载
|
|
|
510
|
+ this.$message.error(error.toString())
|
|
|
511
|
+ onError(error); // 调用 onError 回调通知上传失败
|
|
|
512
|
+ })
|
|
|
513
|
+ },
|
|
|
514
|
+ //导出excel
|
|
|
515
|
+ exportToExcel() {
|
|
|
516
|
+ if(this.multipleSelection.length!==0){
|
|
|
517
|
+ const headers = {
|
|
|
518
|
+ customer: '客户名称',
|
|
|
519
|
+ taketime: '日期',
|
|
|
520
|
+ orig: '始发地',
|
|
|
521
|
+ dest: '目的地',
|
|
|
522
|
+ licenseno: '车号',
|
|
|
523
|
+ awba: '主单',
|
|
|
524
|
+ awbh: '分单',
|
|
|
525
|
+ deststation: '目的港',
|
|
|
526
|
+ pcs: '件数',
|
|
|
527
|
+ weight: '毛重',
|
|
|
528
|
+ vol: '体积',
|
|
|
529
|
+ means: '尺寸',
|
|
|
530
|
+ charge: '应收'
|
|
|
531
|
+ };
|
|
|
532
|
+
|
|
|
533
|
+ // Filter data to include only specified columns
|
|
|
534
|
+ const filteredData = this.multipleSelection.map(row => {
|
|
|
535
|
+ const newRow = {};
|
|
|
536
|
+ for (const key in headers) {
|
|
|
537
|
+ newRow[headers[key]] = row[key];
|
|
|
538
|
+ }
|
|
|
539
|
+ return newRow;
|
|
|
540
|
+ });
|
|
|
541
|
+
|
|
|
542
|
+ // Convert to worksheet and workbook
|
|
|
543
|
+ const ws = XLSX.utils.json_to_sheet(filteredData, { header: Object.values(headers) });
|
|
|
544
|
+ const wb = XLSX.utils.book_new();
|
|
|
545
|
+ XLSX.utils.book_append_sheet(wb, ws, 'Sheet1');
|
|
|
546
|
+ const wbout = XLSX.write(wb, { bookType: 'xlsx', type: 'array' });
|
|
|
547
|
+
|
|
|
548
|
+ saveAs(new Blob([wbout], { type: 'application/octet-stream' }), new Date().toLocaleString()+'.xlsx');
|
|
|
549
|
+ }else{
|
|
|
550
|
+ this.$message.warning('请先勾选要导出的数据!');
|
|
|
551
|
+ }
|
|
|
552
|
+
|
|
|
553
|
+ },
|
|
|
554
|
+ //查询车牌号
|
|
|
555
|
+ getReCord(row) {
|
|
|
556
|
+ let para = {
|
|
|
557
|
+ pageSize: 1,
|
|
|
558
|
+ limitSize: 10,
|
|
|
559
|
+ trailerFrameNo: row.licenseno,
|
|
|
560
|
+ veState: '',
|
|
|
561
|
+ veClassFlag: '',
|
|
|
562
|
+ userId: ''
|
|
|
563
|
+ };
|
|
|
564
|
+ list(para).then((res) => {
|
|
|
565
|
+ if(res.data.data.list.length!==0){
|
|
|
566
|
+ this.carinfo = res.data.data.list[0];
|
|
|
567
|
+ this.CardialogVisible=true;
|
|
|
568
|
+ }else{
|
|
|
569
|
+ this.$message.warning('无对应车辆信息!')
|
|
|
570
|
+ }
|
|
|
571
|
+ }).catch((error) => {
|
|
|
572
|
+ this.$message.warning('车辆查询,失败!')
|
|
|
573
|
+ });
|
|
|
574
|
+ },
|
|
|
575
|
+ //提交派单表单申请
|
|
|
576
|
+ submitPDForm(formName) {
|
|
|
577
|
+ this.$refs[formName].validate((valid) => {
|
|
|
578
|
+ if (valid) {
|
|
|
579
|
+ this.multipleSelection.forEach(item => {
|
|
|
580
|
+ item.licenseno = this.PDForm.licenseno;
|
|
|
581
|
+ item.orig = this.PDForm.orig;
|
|
|
582
|
+ item.dest = this.PDForm.dest;
|
|
|
583
|
+ item.dispatch = this.PDForm.dispatch;
|
|
|
584
|
+ });
|
|
|
585
|
+ paidan(this.multipleSelection).then((response) => {
|
|
|
586
|
+ const res = response.data
|
|
|
587
|
+ if (res.code !== '200') {
|
|
|
588
|
+ return this.$message.error('车辆派单,失败!')
|
|
|
589
|
+ }
|
|
|
590
|
+ this.$message.success('车辆派单,成功!')
|
|
|
591
|
+ this.PDdialogVisible = false;
|
|
|
592
|
+ }).catch(error => {
|
|
|
593
|
+ // 关闭加载
|
|
|
594
|
+ this.$message.warning('车辆派单,失败!')
|
|
|
595
|
+ })
|
|
|
596
|
+ } else {
|
|
|
597
|
+ return false;
|
|
|
598
|
+ }
|
|
|
599
|
+ });
|
|
|
600
|
+ },
|
|
|
601
|
+ //生成派单号
|
|
|
602
|
+ getCurrentFormattedDate() {
|
|
|
603
|
+ const now = new Date();
|
|
|
604
|
+ const pad = (num) => num.toString().padStart(2, '0');
|
|
|
605
|
+
|
|
|
606
|
+ const yyyy = now.getFullYear();
|
|
|
607
|
+ const MM = pad(now.getMonth() + 1);
|
|
|
608
|
+ const dd = pad(now.getDate());
|
|
|
609
|
+ const HH = pad(now.getHours());
|
|
|
610
|
+ const mm = pad(now.getMinutes());
|
|
|
611
|
+ const ss = pad(now.getSeconds());
|
|
|
612
|
+ const SSS = now.getMilliseconds().toString().padStart(3, '0');
|
|
|
613
|
+
|
|
|
614
|
+ return `${yyyy}${MM}${dd}${HH}${mm}${ss}${SSS}`;
|
|
|
615
|
+ },
|
|
|
616
|
+
|
|
|
617
|
+ //派单取消提交
|
|
|
618
|
+ resetForm(formName) {
|
|
|
619
|
+ this.$refs[formName].resetFields();
|
|
|
620
|
+ this.PDdialogVisible = false;
|
|
|
621
|
+ },
|
|
|
622
|
+ //更新车载运单
|
|
|
623
|
+ ediVehicleWaybill() {
|
|
|
624
|
+ ediVehicleWaybill(this.submitForm).then((response) => {
|
|
|
625
|
+ const res = response.data
|
|
|
626
|
+ if (res.code !== '200') {
|
|
|
627
|
+ return this.$message.error('更新车载运单,失败!')
|
|
|
628
|
+ }
|
|
|
629
|
+ this.$message.success('更新车载运单,成功!')
|
|
|
630
|
+ this.dialogVisible = false;
|
|
|
631
|
+ this.getLists();
|
|
|
632
|
+ }).catch(error => {
|
|
|
633
|
+ // 关闭加载
|
|
|
634
|
+ this.$message.warning('更新车载运单,失败!')
|
|
|
635
|
+ })
|
|
|
636
|
+ },
|
|
|
637
|
+ //删除车载运单
|
|
|
638
|
+ delVehicleWaybill(id) {
|
|
|
639
|
+ // 弹框询问是否删除?
|
|
|
640
|
+ this.$confirm('此操作永久删除该消息收发记录, 是否继续?', '警告', {
|
|
|
641
|
+ confirmButtonText: '确定删除',
|
|
|
642
|
+ cancelButtonText: '取消',
|
|
|
643
|
+ type: 'warning'
|
|
|
644
|
+ }
|
|
|
645
|
+ ).then(() => {
|
|
|
646
|
+ delVehicleWaybill({id: id}).then((response) => {
|
|
|
647
|
+ const res = response.data
|
|
|
648
|
+ this.$message.success(res.msg)
|
|
|
649
|
+ this.getLists();
|
|
|
650
|
+ }).catch(error => {
|
|
|
651
|
+ this.$message.error('删除车载运单,失败!')
|
|
|
652
|
+ })
|
|
|
653
|
+ }).catch(() => {
|
|
|
654
|
+ })
|
|
|
655
|
+ },
|
|
|
656
|
+ //新增车载运单
|
|
|
657
|
+ addVehicleWaybill() {
|
|
|
658
|
+ addVehicleWaybill(this.submitForm).then((response) => {
|
|
|
659
|
+ const res = response.data
|
|
|
660
|
+ if (res.code !== '200') {
|
|
|
661
|
+ return this.$message.error('新增车载运单,失败!')
|
|
|
662
|
+ }
|
|
|
663
|
+ this.$message.success('新增车载运单,成功!')
|
|
|
664
|
+ this.dialogVisible = false;
|
|
|
665
|
+ this.getLists();
|
|
|
666
|
+ }).catch(error => {
|
|
|
667
|
+ // 关闭加载
|
|
|
668
|
+ this.$message.warning('新增车载运单,失败!')
|
|
|
669
|
+ })
|
|
|
670
|
+ },
|
|
|
671
|
+ //查询列表
|
|
|
672
|
+ getLists() {
|
|
|
673
|
+ if (this.value2 !== null) {
|
|
|
674
|
+ this.formInline.starttime = this.value2[0];
|
|
|
675
|
+ this.formInline.endtime = this.value2[1];
|
|
|
676
|
+ }
|
|
|
677
|
+ selectNewInventroyrecords(this.formInline).then((response) => {
|
|
|
678
|
+ const res = response.data
|
|
|
679
|
+ if (res.code !== '200') {
|
|
|
680
|
+ return this.$message.error('获取消息收发记录,失败!')
|
|
|
681
|
+ }
|
|
|
682
|
+ // 获取列表数据
|
|
|
683
|
+ this.tableData = res.data.list
|
|
|
684
|
+ // 获取列表的总记录数
|
|
|
685
|
+ this.total = res.data.total
|
|
|
686
|
+ this.$message.success('获取消息收发记录,成功!');
|
|
|
687
|
+ this.formInline.endtime = '';
|
|
|
688
|
+ this.formInline.starttime = '';
|
|
|
689
|
+ }).catch(error => {
|
|
|
690
|
+ // 关闭加载
|
|
|
691
|
+ this.$message.error(error.toString())
|
|
|
692
|
+ })
|
|
|
693
|
+ },
|
|
|
694
|
+ onPaidan() {
|
|
|
695
|
+ if (this.multipleSelection.length !== 0) {
|
|
|
696
|
+ this.PDdialogVisible = true;
|
|
|
697
|
+ this.PDForm.dispatch = this.getCurrentFormattedDate();
|
|
|
698
|
+ } else {
|
|
|
699
|
+ this.$message.error('请选勾取要派车的运单信息!');
|
|
|
700
|
+ }
|
|
|
701
|
+ },
|
|
|
702
|
+ //新增
|
|
|
703
|
+ addVehicle() {
|
|
|
704
|
+ this.dialogVisible = true;
|
|
|
705
|
+ this.dialogStatus = 'create';
|
|
|
706
|
+ this.getUsers();
|
|
|
707
|
+ },
|
|
|
708
|
+ //编辑
|
|
|
709
|
+ ediVehicle(row) {
|
|
|
710
|
+ this.dialogVisible = true;
|
|
|
711
|
+ this.dialogStatus = 'update';
|
|
|
712
|
+ this.submitForm = row;
|
|
|
713
|
+ },
|
|
|
714
|
+ //翻页
|
|
|
715
|
+ handleSizeChange(val) {
|
|
|
716
|
+ this.formInline.pageSize = val;
|
|
|
717
|
+ this.getLists();
|
|
|
718
|
+ },
|
|
|
719
|
+ handleCurrentChange(val) {
|
|
|
720
|
+ this.formInline.pageNum = val;
|
|
|
721
|
+ this.getLists();
|
|
|
722
|
+ },
|
|
|
723
|
+ //多选选中
|
|
|
724
|
+ handleSelectionChange(val) {
|
|
|
725
|
+ this.multipleSelection = val;
|
|
|
726
|
+ console.log(this.multipleSelection)
|
|
|
727
|
+ },
|
|
|
728
|
+ //Dialog关闭提示
|
|
|
729
|
+ handleClose(done) {
|
|
|
730
|
+ this.$confirm('确认关闭?')
|
|
|
731
|
+ .then(_ => {
|
|
|
732
|
+ done();
|
|
|
733
|
+ })
|
|
|
734
|
+ .catch(_ => {
|
|
|
735
|
+ });
|
|
|
736
|
+ },
|
|
|
737
|
+ //获取用户名列表
|
|
|
738
|
+ getUsers() {
|
|
|
739
|
+ let data = {orgtype: "",roleName:"",departmentid:""};
|
|
|
740
|
+ let para={pageSize: 1000, pageNum: 1}
|
|
|
741
|
+ this.listLoading = true;
|
|
|
742
|
+ getUserList(data,para).then((res) => {
|
|
|
743
|
+ this.usernames = res.data.data.list;
|
|
|
744
|
+ }).catch((error) => {
|
|
|
745
|
+ this.$message.error(error.toString());
|
|
|
746
|
+ }).finally(() => {
|
|
|
747
|
+ this.listLoading = false;
|
|
|
748
|
+ });
|
|
|
749
|
+ },
|
|
|
750
|
+ },
|
|
|
751
|
+ mounted() {
|
|
|
752
|
+ this.getLists();
|
|
|
753
|
+ }
|
|
|
754
|
+ }
|
|
|
755
|
+</script> |