index.vue
6.39 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
<template>
<div>
<el-form ref="flightAllocForm" :model="queryParams" class="form-header" size="medium" label-position="right"
label-width="auto" @submit.native.prevent>
<el-row>
<el-col :span="6">
<el-form-item label="航班号">
<el-input class="formItem" v-model.trim="purposeOfFlightNo" placeholder="航班号" @keyup.enter.native="getList">
</el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="航班日期">
<el-date-picker class="formItem" v-model="queryParams.flightDate" type="date" placeholder="选择日期"
value-format="yyyy-MM-dd" clearable :disabled="queryParams.querySpecifyData =='2'">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="3">
<el-form-item label="状态">
<el-select class="formItem" v-model="queryParams.status" placeholder="状态">
<el-option label="有效" value="1"></el-option>
<el-option label="停用" value="3"></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<div>
<el-form-item label="日期查询">
<el-switch v-model="queryParams.querySpecifyData" active-value="1" inactive-value="2" active-color="#13ce66"
inactive-color="#909399" @change="switchChange">
</el-switch>
</el-form-item>
<el-button type="primary" icon="el-icon-search" :loading="loading" @click="getList" size="mini">查询</el-button>
<el-button class="mb20" type="primary" icon="el-icon-plus" size="mini" v-hasPermi="['allocation:alloc:add']"
@click="
$router.push({
name: 'FlightAllocConfigInfo',
params: { handle: 'add', fltNo: 'new', fltDate: ' ',status:null },
})
">添加</el-button>
</div>
</el-form>
<Tables ref="newTables" ductName="FlightAlloc" :data="flyList" :headerData="tableHeaders['flightAlloc']"
:order="true" :totalCount="total" :loading="loading" :limitSize="queryParams.limit"
:limitStart="queryParams.start" :page="curPage" :pageSizes="[20]" :height="tableHeight"
@currentChange="currentChange">
<template v-slot:ruleDate="scope">
<el-link v-if="scope.row.ruleDate" type="primary" @click="toRouteOrder(scope.row)">
{{
scope.row.ruleDate
}}<i class="el-icon-link"></i> </el-link>
</template>
<template slot="optionColumn">
<el-table-column label="操作" align="center" width="150">
<template slot-scope="scope">
<el-button type="text" size="mini" icon="el-icon-view"
@click="handleClick(scope.row.purposeOfFlightNo, 'detail', scope.row.ruleDate, scope.row.status)">查看
</el-button>
<el-button type="text" size="mini" icon="el-icon-edit" v-hasPermi="['allocation:alloc:update']"
@click="handleClick(scope.row.purposeOfFlightNo, 'update', scope.row.ruleDate, scope.row.status)">修改
</el-button>
<!-- <el-button type="text" size="mini" icon="el-icon-delete" style="color:#ff4949"
v-hasPermi="['allocation:alloc:delete']" @click="del(scope.row.id, scope.row.status)">删除</el-button>
<el-button type="text" size="mini" icon="el-icon-video-pause" v-hasPermi="['allocation:alloc:openClose']"
@click="changeStatus(scope.row.id, 3)" v-if="scope.row.status == '1'">停用</el-button>
<el-button type="text" size="mini" icon="el-icon-video-play" v-hasPermi="['allocation:alloc:openClose']"
@click="changeStatus(scope.row.id, 1)" v-else>启用</el-button> -->
</template>
</el-table-column>
</template>
</Tables>
<Dialog :fltData="colData" :open="open" @close="close"></Dialog>
</div>
</template>
<script>
import {
findFlightDimRuleByFlightNo
} from "@/api/destinationFlight";
import Dialog from './dialog.vue'
export default {
name: "FlightAllocConfig",
components: {
Dialog
},
data() {
return {
queryParams: {
purposeOfFlightNo: null,
flightDate: undefined,
querySpecifyData: '2',
status: "1",
start: 0,
limit: 20,
},
flyList: [],
colData: {},
curPage: 1,
total: 0,
tableHeight: null,
open: false,
loading: false,
};
},
created() {
if (this.$store.state.tagsView.cachedViews.length == 0) {
this.getList();
}
},
mounted() {
this.tableHeight = window.innerHeight - this.$refs.flightAllocForm.$el.offsetHeight - 200
},
activated() {
this.getList()
},
deactivated() {
this.flyList = []
},
methods: {
getList() {
if (this.curPage > 1) {
this.queryParams.start = (this.curPage - 1) * this.queryParams.limit;
} else {
this.queryParams.start = 0;
}
this.loading = true;
findFlightDimRuleByFlightNo(this.queryParams).then(res => {
this.loading = false
if (res.code === 200) {
this.flyList = res.data.list
this.total = res.data.totalCount
} else {
this.msgWarning(res.msg)
}
}).catch(err => {
this.loading = false
console.log(err)
})
},
//跳转到查看,修改页面
handleClick(fltNo, handle, fltDate, status) {
let obj = {
handle: handle,
fltNo: fltNo,
fltDate: fltDate != null ? fltDate : '',
route: null,
routeStatus: 'FlightAllocConfig',
status: status
}
this.$router.push({
name: "FlightAllocConfigInfo",
params: obj,
});
},
//航班优先级修改
toRouteOrder(val) {
this.colData = {
fltNo: val.purposeOfFlightNo,
fltDate: val.ruleDate
}
this.open = true
},
//开关改变
switchChange(val) {
if (val == '2') {
this.queryParams.flightDate = undefined
}
},
close() {
this.open = false
},
//翻页
currentChange(val) {
this.curPage = val.page
this.queryParams.start = val.start;
this.getList();
}
},
computed: {
purposeOfFlightNo: {
get: function () {
return this.queryParams.purposeOfFlightNo;
},
set: function (val) {
this.queryParams.purposeOfFlightNo = this.upCase(val);
},
},
},
};
</script>