|  |  | 
 |  |  |           <el-radio :label="2">其他</el-radio> | 
 |  |  |         </el-radio-group> | 
 |  |  |       </el-form-item>--> | 
 |  |  |       <el-form-item label="选择分类:" prop="type"> | 
 |  |  |         <el-cascader v-model="form.cateId" @change="changeSel" :options="cateList" :props="{ | 
 |  |  |       <el-form-item label="选择分类:" prop="cateId"> | 
 |  |  | <!--        <el-cascader v-model="form.cateId" @change="changeSel" :options="cateList" :props="{ | 
 |  |  |           label: 'name', | 
 |  |  |           value: 'id', | 
 |  |  |           children: 'childCategoryList', | 
 |  |  |           checkStrictly: true | 
 |  |  |         }"></el-cascader> | 
 |  |  |         }"></el-cascader>--> | 
 |  |  |         <treeselect | 
 |  |  |             @select="cateChange" | 
 |  |  |             v-model="form.cateId" | 
 |  |  |             placeholder="请选择" | 
 |  |  |             :options="cateList" | 
 |  |  |             :normalizer="normalizeOptions1" | 
 |  |  |             :default-expand-level="1" | 
 |  |  |             noChildrenText="没有子选项" | 
 |  |  |             noOptionsText="没有可选项" | 
 |  |  |             noResultsText="没有匹配的结果" /> | 
 |  |  |       </el-form-item> | 
 |  |  |       <el-form-item label="选择组织:" prop="groupId"> | 
 |  |  |         <el-select v-model="form.groupId" @change="changeSel" clearable filterable placeholder="请选择"> | 
 |  |  |         <treeselect | 
 |  |  |             @input="changeSel" | 
 |  |  |             v-model="form.groupId" | 
 |  |  |             placeholder="请选择" | 
 |  |  |             :options="companyTree" | 
 |  |  |             :normalizer="normalizeOptions" | 
 |  |  |             :default-expand-level="1" | 
 |  |  |             noChildrenText="没有子选项" | 
 |  |  |             noOptionsText="没有可选项" | 
 |  |  |             noResultsText="没有匹配的结果" /> | 
 |  |  | <!--        <el-select v-model="form.groupId" @change="changeSel" clearable filterable placeholder="请选择"> | 
 |  |  |           <template v-for="item in companyList"> | 
 |  |  |             <el-option  v-if="item.countNum && item.countNum>0" :key="item.id" :label="item.name" :value="item.id"> | 
 |  |  |             </el-option> | 
 |  |  |           </template> | 
 |  |  |         </el-select> | 
 |  |  |         </el-select>--> | 
 |  |  |       </el-form-item> | 
 |  |  |       <el-form-item label="选择车主:" prop="memberId"> | 
 |  |  |         <el-select v-model="form.memberId" clearable filterable placeholder="请选择"> | 
 |  |  | 
 |  |  | import { allList } from '@/api/business/member' | 
 |  |  | import { fetchList } from '@/api/business/category.js' | 
 |  |  | import { create, updateById } from '@/api/business/cars' | 
 |  |  | import { companyGetList } from '@/api/business/company' | 
 |  |  | import { companyGetList, fetchList as companyTree } from '@/api/business/company' | 
 |  |  | import { Message } from 'element-ui' | 
 |  |  | export default { | 
 |  |  |   name: 'OperaInternalCompanyWindow', | 
 |  |  | 
 |  |  |         memberId: null, | 
 |  |  |         // type: 0, | 
 |  |  |         groupId: null, | 
 |  |  |         cateId: [] | 
 |  |  |         cateId: null | 
 |  |  |       }, | 
 |  |  |       selectCate: null, | 
 |  |  |       cateList: [], | 
 |  |  |       companyList: [], | 
 |  |  |       companyTree: [], | 
 |  |  |       // 验证规则 | 
 |  |  |       rules: { | 
 |  |  |         code: [{ required: true, message: '请输入车牌号' }], | 
 |  |  | 
 |  |  |       this.title = title | 
 |  |  |       this.visible = true | 
 |  |  |       this.getCate() | 
 |  |  |       this.getCompany() | 
 |  |  |       this.getfindCompanyTreePage() | 
 |  |  |       // 新建组织 | 
 |  |  |       if (target == null) { | 
 |  |  |         this.$nextTick(() => { | 
 |  |  | 
 |  |  |       //   } | 
 |  |  |       // }) | 
 |  |  |     }, | 
 |  |  |     cateChange(node){ | 
 |  |  |       this.selectCate = node | 
 |  |  |     }, | 
 |  |  |     // 规范化选项数据的方法 | 
 |  |  |     normalizeOptions1 (node) { | 
 |  |  |       if (!node.childCategoryList || !node.childCategoryList.length) { | 
 |  |  |         // 去掉children=[]的children属性 | 
 |  |  |         delete node.childCategoryList | 
 |  |  |       } | 
 |  |  |       var node1 = { | 
 |  |  |         id: node.id, | 
 |  |  |         label: node.name, | 
 |  |  |         parentId: node.parentId, | 
 |  |  |         children: node.childCategoryList, | 
 |  |  |       } | 
 |  |  |       return node1 | 
 |  |  |     }, | 
 |  |  |     normalizeOptions (node) { | 
 |  |  |       if (!node.childList || !node.childList.length) { | 
 |  |  |         // 去掉children=[]的children属性 | 
 |  |  |         delete node.childList | 
 |  |  |       } | 
 |  |  |       return { | 
 |  |  |         id: node.id, | 
 |  |  |         label: node.name, | 
 |  |  |         children: node.childList | 
 |  |  |       } | 
 |  |  |     }, | 
 |  |  |     changeSel () { | 
 |  |  |       const { form } = this | 
 |  |  |       if (form.groupId) { | 
 |  |  | 
 |  |  |     confirm () { | 
 |  |  |       console.log('form', this.form.cateId) | 
 |  |  |       const { form } = this | 
 |  |  |       if (form.cateId && form.cateId.length == 2) { | 
 |  |  |  | 
 |  |  |       } else { | 
 |  |  |       if(this.selectCate && this.selectCate.childCategoryList &&  this.selectCate.childCategoryList.length) { | 
 |  |  |         return Message.error('请选择二级分类') | 
 |  |  |       } | 
 |  |  |       this.$refs.form.validate((valid) => { | 
 |  |  |         if (valid) { | 
 |  |  |           const fn = form.id ? updateById : create | 
 |  |  |           fn({ | 
 |  |  |             ...form, | 
 |  |  |             cateId: form.cateId[1] | 
 |  |  |             ...form | 
 |  |  |             // cateId: form.cateId[1] | 
 |  |  |           }).then(res => { | 
 |  |  |             Message.success('保存成功') | 
 |  |  |             this.visible = false | 
 |  |  | 
 |  |  |         capacity: 1000, | 
 |  |  |         page: 1 | 
 |  |  |       }).then(res => { | 
 |  |  |         this.cateList = res.records || [] | 
 |  |  |         if (res && res.records && res.records.length > 0) { | 
 |  |  |           res.records[0].fsStatus = 1 | 
 |  |  |           this.cateList = res.records || [] | 
 |  |  |  | 
 |  |  |         } | 
 |  |  |       }) | 
 |  |  |     }, | 
 |  |  |     getCompany () { | 
 |  |  | 
 |  |  |         this.companyList = res.records || [] | 
 |  |  |       }) | 
 |  |  |     }, | 
 |  |  |     getfindCompanyTreePage () { | 
 |  |  |       companyTree() | 
 |  |  |         .then(res => { | 
 |  |  |           if (res && res.length > 0) { | 
 |  |  |             res[0].fsStatus = 1 | 
 |  |  |             this.companyTree = res | 
 |  |  |           } | 
 |  |  |         }) | 
 |  |  |     }, | 
 |  |  |     loadMember () { | 
 |  |  |       const { form } = this | 
 |  |  |       allList({ |