|
|
@@ -1,6 +1,6 @@
|
|
1
|
1
|
<template>
|
|
2
|
2
|
<div v-loading="loading">
|
|
3
|
|
- <el-table :data="selectarr" border stripe>
|
|
|
3
|
+ <!-- <el-table :data="selectarr" border stripe>
|
|
4
|
4
|
<el-table-column type="index" width="100" label="序号" align="center">
|
|
5
|
5
|
</el-table-column>
|
|
6
|
6
|
<el-table-column prop="F_WorkOrderCode" label="工单号" align="center" />
|
|
|
@@ -8,6 +8,13 @@
|
|
8
|
8
|
<el-table-column prop="F_DepartPlace" label="出发地" align="center" />
|
|
9
|
9
|
<el-table-column prop="F_Destination" label="目的地" align="center" />
|
|
10
|
10
|
<el-table-column prop="F_UseTime" label="用车时间" align="center" />
|
|
|
11
|
+ </el-table> -->
|
|
|
12
|
+ <el-table :data="selectarr" class="airlineDeviceTable" border row-key="F_ID">
|
|
|
13
|
+ <el-table-column type="index" width="100" label="序号" align="center">
|
|
|
14
|
+ </el-table-column>
|
|
|
15
|
+ <el-table-column align="center" v-for="(item, index) in col" :key="`col_${index}`" :prop="dropCol[index].prop"
|
|
|
16
|
+ :label="item.label">
|
|
|
17
|
+ </el-table-column>
|
|
11
|
18
|
</el-table>
|
|
12
|
19
|
<el-form ref="ruleForm" :model="ruleForm" :rules="rules" label-width="100px">
|
|
13
|
20
|
<el-col :span="24">
|
|
|
@@ -53,6 +60,7 @@
|
|
53
|
60
|
import {
|
|
54
|
61
|
GetPerson
|
|
55
|
62
|
} from '@/api/commonAPI'
|
|
|
63
|
+ import Sortable from 'sortablejs'
|
|
56
|
64
|
export default {
|
|
57
|
65
|
name: "Distribution",
|
|
58
|
66
|
props: {
|
|
|
@@ -71,6 +79,48 @@
|
|
71
|
79
|
},
|
|
72
|
80
|
data() {
|
|
73
|
81
|
return {
|
|
|
82
|
+ col: [{
|
|
|
83
|
+ label: '工单号',
|
|
|
84
|
+ prop: 'F_WorkOrderCode'
|
|
|
85
|
+ },
|
|
|
86
|
+ {
|
|
|
87
|
+ label: '工单内容',
|
|
|
88
|
+ prop: 'F_Content'
|
|
|
89
|
+ },
|
|
|
90
|
+ {
|
|
|
91
|
+ label: '出发地',
|
|
|
92
|
+ prop: 'F_DepartPlace'
|
|
|
93
|
+ },
|
|
|
94
|
+ {
|
|
|
95
|
+ label: '目的地',
|
|
|
96
|
+ prop: 'F_Destination'
|
|
|
97
|
+ },
|
|
|
98
|
+ {
|
|
|
99
|
+ label: '用车时间',
|
|
|
100
|
+ prop: 'F_UseTime'
|
|
|
101
|
+ }
|
|
|
102
|
+ ],
|
|
|
103
|
+ dropCol: [{
|
|
|
104
|
+ label: '工单号',
|
|
|
105
|
+ prop: 'F_WorkOrderCode'
|
|
|
106
|
+ },
|
|
|
107
|
+ {
|
|
|
108
|
+ label: '工单内容',
|
|
|
109
|
+ prop: 'F_Content'
|
|
|
110
|
+ },
|
|
|
111
|
+ {
|
|
|
112
|
+ label: '出发地',
|
|
|
113
|
+ prop: 'F_DepartPlace'
|
|
|
114
|
+ },
|
|
|
115
|
+ {
|
|
|
116
|
+ label: '目的地',
|
|
|
117
|
+ prop: 'F_Destination'
|
|
|
118
|
+ },
|
|
|
119
|
+ {
|
|
|
120
|
+ label: '用车时间',
|
|
|
121
|
+ prop: 'F_UseTime'
|
|
|
122
|
+ }
|
|
|
123
|
+ ],
|
|
74
|
124
|
typeList: [],
|
|
75
|
125
|
carArr: [],
|
|
76
|
126
|
repairman: [], // 申请人数据
|
|
|
@@ -99,7 +149,42 @@
|
|
99
|
149
|
this.getVehicleLists() //车辆arr
|
|
100
|
150
|
this.getVehicleUserLists() //司机arr
|
|
101
|
151
|
},
|
|
|
152
|
+ mounted() {
|
|
|
153
|
+ this.$nextTick(() => {
|
|
|
154
|
+ this.rowDrop()
|
|
|
155
|
+ // this.columnDrop()
|
|
|
156
|
+ })
|
|
|
157
|
+ },
|
|
102
|
158
|
methods: {
|
|
|
159
|
+ //行拖拽
|
|
|
160
|
+ rowDrop() {
|
|
|
161
|
+ const tbody = document.querySelector('.airlineDeviceTable .el-table__body-wrapper tbody');
|
|
|
162
|
+ const that = this;
|
|
|
163
|
+ Sortable.create(tbody, {
|
|
|
164
|
+ draggable: ".el-table__row",
|
|
|
165
|
+ // 结束拖拽后的回调函数
|
|
|
166
|
+ onEnd({
|
|
|
167
|
+ newIndex,
|
|
|
168
|
+ oldIndex
|
|
|
169
|
+ }) {
|
|
|
170
|
+ const currentRow = that.selectarr.splice(oldIndex, 1)[0];
|
|
|
171
|
+ that.selectarr.splice(newIndex, 0, currentRow);
|
|
|
172
|
+ },
|
|
|
173
|
+ })
|
|
|
174
|
+ },
|
|
|
175
|
+ //列拖拽
|
|
|
176
|
+ columnDrop() {
|
|
|
177
|
+ const wrapperTr = document.querySelector('.airlineDeviceTable .el-table__header-wrapper tr')
|
|
|
178
|
+ this.sortable = Sortable.create(wrapperTr, {
|
|
|
179
|
+ animation: 180,
|
|
|
180
|
+ delay: 0,
|
|
|
181
|
+ onEnd: evt => {
|
|
|
182
|
+ const oldItem = this.dropCol[evt.oldIndex]
|
|
|
183
|
+ this.dropCol.splice(evt.oldIndex, 1)
|
|
|
184
|
+ this.dropCol.splice(evt.newIndex, 0, oldItem)
|
|
|
185
|
+ }
|
|
|
186
|
+ })
|
|
|
187
|
+ },
|
|
103
|
188
|
getVehicleLists() {
|
|
104
|
189
|
const params = {
|
|
105
|
190
|
state: 0
|
|
|
@@ -117,8 +202,9 @@
|
|
117
|
202
|
})
|
|
118
|
203
|
},
|
|
119
|
204
|
onsub() {
|
|
|
205
|
+ const arr= this.selectarr.map(item => item.F_WorkOrderCode)
|
|
120
|
206
|
const params = {
|
|
121
|
|
- orderid: this.selectids.toString(),
|
|
|
207
|
+ orderid: arr.toString(),
|
|
122
|
208
|
driver: this.ruleForm.driver,
|
|
123
|
209
|
carid: this.ruleForm.carid
|
|
124
|
210
|
}
|