|  |  |  | 
|---|
|  |  |  | <template> | 
|---|
|  |  |  | <GlobalWindow :title="title" :visible.sync="visible" :confirm-working="isWorking" width="600px" @close="close" @confirm="confirm"> | 
|---|
|  |  |  | <GlobalWindow | 
|---|
|  |  |  | :title="title" | 
|---|
|  |  |  | :visible.sync="visible" | 
|---|
|  |  |  | :confirm-working="isWorking" | 
|---|
|  |  |  | width="600px" | 
|---|
|  |  |  | @confirm="confirm"> | 
|---|
|  |  |  | <el-form :model="form" ref="form" :rules="rules"> | 
|---|
|  |  |  | <el-form-item label="分类名称" prop="name"> | 
|---|
|  |  |  | <el-input v-model="form.name" placeholder="请输入分类名称" v-trim /> | 
|---|
|  |  |  | <el-input v-model="form.name" maxlength="30" placeholder="请输入分类名称" v-trim /> | 
|---|
|  |  |  | </el-form-item> | 
|---|
|  |  |  | <el-form-item label="所属分类" prop="parentId"> | 
|---|
|  |  |  | <el-select :disabled="form.id" v-model="form.parentId" placeholder="不填为则一级分类"> | 
|---|
|  |  |  | 
|---|
|  |  |  | <script> | 
|---|
|  |  |  | import BaseOpera from '@/components/base/BaseOpera' | 
|---|
|  |  |  | import GlobalWindow from '@/components/common/GlobalWindow' | 
|---|
|  |  |  | import { create, fetchCateList, getInfoById } from '@/api/business/category.js' | 
|---|
|  |  |  | import { fetchCateList, getInfoById } from '@/api/business/category.js' | 
|---|
|  |  |  | export default { | 
|---|
|  |  |  | name: 'OperaCategoryWindow', | 
|---|
|  |  |  | extends: BaseOpera, | 
|---|
|  |  |  | 
|---|
|  |  |  | remark: '', | 
|---|
|  |  |  | status: '', | 
|---|
|  |  |  | sortnum: '', | 
|---|
|  |  |  | type: 5 | 
|---|
|  |  |  | type: 7 | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | // 验证规则 | 
|---|
|  |  |  | rules: { | 
|---|
|  |  |  | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | methods: { | 
|---|
|  |  |  | getList() { | 
|---|
|  |  |  | fetchCateList({ type: 5 }).then(res => { | 
|---|
|  |  |  | fetchCateList({ type: 7 }).then(res => { | 
|---|
|  |  |  | this.dataList = res || [] | 
|---|
|  |  |  |  | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | close() { | 
|---|
|  |  |  | this.visible = false | 
|---|
|  |  |  | this.$emit('close') | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | getDetail(id) { | 
|---|
|  |  |  | getInfoById(id).then(res => { | 
|---|