浏览代码

Merge branch 'master' into 2.0

wenjie 1 年之前
父节点
当前提交
d5dd11e5c9
共有 1 个文件被更改,包括 11 次插入8 次删除
  1. 11 8
      src/views/studyManage/menuManage/addMenu.vue

+ 11 - 8
src/views/studyManage/menuManage/addMenu.vue

@@ -90,7 +90,8 @@
           value:'id',
           label:'cateName',
           emitPath: false,
-          children:'child'
+          children:'child',
+          multiple: true
         }"
         ></el-cascader>
       </el-form-item>
@@ -211,20 +212,17 @@ export default {
         if (v) {
           this.loading = true
           let obj = JSON.parse(JSON.stringify(this.setQuery))
-          obj.goodsCateId = obj.goodsCateId.toString()
+          obj.goodsCateId = obj.goodsCateId.join(",")
           obj.columnLevel = this.setQuery.parentId?2 : 1
           addOrUpdate(obj).then(res=>{
             this.loading = false
-
             if(res.state == 'Success'){
-
               this.$notify({
                   title: '成功',
                   message: '操作成功',
                   type: 'success'
                 });
-               
-                  this.$router.push('/studyManage/menuManage/index')
+              this.$router.push('/studyManage/menuManage/index')
             }
           })
               
@@ -286,8 +284,13 @@ export default {
         this.setQuery.belongType = menuInfo.belongType
         this.setQuery.templateType = menuInfo.templateType
         this.setQuery.secondaryImg = menuInfo.secondaryImg
-        this.setQuery.goodsCateId = +menuInfo.goodsCateId
-
+        console.log(menuInfo.goodsCateId)
+        try{
+          this.setQuery.goodsCateId = menuInfo.goodsCateId.split(',').map(e=>+e) || ""
+          console.log('this.setQuery.goodsCateId',this.setQuery.goodsCateId);
+        }catch(e){
+          this.setQuery.goodsCateId = ""
+        }
     }
       this.setQuery.parentId = this.$route.query.parentId