|
@@ -10,27 +10,44 @@ |
|
@@ -10,27 +10,44 @@ |
10
|
</el-form-item>
|
10
|
</el-form-item>
|
11
|
<el-form-item>
|
11
|
<el-form-item>
|
12
|
<div class="block">
|
12
|
<div class="block">
|
13
|
- <span class="demonstration">时间</span>
|
13
|
+ <span class="demonstration">日期</span>
|
14
|
<el-date-picker
|
14
|
<el-date-picker
|
15
|
v-model="value2"
|
15
|
v-model="value2"
|
16
|
- type="datetimerange"
|
|
|
17
|
- :picker-options="pickerOptions"
|
16
|
+ type="daterange"
|
|
|
17
|
+ align="right"
|
|
|
18
|
+ unlink-panels
|
18
|
range-separator="至"
|
19
|
range-separator="至"
|
19
|
start-placeholder="开始日期"
|
20
|
start-placeholder="开始日期"
|
20
|
end-placeholder="结束日期"
|
21
|
end-placeholder="结束日期"
|
21
|
- align="right">
|
22
|
+ value-format="yyyy-MM-dd HH:mm:ss"
|
|
|
23
|
+ :picker-options="pickerOptions">
|
22
|
</el-date-picker>
|
24
|
</el-date-picker>
|
23
|
</div>
|
25
|
</div>
|
24
|
</el-form-item>
|
26
|
</el-form-item>
|
25
|
<el-form-item>
|
27
|
<el-form-item>
|
26
|
- <el-button type="primary" @click="onSubmit">查询</el-button>
|
28
|
+ <el-button type="primary" @click="getLists">查询</el-button>
|
27
|
</el-form-item>
|
29
|
</el-form-item>
|
28
|
<el-form-item>
|
30
|
<el-form-item>
|
29
|
- <el-button type="success" @click="dialogVisible = true">新增</el-button>
|
31
|
+ <el-button type="success" @click="addVehicle">新增</el-button>
|
30
|
</el-form-item>
|
32
|
</el-form-item>
|
31
|
<el-form-item>
|
33
|
<el-form-item>
|
32
|
<el-button type="danger" @click="onPaidan">派单</el-button>
|
34
|
<el-button type="danger" @click="onPaidan">派单</el-button>
|
33
|
</el-form-item>
|
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>
|
34
|
</el-form>
|
51
|
</el-form>
|
35
|
</div>
|
52
|
</div>
|
36
|
<div>
|
53
|
<div>
|
|
@@ -45,14 +62,14 @@ |
|
@@ -45,14 +62,14 @@ |
45
|
width="55">
|
62
|
width="55">
|
46
|
</el-table-column>
|
63
|
</el-table-column>
|
47
|
<el-table-column
|
64
|
<el-table-column
|
48
|
- prop="name"
|
65
|
+ prop="customer"
|
49
|
label="客户名称"
|
66
|
label="客户名称"
|
50
|
width="120">
|
67
|
width="120">
|
51
|
</el-table-column>
|
68
|
</el-table-column>
|
52
|
<el-table-column
|
69
|
<el-table-column
|
|
|
70
|
+ prop="taketime"
|
53
|
label="日期"
|
71
|
label="日期"
|
54
|
width="120">
|
72
|
width="120">
|
55
|
- <template slot-scope="scope">{{ scope.row.taketime }}</template>
|
|
|
56
|
</el-table-column>
|
73
|
</el-table-column>
|
57
|
<el-table-column
|
74
|
<el-table-column
|
58
|
prop="orig"
|
75
|
prop="orig"
|
|
@@ -67,22 +84,33 @@ |
|
@@ -67,22 +84,33 @@ |
67
|
<el-table-column
|
84
|
<el-table-column
|
68
|
prop="licenseno"
|
85
|
prop="licenseno"
|
69
|
label="车号"
|
86
|
label="车号"
|
70
|
- show-overflow-tooltip>
|
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>
|
71
|
</el-table-column>
|
92
|
</el-table-column>
|
72
|
<el-table-column
|
93
|
<el-table-column
|
73
|
prop="dispatch"
|
94
|
prop="dispatch"
|
74
|
label="派单号"
|
95
|
label="派单号"
|
75
|
- show-overflow-tooltip>
|
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>
|
76
|
</el-table-column>
|
104
|
</el-table-column>
|
77
|
<el-table-column
|
105
|
<el-table-column
|
78
|
prop="awbh"
|
106
|
prop="awbh"
|
79
|
label="分单号"
|
107
|
label="分单号"
|
80
|
- show-overflow-tooltip>
|
108
|
+ width="140">
|
81
|
</el-table-column>
|
109
|
</el-table-column>
|
82
|
<el-table-column
|
110
|
<el-table-column
|
83
|
prop="awba"
|
111
|
prop="awba"
|
84
|
label="主单号"
|
112
|
label="主单号"
|
85
|
- show-overflow-tooltip>
|
113
|
+ width="110">
|
86
|
</el-table-column>
|
114
|
</el-table-column>
|
87
|
<el-table-column
|
115
|
<el-table-column
|
88
|
prop="deststation"
|
116
|
prop="deststation"
|
|
@@ -109,6 +137,15 @@ |
|
@@ -109,6 +137,15 @@ |
109
|
label="应收"
|
137
|
label="应收"
|
110
|
show-overflow-tooltip>
|
138
|
show-overflow-tooltip>
|
111
|
</el-table-column>
|
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>
|
112
|
</el-table>
|
149
|
</el-table>
|
113
|
</div>
|
150
|
</div>
|
114
|
<div>
|
151
|
<div>
|
|
@@ -118,54 +155,249 @@ |
|
@@ -118,54 +155,249 @@ |
118
|
<el-pagination
|
155
|
<el-pagination
|
119
|
@size-change="handleSizeChange"
|
156
|
@size-change="handleSizeChange"
|
120
|
@current-change="handleCurrentChange"
|
157
|
@current-change="handleCurrentChange"
|
121
|
- :current-page="currentPage4"
|
158
|
+ :current-page="formInline.pageNum"
|
122
|
:page-sizes="[20, 30, 40, 100]"
|
159
|
:page-sizes="[20, 30, 40, 100]"
|
123
|
- :page-size="20"
|
160
|
+ :page-size="formInline.pageSize"
|
124
|
layout="total, sizes, prev, pager, next, jumper"
|
161
|
layout="total, sizes, prev, pager, next, jumper"
|
125
|
- :total="400">
|
162
|
+ :total="total">
|
126
|
</el-pagination>
|
163
|
</el-pagination>
|
127
|
</el-col>
|
164
|
</el-col>
|
128
|
- <el-col :span="2">
|
|
|
129
|
- <el-button type="primary" @click="onPaidan">导入运单</el-button>
|
|
|
130
|
- </el-col>
|
|
|
131
|
- <el-col :span="2">
|
|
|
132
|
- <el-button type="success" @click="onPaidan">导出</el-button>
|
|
|
133
|
- </el-col>
|
|
|
134
|
</el-row>
|
165
|
</el-row>
|
135
|
</div>
|
166
|
</div>
|
136
|
</div>
|
167
|
</div>
|
137
|
<div>
|
168
|
<div>
|
138
|
<el-dialog
|
169
|
<el-dialog
|
139
|
- title="提示"
|
170
|
+ :title="'车载运单'+textMap[dialogStatus]"
|
140
|
:visible.sync="dialogVisible"
|
171
|
:visible.sync="dialogVisible"
|
141
|
- width="30%"
|
172
|
+ width="75%"
|
142
|
:before-close="handleClose">
|
173
|
:before-close="handleClose">
|
143
|
- <el-form :inline="true" :model="submitForm" class="demo-form-inline">
|
|
|
144
|
- <el-form-item label="主单号">
|
|
|
145
|
- <el-input v-model="formInline.awba" placeholder="主单号"></el-input>
|
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>
|
146
|
</el-form-item>
|
207
|
</el-form-item>
|
147
|
<el-form-item label="车号">
|
208
|
<el-form-item label="车号">
|
148
|
- <el-input v-model="formInline.licenseno" placeholder="车号"></el-input>
|
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>
|
149
|
</el-form-item>
|
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
|
+
|
150
|
</el-form>
|
252
|
</el-form>
|
151
|
- <span slot="footer" class="dialog-footer">
|
253
|
+ <span slot="footer" class="dialog-footer" style="margin-right: 50px">
|
152
|
<el-button @click="dialogVisible = false">取 消</el-button>
|
254
|
<el-button @click="dialogVisible = false">取 消</el-button>
|
153
|
- <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
|
255
|
+ <el-button type="primary" @click="dialogStatus==='create'?addVehicleWaybill():ediVehicleWaybill()">确 定</el-button>
|
154
|
</span>
|
256
|
</span>
|
155
|
</el-dialog>
|
257
|
</el-dialog>
|
156
|
</div>
|
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>
|
157
|
</div>
|
341
|
</div>
|
158
|
</template>
|
342
|
</template>
|
159
|
<script>
|
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
|
+
|
160
|
export default {
|
357
|
export default {
|
161
|
data() {
|
358
|
data() {
|
162
|
return {
|
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',
|
163
|
tableData: [],
|
386
|
tableData: [],
|
164
|
multipleSelection: [],
|
387
|
multipleSelection: [],
|
165
|
formInline: {
|
388
|
formInline: {
|
166
|
awba: '',
|
389
|
awba: '',
|
167
|
licenseno: '',
|
390
|
licenseno: '',
|
|
|
391
|
+ starttime: '',
|
|
|
392
|
+ endtime: '',
|
|
|
393
|
+ pageNum: 1,
|
|
|
394
|
+ pageSize: 20
|
168
|
},
|
395
|
},
|
|
|
396
|
+ dialogStatus: '',
|
|
|
397
|
+ loading: false,
|
|
|
398
|
+ listLoading: false,
|
|
|
399
|
+ value2: '',
|
|
|
400
|
+ total: 0,
|
169
|
pickerOptions: {
|
401
|
pickerOptions: {
|
170
|
shortcuts: [{
|
402
|
shortcuts: [{
|
171
|
text: '最近一周',
|
403
|
text: '最近一周',
|
|
@@ -193,7 +425,6 @@ |
|
@@ -193,7 +425,6 @@ |
193
|
}
|
425
|
}
|
194
|
}]
|
426
|
}]
|
195
|
},
|
427
|
},
|
196
|
- value2: '',
|
|
|
197
|
currentPage4: 4,
|
428
|
currentPage4: 4,
|
198
|
submitForm: {
|
429
|
submitForm: {
|
199
|
awba: "",
|
430
|
awba: "",
|
|
@@ -219,17 +450,275 @@ |
|
@@ -219,17 +450,275 @@ |
219
|
vol: 0,
|
450
|
vol: 0,
|
220
|
weight: 0
|
451
|
weight: 0
|
221
|
},
|
452
|
},
|
222
|
- dialogVisible: false
|
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
|
+ },
|
223
|
}
|
481
|
}
|
224
|
},
|
482
|
},
|
225
|
|
483
|
|
226
|
methods: {
|
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
|
+ },
|
227
|
//翻页
|
714
|
//翻页
|
228
|
handleSizeChange(val) {
|
715
|
handleSizeChange(val) {
|
229
|
- console.log(`每页 ${val} 条`);
|
716
|
+ this.formInline.pageSize = val;
|
|
|
717
|
+ this.getLists();
|
230
|
},
|
718
|
},
|
231
|
handleCurrentChange(val) {
|
719
|
handleCurrentChange(val) {
|
232
|
- console.log(`当前页: ${val}`);
|
720
|
+ this.formInline.pageNum = val;
|
|
|
721
|
+ this.getLists();
|
233
|
},
|
722
|
},
|
234
|
//多选选中
|
723
|
//多选选中
|
235
|
handleSelectionChange(val) {
|
724
|
handleSelectionChange(val) {
|
|
@@ -242,8 +731,24 @@ |
|
@@ -242,8 +731,24 @@ |
242
|
.then(_ => {
|
731
|
.then(_ => {
|
243
|
done();
|
732
|
done();
|
244
|
})
|
733
|
})
|
245
|
- .catch(_ => {});
|
|
|
246
|
- }
|
734
|
+ .catch(_ => {
|
|
|
735
|
+ });
|
|
|
736
|
+ },
|
|
|
737
|
+ //获取用户名列表
|
|
|
738
|
+ getUsers() {
|
|
|
739
|
+ let para = {orgtype: "C", pageSize: 1, pageNum: 10000};
|
|
|
740
|
+ this.listLoading = true;
|
|
|
741
|
+ getUserList(para).then((res) => {
|
|
|
742
|
+ this.usernames = res.data.data.list;
|
|
|
743
|
+ }).catch((error) => {
|
|
|
744
|
+ this.$message.error(error.toString());
|
|
|
745
|
+ }).finally(() => {
|
|
|
746
|
+ this.listLoading = false;
|
|
|
747
|
+ });
|
|
|
748
|
+ },
|
|
|
749
|
+ },
|
|
|
750
|
+ mounted() {
|
|
|
751
|
+ this.getLists();
|
247
|
}
|
752
|
}
|
248
|
}
|
753
|
}
|
249
|
</script> |
754
|
</script> |