keyWorkLocation.vue
14.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
<template>
<div class="app-container">
<div class="query-from">
<el-form :inline="true" :model="queryParamsOfLinggangKeyWorkLocation" class="demo-form-inline">
<el-form-item label="车辆信息" props="请输入车辆信息">
<el-input style="width: 160px;" v-model="queryParamsOfLinggangKeyWorkLocation.nbbm" placeholder="车辆信息" clearable @keyup.enter="handleQueryOfLinggangKeyWorkLocation" />
</el-form-item>
<el-form-item label="操作时间" props="请选择时间">
<el-date-picker style="width: 140px;" v-model="queryParamsOfLinggangKeyWorkLocation.time" type="date" align="right" unlink-panels
format="YYYY/MM/DD" value-format="YYYY-MM-DD" @keyup.enter="handleQueryOfLinggangKeyWorkLocation">
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="Search" @click="handleQueryOfLinggangKeyWorkLocation">搜索</el-button>
<el-button icon="Refresh" @click="resetQueryOfLinggangKeyWorkLocation">重置</el-button>
</el-form-item>
</el-form>
</div>
<el-table v-loading="loadingOfLinggangKeyWorkLocation" :data="listOfLinggangKeyWorkLocation" @selection-change="handleSelectionChangeOfLinggangKeyWorkLocation" border max-height="600"
:default-expand-all="false" :row-class-name="tableRowClassName" @sort-change="sortChangeOfLinggangKeyWorkLocation">
<el-table-column type="selection" width="50" align="center" />
<el-table-column label="序号" type="index" width="60" align="center">
<template #default="scope">
{{ (queryParamsOfLinggangKeyWorkLocation.pageNum - 1) * queryParamsOfLinggangKeyWorkLocation.pageSize + scope.$index + 1 }}
</template>
</el-table-column>
<el-table-column label="场站名称" align="center" prop="yardName" sortable />
<el-table-column label="设备号" align="center" prop="device" sortable />
<el-table-column label="车辆信息" align="center" prop="nbbm" />
<el-table-column label="操作人员" align="center" prop="jobCode" />
<el-table-column label="操作时间" align="center" prop="time" sortable />
<el-table-column label="操作类型" align="center" prop="eventType" sortable >
<template #default="scope">
<view v-if="scope.row.eventType==16">管理员操作</view>
<view v-else-if="scope.row.eventType==17">紧急操作</view>
<view v-else>司机操作</view>
</template>
</el-table-column>
<el-table-column label="存取状态" align="center" prop="type1" sortable >
<template #default="scope">
<view v-if="scope.row.type1==0">归还</view>
<view v-else-if="scope.row.type1==1">借出</view>
<view v-else-if="scope.row.type1==2">初始状态</view>
</template>
</el-table-column>
</el-table>
<pagination v-show="totalOfLinggangKeyWorkLocation > 0" :total="totalOfLinggangKeyWorkLocation" v-model:page="queryParamsOfLinggangKeyWorkLocation.pageNum" v-model:limit="queryParamsOfLinggangKeyWorkLocation.pageSize"
@pagination="getListOfLinggangKeyWorkLocation" @current-change=""/>
</div>
</template>
<script setup name="LinggangKeyWorkLocation">
import { getDicts,getDictsDelFlag } from '@/api/system/dict/data';
import { listLimitOfLinggangKeyWorkLocation, viewOfLinggangKeyWorkLocation, addOfLinggangKeyWorkLocation, updateOfLinggangKeyWorkLocation,updateStatusOfLinggangKeyWorkLocation,deleteOfLinggangKeyWorkLocation } from "@/api/scheduling/keyWorkLocation/keyWorkLocation";
const { proxy } = getCurrentInstance();
const listOfLinggangKeyWorkLocation = ref([]);
const openOfLinggangKeyWorkLocation = ref(false);
const titleOfLinggangKeyWorkLocation = ref("");
const loadingOfLinggangKeyWorkLocation = ref(true);
const showSearchOfLinggangKeyWorkLocation = ref(true);
const idsOfLinggangKeyWorkLocation = ref([]);
const singleLinggangKeyWorkLocation = ref(true);
const multipleLinggangKeyWorkLocation = ref(true);
const pageOfLinggangKeyWorkLocation = ref(1) //第几页
const sizeOfLinggangKeyWorkLocation = ref(10) //一页多少条
const totalOfLinggangKeyWorkLocation = ref(0);
const pageSizesOfLinggangKeyWorkLocation = [5, 10, 20, 50]; //每页显示多少条
const currentPageOfLinggangKeyWorkLocation = ref(1) // 当前页
const globalRowOfLinggangKeyWorkLocation = ref(null) // 当前行数据
const changeFlagOfLinggangKeyWorkLocation = ref(true)
const deleteFlagsOfLinggangKeyWorkLocation = ref([])
const YardIds=ref([]);
const KeyInfoIds=ref([]);
const SchedulingIds=ref([]);
const dataOfLinggangKeyWorkLocation = reactive({
formOfLinggangKeyWorkLocation: {},
queryParamsOfLinggangKeyWorkLocation: {
pageNum: 1,
pageSize: 10,
id : null,
yardId : null,
yardName : null,
device : null,
cabinetNo : null,
createBy : null,
createTime : null,
updateBy : null,
updateTime : null,
delFlag : null,
eventType : null,
keyInfoId : null,
scheduleDate : null,
schedulingId : null,
type : null,
type1 : null,
time : null,
nbbm :null,
},
checkRulesOfLinggangKeyWorkLocation: {
id : [
{ required: true, message: "ID", trigger: "blur" }
],
yardId : [
{ required: true, message: "场站ID", trigger: "blur" }
],
yardName : [
{ required: true, message: "场站名称", trigger: "blur" }
],
device : [
{ required: true, message: "设备号", trigger: "blur" }
],
cabinetNo : [
{ required: true, message: "钥匙位编号", trigger: "blur" }
],
createBy : [
{ required: true, message: "创建人员", trigger: "blur" }
],
createTime : [
{ required: true, message: "创建时间", trigger: "blur" }
],
updateBy : [
{ required: true, message: "修改人员", trigger: "blur" }
],
updateTime : [
{ required: true, message: "修改时间", trigger: "blur" }
],
delFlag : [
{ required: true, message: "是否删除;0为未删除,1已删除", trigger: "blur" }
],
eventType : [
{ required: true, message: "操作类型;-0司机操作,16管理员操作,17紧急操作", trigger: "blur" }
],
keyInfoId : [
{ required: true, message: "钥匙ID", trigger: "blur" }
],
scheduleDate : [
{ required: true, message: "排班时间", trigger: "blur" }
],
schedulingId : [
{ required: true, message: "排班ID", trigger: "blur" }
],
type : [
{ required: true, message: "状态:0存入,1取出 ,16:钥匙未归还,255异常", trigger: "blur" }
],
type1 : [
{ required: true, message: "状态:1 是归还;0是借出;2是初始状态", trigger: "blur" }
],
time : [
{ required: true, message: "", trigger: "blur" }
],
}
});
const { queryParamsOfLinggangKeyWorkLocation, formOfLinggangKeyWorkLocation, checkRulesOfLinggangKeyWorkLocation } = toRefs(dataOfLinggangKeyWorkLocation );
/** 查询设备信息列表 */
function getListOfLinggangKeyWorkLocation() {
loadingOfLinggangKeyWorkLocation.value = true;
console.log(queryParamsOfLinggangKeyWorkLocation.value.pageNum);
listLimitOfLinggangKeyWorkLocation(queryParamsOfLinggangKeyWorkLocation.value,queryParamsOfLinggangKeyWorkLocation.value.pageNum,queryParamsOfLinggangKeyWorkLocation.value.pageSize).then(response => {
listOfLinggangKeyWorkLocation.value = response.records;
totalOfLinggangKeyWorkLocation.value = response.total;
loadingOfLinggangKeyWorkLocation.value = false;
// deleteFlagsOfLinggangKeyWorkLocationFunction(function (){
// })
});
}
function currentChangeFun(val){
console.log("currentChangeFun--------------------->");
}
function deleteFlagsOfLinggangKeyWorkLocationFunction(fun){
getDictsDelFlag().then(response=>{
deleteFlagsOfLinggangKeyWorkLocation.value = response.data;
if(fun){
fun(response);
}
});
}
/**排序*/
function sortChangeOfLinggangKeyWorkLocation(data){
queryParamsOfLinggangKeyWorkLocation.value.order=data.order;
queryParamsOfLinggangKeyWorkLocation.value.prop=data.prop;
getListOfLinggangKeyWorkLocation();
}
// 取消按钮
function cancelOfLinggangKeyWorkLocation() {
openOfLinggangKeyWorkLocation.value = false;
globalRowOfLinggangKeyWorkLocation.value = null
resetOfLinggangKeyWorkLocation();
}
const handleSizeChange = (val) => {
sizeOfLinggangKeyWorkLocation.value = val;
}
const handleCurrentChange = (val) => {
pageOfLinggangKeyWorkLocation.value = val;
}
// 表单重置
function resetOfLinggangKeyWorkLocation() {
formOfLinggangKeyWorkLocation.value = {
id : null,
yardId : null,
yardName : null,
device : null,
cabinetNo : null,
createBy : null,
createTime : null,
updateBy : null,
updateTime : null,
delFlag : null,
eventType : null,
keyInfoId : null,
scheduleDate : null,
schedulingId : null,
type : null,
type1 : null,
time : null,
};
proxy.resetForm("rulesOfLinggangKeyWorkLocation");
}
/** 搜索按钮操作 */
function handleQueryOfLinggangKeyWorkLocation() {
queryParamsOfLinggangKeyWorkLocation.value.pageNum = 1;
getListOfLinggangKeyWorkLocation();
}
/** 重置按钮操作 */
function resetQueryOfLinggangKeyWorkLocation() {
dataOfLinggangKeyWorkLocation.queryParamsOfLinggangKeyWorkLocation.nbbm = null;
dataOfLinggangKeyWorkLocation.queryParamsOfLinggangKeyWorkLocation.time = null;
handleQueryOfLinggangKeyWorkLocation();
}
// 多选框选中数据
function handleSelectionChangeOfLinggangKeyWorkLocation(selection) {
idsOfLinggangKeyWorkLocation.value = selection.map(item => item.id);
singleLinggangKeyWorkLocation.value = selection.length != 1;
multipleLinggangKeyWorkLocation.value = !selection.length;
}
/** 新增按钮操作 */
function handleAddOfLinggangKeyWorkLocation() {
resetOfLinggangKeyWorkLocation();
changeFlagOfLinggangKeyWorkLocation.value = true;
openOfLinggangKeyWorkLocation.value = true;
titleOfLinggangKeyWorkLocation.value = "添加";
}
/** 修改按钮操作 */
function handleUpdateOfLinggangKeyWorkLocation(row) {
resetOfLinggangKeyWorkLocation();
const _id = row.id || idsOfLinggangKeyWorkLocation.value
viewOfLinggangKeyWorkLocation(_id).then(response => {
formOfLinggangKeyWorkLocation.value = response.data;
openOfLinggangKeyWorkLocation.value = true;
titleOfLinggangKeyWorkLocation.value = "修改";
});
}
/** 提交按钮 */
function submitFormOfLinggangKeyWorkLocation() {
proxy.$refs["rulesOfLinggangKeyWorkLocation"].validate(valid => {
if (valid) {
if (formOfLinggangKeyWorkLocation.value.id != null) {
updateOfLinggangKeyWorkLocation(formOfLinggangKeyWorkLocation.value).then(response => {
proxy.$modal.msgSuccess("修改成功");
openOfLinggangKeyWorkLocation.value = false;
getListOfLinggangKeyWorkLocation();
});
} else {
addOfLinggangKeyWorkLocation(formOfLinggangKeyWorkLocation.value).then(response => {
proxy.$modal.msgSuccess("新增成功");
openOfLinggangKeyWorkLocation.value = false;
getListOfLinggangKeyWorkLocation();
});
}
}
});
}
/** 删除按钮操作 */
function handleDeleteOfLinggangKeyWorkLocation(row) {
const _idsOfLinggangKeyWorkLocation = row.id || idsOfLinggangKeyWorkLocation.value;
proxy.$modal.confirm('是否确认删除 为"' + _idsOfLinggangKeyWorkLocation + '"的数据项?').then(function () {
return deleteOfLinggangKeyWorkLocation(_idsOfLinggangKeyWorkLocation);
}).then(() => {
getListOfLinggangKeyWorkLocation();
proxy.$modal.msgSuccess("删除成功");
}).catch(() => { });
}
/** 导出按钮操作 */
function handleExportOfLinggangKeyWorkLocation() {
proxy.download('Linggang/key/work/location/export', {
...queryParamsOfLinggangKeyWorkLocation.value
}, `LinggangKeyWorkLocation_${new Date().getTime()}.xlsx`)
}
// function init_YardId(){
// ().then(res=>{YardIds.value=res.data});
// }
// function init_KeyInfoId(){
// ().then(res=>{KeyInfoIds.value=res.data});
// }
// function init_SchedulingId(){
// ().then(res=>{SchedulingIds.value=res.data});
// }
getListOfLinggangKeyWorkLocation();
</script>