qinzhipeng_v@didiglobal.com před 4 roky
rodič
revize
e8d8c9cc06

+ 4 - 2
src/views/monthly/components/createdMonthly.vue

@@ -52,6 +52,8 @@ export default {
   },
   methods: {
     monthly_dialog() {
+      this.$refs.monthly_form.content ? this.$refs.monthly_form.clearValidate('content') : this.rules.content = [{ required: true, message: '素材不能为空', trigger: 'change' }]
+      this.$refs.monthly_form.thumb ? this.$refs.monthly_form.clearValidate('thumb') : this.rules.thumb = [{ required: true, message: '缩略图不能为空', trigger: 'change' }]
       this.$refs.monthly_form.validate((valid) => {
         if (valid) {
           this.$emit('monthly_created', this.monthly_form)
@@ -64,7 +66,7 @@ export default {
     },
     handleRemoveTow(file, fileList) {
       if (fileList.length === 0) {
-        this.kfFormRules.content = [{ required: true, message: '素材不能为空', trigger: 'change' }]
+        this.rules.content = [{ required: true, message: '素材不能为空', trigger: 'change' }]
       }
     },
     handlePictureCardPreviewTow(file) {
@@ -73,7 +75,7 @@ export default {
     },
     handleRemove(file, fileList) {
       if (fileList.length === 0) {
-        this.kfFormRules.thumb = [{ required: true, message: '缩略图不能为空', trigger: 'change' }]
+        this.rules.thumb = [{ required: true, message: '缩略图不能为空', trigger: 'change' }]
       }
     },
     handlePictureCardPreview(file) {

+ 1 - 1
src/views/monthly/index.vue

@@ -82,6 +82,7 @@ export default {
     },
     async materialGetMaterialList() {
       const num = this.$route.query.id
+      console.log(num, '路由id')
       const res = await materialGetMaterialList({})
       if (res.code === 200) {
         this.monthly_nav_list = res.data
@@ -130,7 +131,6 @@ export default {
       })
     },
     async monthly_created(data) {
-      console.log(data, 'cdbjksbkj')
       const res = await materialAddMaterial(data)
       if (res.code === 200) {
         this.materialGetMaterialList()