jwyu 1 year ago
parent
commit
29baec1766

+ 11 - 3
src/views/classify_manage/classifyEnlistV2.vue

@@ -150,7 +150,15 @@ export default {
             if(res.Ret===200){
                 this.list=res.Data.List||[]
                 if(type==='init'){
-                    this.classifyparentArr=JSON.parse(JSON.stringify(res.Data.List)) || [];
+                    const arr=JSON.parse(JSON.stringify(this.list))
+                    this.classifyparentArr=arr.map(item=>{
+                        item.Child&&item.Child.forEach(_item=>{
+                            _item.Child=null
+                        })
+                        return {
+                            ...item
+                        }
+                    })
                     this.classifyparentArr.unshift({Id:'0',ClassifyName:'无',Child:null})
                 }
             }
@@ -179,7 +187,7 @@ export default {
                 show:true,
                 classify_id:0,
                 classify_name:"",
-                parent_id: '',
+                parent_id: '0',
                 variety:'',//关联的品种
             }
         },
@@ -198,7 +206,7 @@ export default {
             const { classify_name,parent_id,sort,classify_id } = this.classifyForm;
             let params = {
                 ClassifyName: classify_name,
-                ParentId: Number(item.ParentId)||0,
+                ParentId: Number(parent_id)||0,
                 EnPermissions:this.classifyForm.variety||[]
             }
             // console.log(params);

+ 1 - 1
src/views/report_manage/reportVarietyV2.vue

@@ -108,7 +108,7 @@
                         </el-select>
                     </el-form-item>
                     <el-form-item label="品种名称">
-                        <el-input placeholder="请输入品种名称" v-model="editBreedData.name" style="width:400px"></el-input>
+                        <el-input placeholder="请输入品种名称" v-model.trim="editBreedData.name" style="width:400px"></el-input>
                     </el-form-item>
                     <el-form-item label="启用状态" v-if="!editBreedData.id">
                         <el-switch