|
@@ -333,7 +333,7 @@ export default {
|
333
|
333
|
},
|
334
|
334
|
checkFn (arr) {
|
335
|
335
|
for (var n = 0; n < arr.length; n++) {
|
336
|
|
- if ((arr[n].type === 'isNull' && arr[n].target === '') || (arr[n].type === 'Array' && arr[n].target.length)) {
|
|
336
|
+ if (arr[n].type === 'isNull' && !arr[n].target) {
|
337
|
337
|
this.$message({
|
338
|
338
|
message: arr[n].errorMsg,
|
339
|
339
|
type: 'error'
|
|
@@ -345,43 +345,43 @@ export default {
|
345
|
345
|
},
|
346
|
346
|
submit () { // 提交数据
|
347
|
347
|
var checkOff = this.checkFn([{
|
348
|
|
- target: (this.detail.CourseImg || ''),
|
|
348
|
+ target: Boolean(this.detail.CourseImg || ''),
|
349
|
349
|
errorMsg: '课程主图不能为空',
|
350
|
350
|
type: 'isNull'
|
351
|
351
|
}, {
|
352
|
|
- target: (this.detail.CourseName || ''),
|
|
352
|
+ target: Boolean(this.detail.CourseName || ''),
|
353
|
353
|
errorMsg: '课程名称不能为空',
|
354
|
354
|
type: 'isNull'
|
355
|
355
|
}, {
|
356
|
|
- target: (this.detail.LocationId || ''),
|
|
356
|
+ target: Boolean(this.detail.LocationId || ''),
|
357
|
357
|
errorMsg: '课程类型不能为空',
|
358
|
358
|
type: 'isNull'
|
359
|
359
|
}, {
|
360
|
|
- target: (this.detail.Price || ''),
|
|
360
|
+ target: Boolean(this.detail.Price || ''),
|
361
|
361
|
errorMsg: '课程价格不能为空',
|
362
|
362
|
type: 'isNull'
|
363
|
363
|
}, {
|
364
|
|
- target: (this.detail.MaxNum || ''),
|
|
364
|
+ target: Boolean(this.detail.MaxNum || ''),
|
365
|
365
|
errorMsg: '开课人数不能为空',
|
366
|
366
|
type: 'isNull'
|
367
|
367
|
}, {
|
368
|
|
- target: (this.detail.MinNum || ''),
|
|
368
|
+ target: Boolean(this.detail.MinNum || ''),
|
369
|
369
|
errorMsg: '最小开课人数不能为空',
|
370
|
370
|
type: 'isNull'
|
371
|
371
|
}, {
|
372
|
|
- target: (this.detail.CourseNum || ''),
|
|
372
|
+ target: Boolean(this.detail.CourseNum || ''),
|
373
|
373
|
errorMsg: '课时数不能为空',
|
374
|
374
|
type: 'isNull'
|
375
|
375
|
}, {
|
376
|
|
- target: (this.detail.BeginDate || ''),
|
|
376
|
+ target: Boolean(this.detail.BeginDate || ''),
|
377
|
377
|
errorMsg: '起始日期不能为空',
|
378
|
378
|
type: 'isNull'
|
379
|
379
|
}, {
|
380
|
|
- target: (this.detail.EndDate || ''),
|
|
380
|
+ target: Boolean(this.detail.EndDate || ''),
|
381
|
381
|
errorMsg: '截止日期不能为空',
|
382
|
382
|
type: 'isNull'
|
383
|
383
|
}, {
|
384
|
|
- target: ((this.detail.IsSelect === 0 || this.detail.IsSelect) || ''),
|
|
384
|
+ target: Boolean(String(this.detail.IsSelect) || ''),
|
385
|
385
|
errorMsg: '是否精选课程不能为空',
|
386
|
386
|
type: 'isNull'
|
387
|
387
|
}])
|