【bug】

部门下拉框错误的问题
pet
shanao 2024-12-11 15:05:14 +08:00
parent 95a5d8d63d
commit 8a22dc94ea
12 changed files with 253 additions and 110 deletions

View File

@ -3,13 +3,21 @@
<div class="filter-container"> <div class="filter-container">
<el-form inline> <el-form inline>
<el-form-item prop="ORGAN_ID" style="width: 250px;"> <el-form-item prop="ORGAN_ID" style="width: 250px;">
<Treeselect <!-- <Treeselect-->
<!-- :options="DepartmentData"-->
<!-- v-model="ORGAN_ID"-->
<!-- placeholder="请选择单位"-->
<!-- no-options-text="暂无数据"-->
<!-- no-children-text="暂无数据"-->
<!-- @input="handleDepartmentChange"-->
<!-- />-->
<SelectTree
ref="deptTree_Select"
:clearable="true"
:options="DepartmentData" :options="DepartmentData"
:props="defaultProps1"
v-model="ORGAN_ID" v-model="ORGAN_ID"
placeholder="请选择单位" placeholder="请选择部门"
no-options-text="暂无数据"
no-children-text="暂无数据"
@input="handleDepartmentChange"
/> />
</el-form-item> </el-form-item>
<el-form-item label="月份:" prop="monthvalue"> <el-form-item label="月份:" prop="monthvalue">
@ -377,9 +385,10 @@ import { Treeselect } from '@riophae/vue-treeselect'
import '@riophae/vue-treeselect/dist/vue-treeselect.css' import '@riophae/vue-treeselect/dist/vue-treeselect.css'
import moment from 'moment' import moment from 'moment'
import { upload } from '@/utils/upload' import { upload } from '@/utils/upload'
import SelectTree from '@/components/SelectTree'
import SelectZhiBanUser from '../../../emergency_report/duty_management/shift_registration/components/selectZhiBanUser.vue' import SelectZhiBanUser from '../../../emergency_report/duty_management/shift_registration/components/selectZhiBanUser.vue'
export default { export default {
components: { SelectZhiBanUser, Treeselect, Pagination }, components: { SelectZhiBanUser, SelectTree, Treeselect, Pagination },
data() { data() {
return { return {
exceltempFormAdd: false, exceltempFormAdd: false,
@ -429,6 +438,7 @@ export default {
children: 'nodes', children: 'nodes',
label: 'NAME' label: 'NAME'
}, },
defaultProps1: { value: 'id', children: 'nodes', label: 'name', multiple: true, emitPath: false },
ORGAN_ID: null, ORGAN_ID: null,
DepartmentData: [], DepartmentData: [],
normalizer(node) { normalizer(node) {
@ -448,16 +458,23 @@ export default {
methods: { methods: {
//* ************************************** //* **************************************
getDepartmentList(fun) { getDepartmentList(fun) {
requestFN('/department/listAll').then((data) => { // requestFN('/department/listAll').then((data) => {
this.DepartmentData = data.list.map(item => ({ // this.DepartmentData = data.list.map(item => ({
id: item.department_ID, // id: item.department_ID,
label: item.name // label: item.name
})) // }))
this.ORGAN_ID = this.DepartmentData[0].id // this.ORGAN_ID = this.DepartmentData[0].id
fun() // fun()
console.log(this.DepartmentData) // console.log(this.DepartmentData)
// }).catch((e) => {
// console.error('', e)
// })
requestFN(
'/department/listTree',
{}
).then((data) => {
this.DepartmentData = JSON.parse(data.zTreeNodes)
}).catch((e) => { }).catch((e) => {
console.error('获取主管单位数据失败', e)
}) })
}, },
handleDepartmentChange(value) { handleDepartmentChange(value) {

View File

@ -122,10 +122,9 @@ export default {
rules: { rules: {
OFFICE_PHONE: [ OFFICE_PHONE: [
{ required: true, message: '办公电话不能为空', trigger: 'blur' }, { required: true, message: '办公电话不能为空', trigger: 'blur' },
{ min: 11, max: 11, message: '请输入11位手机号码', trigger: 'blur' },
{ {
pattern: /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/, pattern: /^1[3-9]\d{9}$|^0\d{2,3}-\d{7,8}$/,
message: '请输入正确的手机号码' message: '请输入正确的手机号码或座机号码'
} }
], ],
MOVE_PHONE: [ MOVE_PHONE: [

View File

@ -198,13 +198,21 @@
<el-input v-model="form.CONTACT_EMAIL" placeholder="请输入联系人电子邮箱..." /> <el-input v-model="form.CONTACT_EMAIL" placeholder="请输入联系人电子邮箱..." />
</el-form-item> </el-form-item>
<el-form-item label="主管单位" prop="SUPERVISING_UNIT"> <el-form-item label="主管单位" prop="SUPERVISING_UNIT">
<Treeselect <!-- <Treeselect-->
<!-- :options="DepartmentData"-->
<!-- v-model="form.SUPERVISING_UNIT"-->
<!-- placeholder="请选择主管单位"-->
<!-- no-options-text="暂无数据"-->
<!-- no-children-text="暂无数据"-->
<!-- @input="handleDepartmentChange"-->
<!-- />-->
<SelectTree
ref="deptTree_Select"
:clearable="true"
:options="DepartmentData" :options="DepartmentData"
:props="defaultProps"
v-model="form.SUPERVISING_UNIT" v-model="form.SUPERVISING_UNIT"
placeholder="请选择主管单位" placeholder="请选择主管单位"
no-options-text="暂无数据"
no-children-text="暂无数据"
@input="handleDepartmentChange"
/> />
</el-form-item> </el-form-item>
<el-form-item label="主管单位地址" prop="SUPERVISING_UNIT_ADDRESS"> <el-form-item label="主管单位地址" prop="SUPERVISING_UNIT_ADDRESS">
@ -262,8 +270,9 @@ import Pagination from '@/components/Pagination'
import { requestFN } from '@/utils/request' import { requestFN } from '@/utils/request'
import { Treeselect } from '@riophae/vue-treeselect' import { Treeselect } from '@riophae/vue-treeselect'
import '@riophae/vue-treeselect/dist/vue-treeselect.css' import '@riophae/vue-treeselect/dist/vue-treeselect.css'
import SelectTree from '@/components/SelectTree'
export default { export default {
components: { Treeselect, Pagination }, components: { Treeselect, SelectTree, Pagination },
data() { data() {
return { return {
// //
@ -293,6 +302,7 @@ export default {
dialogFormEdit: false, dialogFormEdit: false,
dialogFormShow: false, dialogFormShow: false,
dialogType: 'add', dialogType: 'add',
defaultProps: { value: 'id', children: 'nodes', label: 'name', multiple: true, emitPath: false },
form: { form: {
ID: '', ID: '',
ORG_NAME: '', ORG_NAME: '',
@ -530,13 +540,20 @@ export default {
}) })
}, },
getDepartmentList() { getDepartmentList() {
requestFN('/department/listAll').then((data) => { // requestFN('/department/listAll').then((data) => {
this.DepartmentData = data.list.map(item => ({ // this.DepartmentData = data.list.map(item => ({
id: item.department_ID, // id: item.department_ID,
label: item.name // label: item.name
})) // }))
// }).catch((e) => {
// console.error('', e)
// })
requestFN(
'/department/listTree',
{}
).then((data) => {
this.DepartmentData = JSON.parse(data.zTreeNodes)
}).catch((e) => { }).catch((e) => {
console.error('获取主管单位数据失败', e)
}) })
}, },
getTreeList() { getTreeList() {

View File

@ -240,12 +240,20 @@
</el-col> </el-col>
</el-row> </el-row>
<el-form-item label="主管单位" prop="SUPERVISING_AGENCY"> <el-form-item label="主管单位" prop="SUPERVISING_AGENCY">
<Treeselect <!-- <Treeselect-->
<!-- :options="DepartmentData"-->
<!-- v-model="form.SUPERVISING_AGENCY"-->
<!-- placeholder="请选择主管单位"-->
<!-- no-options-text="暂无数据"-->
<!-- no-children-text="暂无数据"-->
<!-- />-->
<SelectTree
ref="deptTree_Select"
:clearable="true"
:options="DepartmentData" :options="DepartmentData"
:props="defaultProps"
v-model="form.SUPERVISING_AGENCY" v-model="form.SUPERVISING_AGENCY"
placeholder="请选择主管单位" placeholder="请选择主管单位"
no-options-text="暂无数据"
no-children-text="暂无数据"
/> />
</el-form-item> </el-form-item>
<el-form-item label="主管单位地址" prop="AGENCY_ADDRESS"> <el-form-item label="主管单位地址" prop="AGENCY_ADDRESS">
@ -318,9 +326,10 @@ import Pagination from '@/components/Pagination'
import { requestFN } from '@/utils/request' import { requestFN } from '@/utils/request'
import { Treeselect } from '@riophae/vue-treeselect' import { Treeselect } from '@riophae/vue-treeselect'
import '@riophae/vue-treeselect/dist/vue-treeselect.css' import '@riophae/vue-treeselect/dist/vue-treeselect.css'
import SelectTree from '@/components/SelectTree'
export default { export default {
components: { Treeselect, Pagination }, components: { Treeselect, SelectTree, Pagination },
data() { data() {
return { return {
@ -339,7 +348,7 @@ export default {
dialogFormMap: false, dialogFormMap: false,
LATITUDE: '', LATITUDE: '',
LONGITUDE: '', LONGITUDE: '',
defaultProps: { value: 'id', children: 'nodes', label: 'name', multiple: true, emitPath: false },
listQuery: { listQuery: {
page: 1, page: 1,
limit: 10 limit: 10
@ -602,13 +611,20 @@ export default {
this.$parent.ticketType = ticketType this.$parent.ticketType = ticketType
}, },
getDepartmentList() { getDepartmentList() {
requestFN('/department/listAll').then((data) => { // requestFN('/department/listAll').then((data) => {
this.DepartmentData = data.list.map(item => ({ // this.DepartmentData = data.list.map(item => ({
id: item.department_ID, // id: item.department_ID,
label: item.name // label: item.name
})) // }))
// }).catch((e) => {
// console.error('', e)
// })
requestFN(
'/department/listTree',
{}
).then((data) => {
this.DepartmentData = JSON.parse(data.zTreeNodes)
}).catch((e) => { }).catch((e) => {
console.error('获取主管单位数据失败', e)
}) })
}, },
getTreeList() { getTreeList() {

View File

@ -166,13 +166,21 @@
<el-input v-model="form.CONTACT_EMAIL" placeholder="请输入联系人电子邮箱..." /> <el-input v-model="form.CONTACT_EMAIL" placeholder="请输入联系人电子邮箱..." />
</el-form-item> </el-form-item>
<el-form-item label="主管单位" prop="SUPERVISING_UNIT"> <el-form-item label="主管单位" prop="SUPERVISING_UNIT">
<Treeselect <!-- <Treeselect-->
<!-- :options="DepartmentData"-->
<!-- v-model="form.SUPERVISING_UNIT"-->
<!-- placeholder="请选择主管单位"-->
<!-- no-options-text="暂无数据"-->
<!-- no-children-text="暂无数据"-->
<!-- @input="handleDepartmentChange"-->
<!-- />-->
<SelectTree
ref="deptTree_Select"
:clearable="true"
:options="DepartmentData" :options="DepartmentData"
:props="defaultProps"
v-model="form.SUPERVISING_UNIT" v-model="form.SUPERVISING_UNIT"
placeholder="请选择主管单位" placeholder="请选择主管单位"
no-options-text="暂无数据"
no-children-text="暂无数据"
@input="handleDepartmentChange"
/> />
</el-form-item> </el-form-item>
<el-form-item label="主管单位地址" prop="SUPERVISING_UNIT_ADDRESS"> <el-form-item label="主管单位地址" prop="SUPERVISING_UNIT_ADDRESS">
@ -245,8 +253,9 @@ import Pagination from '@/components/Pagination'
import { requestFN } from '@/utils/request' import { requestFN } from '@/utils/request'
import { Treeselect } from '@riophae/vue-treeselect' import { Treeselect } from '@riophae/vue-treeselect'
import '@riophae/vue-treeselect/dist/vue-treeselect.css' import '@riophae/vue-treeselect/dist/vue-treeselect.css'
import SelectTree from '@/components/SelectTree'
export default { export default {
components: { Treeselect, Pagination }, components: { Treeselect, SelectTree, Pagination },
data() { data() {
return { return {
// //
@ -335,6 +344,7 @@ export default {
caseSummaryList: [], caseSummaryList: [],
treeData: [], treeData: [],
DepartmentData: [], DepartmentData: [],
defaultProps: { value: 'id', children: 'nodes', label: 'name', multiple: true, emitPath: false },
yjorgTypeData: [], yjorgTypeData: [],
normalizer(node) { normalizer(node) {
return { return {
@ -381,13 +391,20 @@ export default {
this.$parent.ticketType = ticketType this.$parent.ticketType = ticketType
}, },
getDepartmentList() { getDepartmentList() {
requestFN('/department/listAll').then((data) => { // requestFN('/department/listAll').then((data) => {
this.DepartmentData = data.list.map(item => ({ // this.DepartmentData = data.list.map(item => ({
id: item.department_ID, // id: item.department_ID,
label: item.name // label: item.name
})) // }))
// }).catch((e) => {
// console.error('', e)
// })
requestFN(
'/department/listTree',
{}
).then((data) => {
this.DepartmentData = JSON.parse(data.zTreeNodes)
}).catch((e) => { }).catch((e) => {
console.error('获取主管单位数据失败', e)
}) })
}, },
getTreeList() { getTreeList() {

View File

@ -98,7 +98,7 @@ export default {
this.$parent.CASE_ID = id this.$parent.CASE_ID = id
}, },
setCheck() { setCheck() {
if (!this.AUDIT_STATUS || this.AUDIT_STATUS === ''){ if (!this.AUDIT_STATUS || this.AUDIT_STATUS === '') {
this.$message.error('请选择是否通过') this.$message.error('请选择是否通过')
return return
} }

View File

@ -217,13 +217,22 @@
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="12"> <el-col :span="12">
<el-form-item label="主管单位名称" prop="SUPERVISING_UNIT_NAME"> <el-form-item label="主管单位名称" prop="SUPERVISING_UNIT_NAME">
<Treeselect <!-- <Treeselect-->
<!-- :options="DepartmentData"-->
<!-- v-model="form.SUPERVISING_UNIT"-->
<!-- :normalizer="normalizerDe"-->
<!-- placeholder="请选择主管单位名称"-->
<!-- no-options-text="暂无数据"-->
<!-- no-children-text="暂无数据"-->
<!-- @input="handleDepartmentChange"-->
<!-- />-->
<SelectTree
ref="deptTree_Select"
:clearable="true"
:options="DepartmentData" :options="DepartmentData"
v-model="form.SUPERVISING_UNIT" :props="defaultProps"
:normalizer="normalizerDe" v-model="form.AFFILIATEDUNIT"
placeholder="请选择主管单位名称" placeholder="请选择采集单位"
no-options-text="暂无数据"
no-children-text="暂无数据"
@input="handleDepartmentChange" @input="handleDepartmentChange"
/> />
</el-form-item> </el-form-item>
@ -374,9 +383,10 @@ import Pagination from '@/components/Pagination'
import { requestFN } from '@/utils/request' import { requestFN } from '@/utils/request'
import { Treeselect } from '@riophae/vue-treeselect' import { Treeselect } from '@riophae/vue-treeselect'
import '@riophae/vue-treeselect/dist/vue-treeselect.css' import '@riophae/vue-treeselect/dist/vue-treeselect.css'
import SelectTree from '@/components/SelectTree'
export default { export default {
components: { Treeselect, Pagination }, components: { Treeselect, SelectTree, Pagination },
data() { data() {
return { return {
// //
@ -475,6 +485,7 @@ export default {
treeData: [], treeData: [],
DepartmentData: [], DepartmentData: [],
yjTypeData: [], yjTypeData: [],
defaultProps: { value: 'id', children: 'nodes', label: 'name', multiple: true, emitPath: false },
normalizer(node) { normalizer(node) {
return { return {
id: node.DICTIONARIES_ID, id: node.DICTIONARIES_ID,
@ -526,14 +537,21 @@ export default {
this.$parent.ticketType = ticketType this.$parent.ticketType = ticketType
}, },
getDepartmentList() { getDepartmentList() {
requestFN('/department/listAll').then((data) => { // requestFN('/department/listAll').then((data) => {
this.DepartmentData = data.list.map(item => ({ // this.DepartmentData = data.list.map(item => ({
id: item.department_ID, // id: item.department_ID,
label: item.name // label: item.name
})) // }))
console.log(this.DepartmentData) // console.log(this.DepartmentData)
// }).catch((e) => {
// console.error('', e)
// })
requestFN(
'/department/listTree',
{}
).then((data) => {
this.DepartmentData = JSON.parse(data.zTreeNodes)
}).catch((e) => { }).catch((e) => {
console.error('获取主管单位数据失败', e)
}) })
}, },
getTreeList() { getTreeList() {

View File

@ -115,12 +115,13 @@
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="所属单位" prop="SUPERVISING_AGENCY"> <el-form-item label="所属单位" prop="SUPERVISING_AGENCY">
<Treeselect <SelectTree
ref="deptTree_Select"
:clearable="true"
:options="DepartmentData" :options="DepartmentData"
:props="defaultProps"
v-model="form.AFFILIATEDUNIT" v-model="form.AFFILIATEDUNIT"
placeholder="请选择所属单位" placeholder="请选择部门"
no-options-text="暂无数据"
no-children-text="暂无数据"
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -174,8 +175,9 @@ import { requestFN } from '@/utils/request'
import { Treeselect } from '@riophae/vue-treeselect' import { Treeselect } from '@riophae/vue-treeselect'
import '@riophae/vue-treeselect/dist/vue-treeselect.css' import '@riophae/vue-treeselect/dist/vue-treeselect.css'
import { upload } from '@/utils/upload' import { upload } from '@/utils/upload'
import SelectTree from '@/components/SelectTree'
export default { export default {
components: { Treeselect, Pagination }, components: { Treeselect, SelectTree, Pagination },
data() { data() {
return { return {
@ -194,7 +196,7 @@ export default {
dialogFormMap: false, dialogFormMap: false,
LATITUDE: '', LATITUDE: '',
LONGITUDE: '', LONGITUDE: '',
defaultProps: { value: 'id', children: 'nodes', label: 'name', multiple: true, emitPath: false },
listQuery: { listQuery: {
page: 1, page: 1,
limit: 10 limit: 10
@ -302,13 +304,20 @@ export default {
}, },
//* **************************************** //* ****************************************
getDepartmentList() { getDepartmentList() {
requestFN('/department/listAll').then((data) => { // requestFN('/department/listAll').then((data) => {
this.DepartmentData = data.list.map(item => ({ // this.DepartmentData = data.list.map(item => ({
id: item.department_ID, // id: item.department_ID,
label: item.name // label: item.name
})) // }))
// }).catch((e) => {
// console.error('', e)
// })
requestFN(
'/department/listTree',
{}
).then((data) => {
this.DepartmentData = JSON.parse(data.zTreeNodes)
}).catch((e) => { }).catch((e) => {
console.error('获取主管单位数据失败', e)
}) })
}, },
getTreeList() { getTreeList() {

View File

@ -103,12 +103,20 @@
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="12"> <el-col :span="12">
<el-form-item label="所属单位" prop="SUPERVISING_AGENCY"> <el-form-item label="所属单位" prop="SUPERVISING_AGENCY">
<Treeselect <!-- <Treeselect-->
<!-- :options="DepartmentData"-->
<!-- v-model="form.AFFILIATEDUNIT"-->
<!-- placeholder="请选择所属单位"-->
<!-- no-options-text="暂无数据"-->
<!-- no-children-text="暂无数据"-->
<!-- />-->
<SelectTree
ref="deptTree_Select"
:clearable="true"
:options="DepartmentData" :options="DepartmentData"
:props="defaultProps"
v-model="form.AFFILIATEDUNIT" v-model="form.AFFILIATEDUNIT"
placeholder="请选择所属单位" placeholder="请选择所属单位"
no-options-text="暂无数据"
no-children-text="暂无数据"
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -163,8 +171,9 @@ import { requestFN } from '@/utils/request'
import { Treeselect } from '@riophae/vue-treeselect' import { Treeselect } from '@riophae/vue-treeselect'
import '@riophae/vue-treeselect/dist/vue-treeselect.css' import '@riophae/vue-treeselect/dist/vue-treeselect.css'
import { upload } from '@/utils/upload' import { upload } from '@/utils/upload'
import SelectTree from '@/components/SelectTree'
export default { export default {
components: { Treeselect, Pagination }, components: { Treeselect, SelectTree, Pagination },
props: { props: {
resourceLibraryId: { resourceLibraryId: {
type: String, type: String,
@ -253,6 +262,7 @@ export default {
yjrescueEquipData: [], yjrescueEquipData: [],
DepartmentData: [], DepartmentData: [],
defaultProps: { value: 'id', children: 'nodes', label: 'name', multiple: true, emitPath: false },
normalizer(node) { normalizer(node) {
return { return {
id: node.DICTIONARIES_ID, id: node.DICTIONARIES_ID,
@ -306,13 +316,20 @@ export default {
}, },
//* **************************************** //* ****************************************
getDepartmentList() { getDepartmentList() {
requestFN('/department/listAll').then((data) => { // requestFN('/department/listAll').then((data) => {
this.DepartmentData = data.list.map(item => ({ // this.DepartmentData = data.list.map(item => ({
id: item.department_ID, // id: item.department_ID,
label: item.name // label: item.name
})) // }))
// }).catch((e) => {
// console.error('', e)
// })
requestFN(
'/department/listTree',
{}
).then((data) => {
this.DepartmentData = JSON.parse(data.zTreeNodes)
}).catch((e) => { }).catch((e) => {
console.error('获取主管单位数据失败', e)
}) })
}, },
getyjrescueEquipDataList() { getyjrescueEquipDataList() {

View File

@ -103,12 +103,20 @@
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="12"> <el-col :span="12">
<el-form-item label="采集单位" prop="SUPERVISING_AGENCY"> <el-form-item label="采集单位" prop="SUPERVISING_AGENCY">
<Treeselect <!-- <Treeselect-->
<!-- :options="DepartmentData"-->
<!-- v-model="form.AFFILIATEDUNIT"-->
<!-- placeholder="请选择采集单位"-->
<!-- no-options-text="暂无数据"-->
<!-- no-children-text="暂无数据"-->
<!-- />-->
<SelectTree
ref="deptTree_Select"
:clearable="true"
:options="DepartmentData" :options="DepartmentData"
:props="defaultProps"
v-model="form.AFFILIATEDUNIT" v-model="form.AFFILIATEDUNIT"
placeholder="请选择采集单位" placeholder="请选择采集单位"
no-options-text="暂无数据"
no-children-text="暂无数据"
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -160,8 +168,9 @@ import { requestFN } from '@/utils/request'
import { Treeselect } from '@riophae/vue-treeselect' import { Treeselect } from '@riophae/vue-treeselect'
import '@riophae/vue-treeselect/dist/vue-treeselect.css' import '@riophae/vue-treeselect/dist/vue-treeselect.css'
import { upload } from '@/utils/upload' import { upload } from '@/utils/upload'
import SelectTree from '@/components/SelectTree'
export default { export default {
components: { Treeselect, Pagination }, components: { Treeselect, SelectTree, Pagination },
props: { props: {
resourceLibraryId: { resourceLibraryId: {
type: String, type: String,
@ -186,7 +195,7 @@ export default {
dialogFormMap: false, dialogFormMap: false,
LATITUDE: '', LATITUDE: '',
LONGITUDE: '', LONGITUDE: '',
defaultProps: { value: 'id', children: 'nodes', label: 'name', multiple: true, emitPath: false },
listQuery: { listQuery: {
page: 1, page: 1,
limit: 10 limit: 10
@ -304,13 +313,20 @@ export default {
}, },
//* **************************************** //* ****************************************
getDepartmentList() { getDepartmentList() {
requestFN('/department/listAll').then((data) => { // requestFN('/department/listAll').then((data) => {
this.DepartmentData = data.list.map(item => ({ // this.DepartmentData = data.list.map(item => ({
id: item.department_ID, // id: item.department_ID,
label: item.name // label: item.name
})) // }))
// }).catch((e) => {
// console.error('', e)
// })
requestFN(
'/department/listTree',
{}
).then((data) => {
this.DepartmentData = JSON.parse(data.zTreeNodes)
}).catch((e) => { }).catch((e) => {
console.error('获取主管单位数据失败', e)
}) })
}, },
getyjrescueSuppliesDataList() { getyjrescueSuppliesDataList() {

View File

@ -74,7 +74,7 @@
</el-table> </el-table>
<div class="page-btn-group"> <div class="page-btn-group">
<div> <div>
<el-button @click = "goBack()"> </el-button> <el-button v-if="false" @click = "goBack()"> </el-button>
</div> </div>
<pagination <pagination
:total="total" :total="total"

View File

@ -116,12 +116,20 @@
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="所属单位" prop="SUPERVISING_AGENCY"> <el-form-item label="所属单位" prop="SUPERVISING_AGENCY">
<Treeselect <!-- <Treeselect-->
<!-- :options="DepartmentData"-->
<!-- v-model="form.AFFILIATEDUNIT"-->
<!-- placeholder="请选择所属单位"-->
<!-- no-options-text="暂无数据"-->
<!-- no-children-text="暂无数据"-->
<!-- />-->
<SelectTree
ref="deptTree_Select"
:clearable="true"
:options="DepartmentData" :options="DepartmentData"
:props="defaultProps"
v-model="form.AFFILIATEDUNIT" v-model="form.AFFILIATEDUNIT"
placeholder="请选择所属单位" placeholder="请选择所属单位"
no-options-text="暂无数据"
no-children-text="暂无数据"
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -176,8 +184,9 @@ import { requestFN } from '@/utils/request'
import { Treeselect } from '@riophae/vue-treeselect' import { Treeselect } from '@riophae/vue-treeselect'
import '@riophae/vue-treeselect/dist/vue-treeselect.css' import '@riophae/vue-treeselect/dist/vue-treeselect.css'
import { upload } from '@/utils/upload' import { upload } from '@/utils/upload'
import SelectTree from '@/components/SelectTree'
export default { export default {
components: { Treeselect, Pagination }, components: { Treeselect, SelectTree, Pagination },
data() { data() {
return { return {
@ -241,6 +250,7 @@ export default {
yjrescueEquipData: [], yjrescueEquipData: [],
treeData: [], treeData: [],
DepartmentData: [], DepartmentData: [],
defaultProps: { value: 'id', children: 'nodes', label: 'name', multiple: true, emitPath: false },
normalizer(node) { normalizer(node) {
return { return {
id: node.DICTIONARIES_ID, id: node.DICTIONARIES_ID,
@ -286,13 +296,20 @@ export default {
}, },
//* **************************************** //* ****************************************
getDepartmentList() { getDepartmentList() {
requestFN('/department/listAll').then((data) => { // requestFN('/department/listAll').then((data) => {
this.DepartmentData = data.list.map(item => ({ // this.DepartmentData = data.list.map(item => ({
id: item.department_ID, // id: item.department_ID,
label: item.name // label: item.name
})) // }))
// }).catch((e) => {
// console.error('', e)
// })
requestFN(
'/department/listTree',
{}
).then((data) => {
this.DepartmentData = JSON.parse(data.zTreeNodes)
}).catch((e) => { }).catch((e) => {
console.error('获取主管单位数据失败', e)
}) })
}, },
getTreeList() { getTreeList() {