|
@@ -217,20 +217,8 @@
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
<el-form-item label="部门" prop="deptName">
|
|
|
- <el-select
|
|
|
- filterable
|
|
|
- v-model="form.deptName"
|
|
|
- @change="deptSelect"
|
|
|
- placeholder="请选择部门"
|
|
|
- >
|
|
|
- <el-option
|
|
|
- v-for="(item, index) in detpList"
|
|
|
- :key="index"
|
|
|
- :label="item.deptName"
|
|
|
- :value="index"
|
|
|
- >
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
+ <!-- 树状结构组件引用 -->
|
|
|
+ <select-tree :param="detpList" :placeholder="'请选择部门'" :modelValue="form.deptName" @setNodeValue="handleNodeClick" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
@@ -498,16 +486,18 @@ import {
|
|
|
updateGARDENBASEDATA,
|
|
|
getEnterprise,
|
|
|
} from "@/api/portal/GARDENBASEDATA/GARDENBASEDATA";
|
|
|
+import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
|
|
+import selectTree from '@/components/selectTree'
|
|
|
|
|
|
export default {
|
|
|
name: "GARDENBASEDATA",
|
|
|
+ components: { selectTree },
|
|
|
data() {
|
|
|
return {
|
|
|
// 新增标签索引
|
|
|
tabMsg: "basicMsg",
|
|
|
// 部门列表
|
|
|
detpList: [],
|
|
|
-
|
|
|
// 根路径
|
|
|
baseURL: process.env.VUE_APP_BASE_API,
|
|
|
// 遮罩层
|
|
@@ -690,16 +680,17 @@ export default {
|
|
|
created() {
|
|
|
this.getList();
|
|
|
getEnterprise().then((res) => {
|
|
|
- this.detpList = res.data;
|
|
|
+ this.detpList = res.data
|
|
|
+
|
|
|
});
|
|
|
},
|
|
|
methods: {
|
|
|
changeIsShowStatus(val) {
|
|
|
this.isShowStatus = val;
|
|
|
},
|
|
|
- deptSelect(val) {
|
|
|
- this.form.deptId = this.detpList[val].deptId;
|
|
|
- this.form.deptName = this.detpList[val].deptName;
|
|
|
+ handleNodeClick(data) {
|
|
|
+ this.$set(this.form, 'deptId', data.deptId)
|
|
|
+ this.$set(this.form, 'deptName', data.deptName)
|
|
|
},
|
|
|
setUpTimeSelect(val) {
|
|
|
this.form.clrq = val;
|