【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">
<el-form inline>
<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"
:props="defaultProps1"
v-model="ORGAN_ID"
placeholder="请选择单位"
no-options-text="暂无数据"
no-children-text="暂无数据"
@input="handleDepartmentChange"
placeholder="请选择部门"
/>
</el-form-item>
<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 moment from 'moment'
import { upload } from '@/utils/upload'
import SelectTree from '@/components/SelectTree'
import SelectZhiBanUser from '../../../emergency_report/duty_management/shift_registration/components/selectZhiBanUser.vue'
export default {
components: { SelectZhiBanUser, Treeselect, Pagination },
components: { SelectZhiBanUser, SelectTree, Treeselect, Pagination },
data() {
return {
exceltempFormAdd: false,
@ -429,6 +438,7 @@ export default {
children: 'nodes',
label: 'NAME'
},
defaultProps1: { value: 'id', children: 'nodes', label: 'name', multiple: true, emitPath: false },
ORGAN_ID: null,
DepartmentData: [],
normalizer(node) {
@ -448,16 +458,23 @@ export default {
methods: {
//* **************************************
getDepartmentList(fun) {
requestFN('/department/listAll').then((data) => {
this.DepartmentData = data.list.map(item => ({
id: item.department_ID,
label: item.name
}))
this.ORGAN_ID = this.DepartmentData[0].id
fun()
console.log(this.DepartmentData)
// requestFN('/department/listAll').then((data) => {
// this.DepartmentData = data.list.map(item => ({
// id: item.department_ID,
// label: item.name
// }))
// this.ORGAN_ID = this.DepartmentData[0].id
// fun()
// console.log(this.DepartmentData)
// }).catch((e) => {
// console.error('', e)
// })
requestFN(
'/department/listTree',
{}
).then((data) => {
this.DepartmentData = JSON.parse(data.zTreeNodes)
}).catch((e) => {
console.error('获取主管单位数据失败', e)
})
},
handleDepartmentChange(value) {

View File

@ -122,10 +122,9 @@ export default {
rules: {
OFFICE_PHONE: [
{ 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}$/,
message: '请输入正确的手机号码'
pattern: /^1[3-9]\d{9}$|^0\d{2,3}-\d{7,8}$/,
message: '请输入正确的手机号码或座机号码'
}
],
MOVE_PHONE: [

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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