许成详 6 years ago
parent
commit
274ee7687a

+ 3
- 3
src/pages/system/cmsManager/majorProjects/edit.vue View File

@@ -298,7 +298,7 @@ export default {
298 298
         errorMsg: '专题简介不能为空',
299 299
         type: 'isNull'
300 300
       }, {
301
-        target: Boolean(this.detail.IsAllCourse || ''),
301
+        target: Boolean(String(this.detail.IsAllCourse) || ''),
302 302
         errorMsg: '展示课程不能为空',
303 303
         type: 'isNull'
304 304
       }, {
@@ -319,12 +319,12 @@ export default {
319 319
       const courseids = (this.detail.Courses || []).map(x => x.CourseId).join(',')
320 320
       if (this.id === '') {
321 321
         this.detail.OrgId = this.OrgId
322
-        console.log(JSON.stringify({ ...this.detail, OrgId: this.OrgId, imgs: this.imgShow, detailimgs: this.detailImgShow, courseids }))
322
+        // console.log(JSON.stringify({ ...this.detail, OrgId: this.OrgId, imgs: this.imgShow, detailimgs: this.detailImgShow, courseids }))
323 323
         this.AddCaseInfo({ ...this.detail, OrgId: this.OrgId, imgs: this.imgShow, detailimgs: this.detailImgShow, courseids }).then((res) => {
324 324
           this.afterSave()
325 325
         })
326 326
       } else {
327
-        console.log(JSON.stringify({ ...this.detail, OrgId: this.OrgId, imgs: this.imgShow, detailimgs: this.detailImgShow, courseids }))
327
+        // console.log(JSON.stringify({ ...this.detail, OrgId: this.OrgId, imgs: this.imgShow, detailimgs: this.detailImgShow, courseids }))
328 328
         this.AddCaseInfo({ ...this.detail, imgs: this.imgShow, detailimgs: this.detailImgShow, courseids }).then((res) => {
329 329
           this.afterSave()
330 330
         })

+ 11
- 11
src/pages/system/courseManager/courseList/add.vue View File

@@ -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
       }])