1730532197@qq.com

lwj

...@@ -50,9 +50,12 @@ ...@@ -50,9 +50,12 @@
50 <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="280" fixed="right"> 50 <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="280" fixed="right">
51 <template slot-scope="scope"> 51 <template slot-scope="scope">
52 <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)">修改</el-button> 52 <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)">修改</el-button>
53 - <el-button size="mini" type="text" icon="el-icon-delete"@click="handleDeleteorPlayorpause(scope.row.id,0,'删除')">删除</el-button> 53 + <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDeleteorPlayorpause(scope.row,0,'删除')">
54 - <el-button size="mini" type="text" icon="el-icon-video-play"@click="handleDeleteorPlayorpause(scope.row.id,1,'启用')">启用</el-button> 54 + 删除</el-button>
55 - <el-button size="mini" type="text" icon="el-icon-video-pause"@click="handleDeleteorPlayorpause(scope.row.id,3,'停用')">停用</el-button> 55 + <el-button size="mini" type="text" icon="el-icon-video-play"
56 + @click="handleDeleteorPlayorpause(scope.row,1,'启用')">启用</el-button>
57 + <el-button size="mini" type="text" icon="el-icon-video-pause"
58 + @click="handleDeleteorPlayorpause(scope.row,3,'停用')">停用</el-button>
56 </template> 59 </template>
57 </el-table-column> 60 </el-table-column>
58 </el-table> 61 </el-table>
...@@ -93,15 +96,15 @@ ...@@ -93,15 +96,15 @@
93 <el-row> 96 <el-row>
94 <el-col :span="12"> 97 <el-col :span="12">
95 <el-form-item label="有效开始时间" prop="startDate"> 98 <el-form-item label="有效开始时间" prop="startDate">
96 - <el-date-picker clearable size="small" :picker-options="pickerOptionsStart" v-model="form.startDate" type="date" value-format="yyyy-MM-dd" 99 + <el-date-picker clearable size="small" :picker-options="pickerOptionsStart" v-model="form.startDate"
97 - placeholder="选择开始时间"> 100 + type="date" value-format="yyyy-MM-dd" placeholder="选择开始时间">
98 </el-date-picker> 101 </el-date-picker>
99 </el-form-item> 102 </el-form-item>
100 </el-col> 103 </el-col>
101 <el-col :span="12"> 104 <el-col :span="12">
102 <el-form-item label="有效结束时间" prop="endDate"> 105 <el-form-item label="有效结束时间" prop="endDate">
103 - <el-date-picker clearable size="small" :picker-options="pickerOptionsEnd" v-model="form.endDate" type="date" value-format="yyyy-MM-dd" 106 + <el-date-picker clearable size="small" :picker-options="pickerOptionsEnd" v-model="form.endDate"
104 - placeholder="选择结束时间"> 107 + type="date" value-format="yyyy-MM-dd" placeholder="选择结束时间">
105 </el-date-picker> 108 </el-date-picker>
106 </el-form-item> 109 </el-form-item>
107 </el-col> 110 </el-col>
...@@ -148,9 +151,10 @@ ...@@ -148,9 +151,10 @@
148 disabledDate: time => { 151 disabledDate: time => {
149 let endDateVal = this.form.endDate; 152 let endDateVal = this.form.endDate;
150 if (endDateVal) { 153 if (endDateVal) {
151 - return time.getTime() > new Date(endDateVal).getTime() ||time.getTime() < new Date().getTime()- 24 * 60 * 60 * 1000; 154 + return time.getTime() > new Date(endDateVal).getTime() || time.getTime() < new Date().getTime() - 24 *
152 - }else{ 155 + 60 * 60 * 1000;
153 - return time.getTime() < new Date().getTime()- 24 * 60 * 60 * 1000; 156 + } else {
157 + return time.getTime() < new Date().getTime() - 24 * 60 * 60 * 1000;
154 } 158 }
155 } 159 }
156 }, 160 },
...@@ -159,8 +163,8 @@ ...@@ -159,8 +163,8 @@
159 let beginDateVal = this.form.startDate; 163 let beginDateVal = this.form.startDate;
160 if (beginDateVal) { 164 if (beginDateVal) {
161 return time.getTime() < new Date(beginDateVal).getTime(); 165 return time.getTime() < new Date(beginDateVal).getTime();
162 - }else{ 166 + } else {
163 - return time.getTime() < new Date().getTime()- 24 * 60 * 60 * 1000; 167 + return time.getTime() < new Date().getTime() - 24 * 60 * 60 * 1000;
164 } 168 }
165 } 169 }
166 }, 170 },
...@@ -202,7 +206,7 @@ ...@@ -202,7 +206,7 @@
202 status: undefined, //状态 206 status: undefined, //状态
203 flightDate: undefined //日期 207 flightDate: undefined //日期
204 }, 208 },
205 - dayOfWeek:[], 209 + dayOfWeek: [],
206 // 表单参数 210 // 表单参数
207 form: { 211 form: {
208 dayOfWeek: [] 212 dayOfWeek: []
...@@ -235,68 +239,77 @@ ...@@ -235,68 +239,77 @@
235 this.queryParams.start = 0; 239 this.queryParams.start = 0;
236 } 240 }
237 findSourceFlightRulesApi(this.queryParams).then(response => { 241 findSourceFlightRulesApi(this.queryParams).then(response => {
238 - if(response.code==200){ 242 + if (response.code == 200) {
239 - this.sourceFlightRulesList = response.data.list; 243 + this.sourceFlightRulesList = response.data.list;
240 - this.total = response.data.totalCount; 244 + this.total = response.data.totalCount;
241 - this.loading = false; 245 + this.loading = false;
242 - }else{ 246 + } else {
243 - this.msgError(response.msg); 247 + this.msgError(response.msg);
244 - } 248 + }
245 249
246 }); 250 });
247 251
248 }, 252 },
249 /** 新增按钮操作 */ 253 /** 新增按钮操作 */
250 handleAdd() { 254 handleAdd() {
251 - this.form={ }; 255 + this.form = {};
252 this.open = true; 256 this.open = true;
253 this.title = "添加原航班顺位规则"; 257 this.title = "添加原航班顺位规则";
254 this.form.id = -1; 258 this.form.id = -1;
255 - this.dayOfWeek=[]; 259 + this.dayOfWeek = [];
256 260
257 }, 261 },
258 /** 修改按钮操作 */ 262 /** 修改按钮操作 */
259 handleUpdate(row) { 263 handleUpdate(row) {
260 264
261 - this.form={ }; 265 + this.form = {};
262 - this.dayOfWeek=[]; 266 + this.dayOfWeek = [];
263 - this.open = true; 267 + this.open = true;
264 - this.title = "修改原航班顺位规则"; 268 + this.title = "修改原航班顺位规则";
265 - this.form =row; 269 + this.form = row;
266 - this.dayOfWeek= this.form.dayOfWeek ? this.form.dayOfWeek.split(";") : []; 270 + this.dayOfWeek = this.form.dayOfWeek ? this.form.dayOfWeek.split(";") : [];
267 //this.form.dayOfWeek = this.form.dayOfWeek ? this.form.dayOfWeek.split(";") : []; 271 //this.form.dayOfWeek = this.form.dayOfWeek ? this.form.dayOfWeek.split(";") : [];
268 272
269 }, 273 },
270 /** 删除 启用 停用按钮操作 */ 274 /** 删除 启用 停用按钮操作 */
271 - handleDeleteorPlayorpause(rowid,status,statusText) { 275 + handleDeleteorPlayorpause(row, status, statusText) {
276 + debugger
277 + //删除前需要停用
278 + if (status === 0 && row.status != '3') {
279 + this.$message({
280 + message: '请停用后删除',
281 + type: 'warning'
282 + });
283 + return;
284 + }
272 285
273 - this.$confirm('是否确认' + statusText + '此数据项?', "警告", { 286 + this.$confirm('是否确认' + statusText + '此数据项?', "警告", {
274 - confirmButtonText: "确定", 287 + confirmButtonText: "确定",
275 - cancelButtonText: "取消", 288 + cancelButtonText: "取消",
276 - type: "warning" 289 + type: "warning"
277 - }).then(function() { 290 + }).then(function() {
278 291
279 - let disable={ 292 + let disable = {
280 - id:rowid, 293 + id: row.id,
281 - status:status 294 + status: status
282 }; 295 };
283 296
284 - return delOrEnableORDisableApi(disable); 297 + return delOrEnableORDisableApi(disable);
285 - }).then(response => { 298 + }).then(response => {
286 - if(response.code==200){ 299 + if (response.code == 200) {
287 - this.findSourceFlightRules(); 300 + this.findSourceFlightRules();
288 - this.msgSuccess(statusText+"成功"); 301 + this.msgSuccess(statusText + "成功");
289 - }else{ 302 + } else {
290 - this.msgError(response.msg); 303 + this.msgError(response.msg);
291 - } 304 + }
292 305
293 - }).catch(function() {}); 306 + }).catch(function() {});
294 }, 307 },
295 /** 提交按钮 */ 308 /** 提交按钮 */
296 submitForm: function() { 309 submitForm: function() {
297 this.$refs["form"].validate(valid => { 310 this.$refs["form"].validate(valid => {
298 if (valid) { 311 if (valid) {
299 - this.form.dayOfWeek=this.dayOfWeek.sort(); 312 + this.form.dayOfWeek = this.dayOfWeek.sort();
300 //处理数据 313 //处理数据
301 sourceFlightRulesSaveApi(this.form).then(response => { 314 sourceFlightRulesSaveApi(this.form).then(response => {
302 if (response.code === 200) { 315 if (response.code === 200) {
...@@ -337,10 +350,10 @@ ...@@ -337,10 +350,10 @@
337 this.loadingFlightDate = true; 350 this.loadingFlightDate = true;
338 this.sourceFlightAndFlightDate = []; 351 this.sourceFlightAndFlightDate = [];
339 findSourceFlightAndFlightDateApi(this.queryParams).then(response => { 352 findSourceFlightAndFlightDateApi(this.queryParams).then(response => {
340 - if(response.code === 200){ 353 + if (response.code === 200) {
341 this.sourceFlightAndFlightDate = response.data; 354 this.sourceFlightAndFlightDate = response.data;
342 this.loadingFlightDate = false; 355 this.loadingFlightDate = false;
343 - }else{ 356 + } else {
344 this.msgError(response.msg); 357 this.msgError(response.msg);
345 } 358 }
346 359
...@@ -355,7 +368,7 @@ ...@@ -355,7 +368,7 @@
355 // 取消按钮 368 // 取消按钮
356 cancel() { 369 cancel() {
357 this.open = false; 370 this.open = false;
358 - // this.reset(); 371 + // this.reset();
359 }, 372 },
360 // 状态字典翻译 373 // 状态字典翻译
361 statusFormat(row) { 374 statusFormat(row) {
......