shanyunduo.cheng

Merge branch 'master' of http://118.178.128.178/Fedex/imac-vue

...@@ -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>
...@@ -70,7 +73,7 @@ ...@@ -70,7 +73,7 @@
70 <el-table-column label="航班日期" align="center" prop="flightDate" /> 73 <el-table-column label="航班日期" align="center" prop="flightDate" />
71 <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="200"> 74 <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="200">
72 <template slot-scope="scope"> 75 <template slot-scope="scope">
73 - <el-button size="mini" type="text" icon="el-icon-edit">查看配置维度</el-button> 76 + <el-button size="mini" type="text" icon="el-icon-edit" @click="handleClick(scope.row.sourceFlightNo, 'detail')">查看配置维度</el-button>
74 </template> 77 </template>
75 </el-table-column> 78 </el-table-column>
76 </el-table> 79 </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 },
...@@ -182,10 +186,7 @@ ...@@ -182,10 +186,7 @@
182 statusList: [{ 186 statusList: [{
183 'id': 1, 187 'id': 1,
184 'name': '有效' 188 'name': '有效'
185 - }, { 189 + },{
186 - 'id': 2,
187 - 'name': '配置中'
188 - }, {
189 'id': 3, 190 'id': 3,
190 'name': '停用' 191 'name': '停用'
191 }], 192 }],
...@@ -202,7 +203,7 @@ ...@@ -202,7 +203,7 @@
202 status: undefined, //状态 203 status: undefined, //状态
203 flightDate: undefined //日期 204 flightDate: undefined //日期
204 }, 205 },
205 - dayOfWeek:[], 206 + dayOfWeek: [],
206 // 表单参数 207 // 表单参数
207 form: { 208 form: {
208 dayOfWeek: [] 209 dayOfWeek: []
...@@ -226,6 +227,13 @@ ...@@ -226,6 +227,13 @@
226 this.findSourceFlightRules(); 227 this.findSourceFlightRules();
227 }, 228 },
228 methods: { 229 methods: {
230 + //跳转到查看,修改页面
231 + handleClick(flightiId, handle) {
232 + this.$router.push({
233 + name: "Info",
234 + params: { handle: handle, id: flightiId },
235 + });
236 + },
229 /** 查询原航班顺位规则*/ 237 /** 查询原航班顺位规则*/
230 findSourceFlightRules() { 238 findSourceFlightRules() {
231 //this.loading = true; 239 //this.loading = true;
...@@ -235,68 +243,77 @@ ...@@ -235,68 +243,77 @@
235 this.queryParams.start = 0; 243 this.queryParams.start = 0;
236 } 244 }
237 findSourceFlightRulesApi(this.queryParams).then(response => { 245 findSourceFlightRulesApi(this.queryParams).then(response => {
238 - if(response.code==200){ 246 + if (response.code == 200) {
239 - this.sourceFlightRulesList = response.data.list; 247 + this.sourceFlightRulesList = response.data.list;
240 - this.total = response.data.totalCount; 248 + this.total = response.data.totalCount;
241 - this.loading = false; 249 + this.loading = false;
242 - }else{ 250 + } else {
243 - this.msgError(response.msg); 251 + this.msgError(response.msg);
244 - } 252 + }
245 253
246 }); 254 });
247 255
248 }, 256 },
249 /** 新增按钮操作 */ 257 /** 新增按钮操作 */
250 handleAdd() { 258 handleAdd() {
251 - this.form={ }; 259 + this.form = {};
252 this.open = true; 260 this.open = true;
253 this.title = "添加原航班顺位规则"; 261 this.title = "添加原航班顺位规则";
254 this.form.id = -1; 262 this.form.id = -1;
255 - this.dayOfWeek=[]; 263 + this.dayOfWeek = [];
256 264
257 }, 265 },
258 /** 修改按钮操作 */ 266 /** 修改按钮操作 */
259 handleUpdate(row) { 267 handleUpdate(row) {
260 268
261 - this.form={ }; 269 + this.form = {};
262 - this.dayOfWeek=[]; 270 + this.dayOfWeek = [];
263 - this.open = true; 271 + this.open = true;
264 - this.title = "修改原航班顺位规则"; 272 + this.title = "修改原航班顺位规则";
265 - this.form =row; 273 + this.form = row;
266 - this.dayOfWeek= this.form.dayOfWeek ? this.form.dayOfWeek.split(";") : []; 274 + this.dayOfWeek = this.form.dayOfWeek ? this.form.dayOfWeek.split(";") : [];
267 //this.form.dayOfWeek = this.form.dayOfWeek ? this.form.dayOfWeek.split(";") : []; 275 //this.form.dayOfWeek = this.form.dayOfWeek ? this.form.dayOfWeek.split(";") : [];
268 276
269 }, 277 },
270 /** 删除 启用 停用按钮操作 */ 278 /** 删除 启用 停用按钮操作 */
271 - handleDeleteorPlayorpause(rowid,status,statusText) { 279 + handleDeleteorPlayorpause(row, status, statusText) {
280 + debugger
281 + //删除前需要停用
282 + if (status === 0 && row.status != '3') {
283 + this.$message({
284 + message: '请停用后删除',
285 + type: 'warning'
286 + });
287 + return;
288 + }
272 289
273 - this.$confirm('是否确认' + statusText + '此数据项?', "警告", { 290 + this.$confirm('是否确认' + statusText + '此数据项?', "警告", {
274 - confirmButtonText: "确定", 291 + confirmButtonText: "确定",
275 - cancelButtonText: "取消", 292 + cancelButtonText: "取消",
276 - type: "warning" 293 + type: "warning"
277 - }).then(function() { 294 + }).then(function() {
278 295
279 - let disable={ 296 + let disable = {
280 - id:rowid, 297 + id: row.id,
281 - status:status 298 + status: status
282 }; 299 };
283 300
284 - return delOrEnableORDisableApi(disable); 301 + return delOrEnableORDisableApi(disable);
285 - }).then(response => { 302 + }).then(response => {
286 - if(response.code==200){ 303 + if (response.code == 200) {
287 - this.findSourceFlightRules(); 304 + this.findSourceFlightRules();
288 - this.msgSuccess(statusText+"成功"); 305 + this.msgSuccess(statusText + "成功");
289 - }else{ 306 + } else {
290 - this.msgError(response.msg); 307 + this.msgError(response.msg);
291 - } 308 + }
292 309
293 - }).catch(function() {}); 310 + }).catch(function() {});
294 }, 311 },
295 /** 提交按钮 */ 312 /** 提交按钮 */
296 submitForm: function() { 313 submitForm: function() {
297 this.$refs["form"].validate(valid => { 314 this.$refs["form"].validate(valid => {
298 if (valid) { 315 if (valid) {
299 - this.form.dayOfWeek=this.dayOfWeek.sort(); 316 + this.form.dayOfWeek = this.dayOfWeek.sort();
300 //处理数据 317 //处理数据
301 sourceFlightRulesSaveApi(this.form).then(response => { 318 sourceFlightRulesSaveApi(this.form).then(response => {
302 if (response.code === 200) { 319 if (response.code === 200) {
...@@ -337,10 +354,10 @@ ...@@ -337,10 +354,10 @@
337 this.loadingFlightDate = true; 354 this.loadingFlightDate = true;
338 this.sourceFlightAndFlightDate = []; 355 this.sourceFlightAndFlightDate = [];
339 findSourceFlightAndFlightDateApi(this.queryParams).then(response => { 356 findSourceFlightAndFlightDateApi(this.queryParams).then(response => {
340 - if(response.code === 200){ 357 + if (response.code === 200) {
341 this.sourceFlightAndFlightDate = response.data; 358 this.sourceFlightAndFlightDate = response.data;
342 this.loadingFlightDate = false; 359 this.loadingFlightDate = false;
343 - }else{ 360 + } else {
344 this.msgError(response.msg); 361 this.msgError(response.msg);
345 } 362 }
346 363
...@@ -355,7 +372,7 @@ ...@@ -355,7 +372,7 @@
355 // 取消按钮 372 // 取消按钮
356 cancel() { 373 cancel() {
357 this.open = false; 374 this.open = false;
358 - // this.reset(); 375 + // this.reset();
359 }, 376 },
360 // 状态字典翻译 377 // 状态字典翻译
361 statusFormat(row) { 378 statusFormat(row) {
......