| | |
| | | :default-expand-all="isExpandAll" |
| | | :tree-props="{children: 'children', hasChildren: 'hasChildren'}" |
| | | > |
| | | <el-table-column prop="deptName" label="组织架构名称" width="260"></el-table-column> |
| | | <el-table-column prop="deptName" label="组织架构名称"></el-table-column> |
| | | <el-table-column prop="orderNum" label="排序" width="200"></el-table-column> |
| | | <el-table-column prop="status" label="状态" width="100"> |
| | | <el-table-column prop="status" label="状态" width="200"> |
| | | <template slot-scope="scope"> |
| | | <dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status"/> |
| | | </template> |
| | |
| | | <span>{{ parseTime(scope.row.createTime) }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> |
| | | <el-table-column label="操作" align="center" class-name="small-padding" width="200"> |
| | | <template slot-scope="scope"> |
| | | <el-button |
| | | size="mini" |
| | |
| | | <el-row> |
| | | <el-col :span="24" v-if="form.parentId !== 0"> |
| | | <el-form-item label="上级组织架构" prop="parentId"> |
| | | <treeselect v-model="form.parentId" :options="deptOptions" :normalizer="normalizer" placeholder="选择上级组织架构" /> |
| | | <treeselect v-model="form.parentId" :options="deptOptions" :normalizer="normalizer" placeholder="选择上级组织架构" @input="getDistrict"/> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | this.title = "添加组织架构"; |
| | | listDept().then(response => { |
| | | this.deptOptions = this.handleTree(response.data, "deptId"); |
| | | }); |
| | | }) |
| | | }, |
| | | /** 展开/折叠操作 */ |
| | | toggleExpandAll() { |
| | |
| | | this.getList(); |
| | | this.$modal.msgSuccess("删除成功"); |
| | | }).catch(() => {}); |
| | | }, |
| | | getDistrict(val){ |
| | | const t = this |
| | | t.form.districtCode = t.findCodeById(t.deptOptions,val) |
| | | }, |
| | | findCodeById(data,id){ |
| | | for(let node of data){ |
| | | if(node.deptId == id){ |
| | | return node.districtCode |
| | | } |
| | | if(node.children){ |
| | | const findNode = this.findCodeById(node.children,id) |
| | | if(findNode){ |
| | | return findNode |
| | | } |
| | | } |
| | | } |
| | | return null |
| | | } |
| | | } |
| | | }; |