项目人员类型调整

This commit is contained in:
Yjhon 2022-02-26 09:00:09 +08:00
parent 4231cb3fd5
commit 17cf782ec0
1 changed files with 50 additions and 41 deletions

View File

@ -10,13 +10,7 @@
<a-col :span="4" id="tree"> <a-col :span="4" id="tree">
<a-page-header title="单位列表" sub-title="" /> <a-page-header title="单位列表" sub-title="" />
<div v-if="this.orgTree != ''"> <div v-if="this.orgTree != ''">
<a-tree <a-tree :treeData="orgTree" v-if="orgTree.length" @select="onSelect" :defaultExpandAll="false" :expandedKeys="expandedKeys" :replaceFields="replaceFields">
:treeData="orgTree"
v-if="orgTree.length"
@select="onSelect"
:defaultExpandAll="false"
:expandedKeys="expandedKeys"
:replaceFields="replaceFields">
<a-icon slot="switcherIcon" type="down" /> <a-icon slot="switcherIcon" type="down" />
</a-tree> </a-tree>
</div> </div>
@ -30,15 +24,12 @@
<a-input v-model="queryParam.name" placeholder="请输入姓名" /> <a-input v-model="queryParam.name" placeholder="请输入姓名" />
</a-form-item> </a-form-item>
<a-form-item label="人员类型"> <a-form-item label="人员类型">
<a-select default-value="0" style="width: 120px"> <a-select style="width: 150px;" v-model="queryParam.type" placeholder="--请选择--">
<a-select-option value="0"> - - </a-select-option> <a-select-option v-for="item in personType" :key="item.value"> {{ item.name }} </a-select-option>
<a-select-option value="1"> </a-select-option>
<a-select-option value="2"> </a-select-option>
<a-select-option value="3"> </a-select-option>
</a-select> </a-select>
</a-form-item> </a-form-item>
<a-button type="primary" @click="$refs.table.refresh(true)">查询</a-button> <a-button type="primary" @click="$refs.table.refresh(true)">查询</a-button>
<a-button style="margin-left: 8px" @click="() => (queryParam = {})">重置</a-button> <a-button style="margin-left: 8px" @click="() => (queryParam.type = '',queryParam.name = null)">重置</a-button>
</a-row> </a-row>
</a-form> </a-form>
<s-table ref="table" :columns="columns" :data="loadData" :rowKey="(record) => record.id" :rowSelection="{ selectedRowKeys: selectedRowKeys, selectedRows: selectedRows, onChange: onSelectChange }"> <s-table ref="table" :columns="columns" :data="loadData" :rowKey="(record) => record.id" :rowSelection="{ selectedRowKeys: selectedRowKeys, selectedRows: selectedRows, onChange: onSelectChange }">
@ -71,6 +62,7 @@ import { orgList } from '@/api/org/org'
import { listToTree } from '@/utils/util' import { listToTree } from '@/utils/util'
import { personPage } from '@/api/person/person' import { personPage } from '@/api/person/person'
import { STable } from '@/components' import { STable } from '@/components'
import { dictionaryDropDown } from '@/api/sys/dictionaryItem'
const rootParentId = 0 const rootParentId = 0
export default { export default {
@ -89,11 +81,11 @@ export default {
return { return {
form: this.projectForm, form: this.projectForm,
// //
queryParam: { orgType: 1 }, queryParam: { orgType: 1,personType: null,orgId:''},
replaceFields: { children: 'children', title: 'name', key: 'id', value: 'id' }, replaceFields: { children: 'children', title: 'name', key: 'id', value: 'id' },
expandedKeys: [], expandedKeys: [],
personType: [],
autoExpandParent: true, autoExpandParent: true,
expandedKeys: [],
selectedRowKeys: [], selectedRowKeys: [],
selectedRows: this.projectForm.projectPersonLists || [], selectedRows: this.projectForm.projectPersonLists || [],
orgTree: [], orgTree: [],
@ -200,6 +192,22 @@ export default {
console.log('初始化的值', this.selectedRowKeys) console.log('初始化的值', this.selectedRowKeys)
} }
}, },
//
fetchTemplateData() {
let formData = { dictionaryCode: '0005' }
dictionaryDropDown(formData).then(res => {
console.log(res)
if (res.code == 200) {
const result = res.data
result.forEach(r => {
this.personType.push({
value: r.value,
name: r.name
})
})
}
})
},
/** /**
* 获取到机构树展开顶级下树节点考虑到后期数据量变大不建议全部展开 * 获取到机构树展开顶级下树节点考虑到后期数据量变大不建议全部展开
@ -212,7 +220,7 @@ export default {
} }
this.expandedKeys = [] this.expandedKeys = []
this.orgTree = listToTree(res.data, [], rootParentId) this.orgTree = listToTree(res.data, [], rootParentId)
this.orgId = this.orgTree[0].id this.queryParam.orgId = this.orgTree[0].id
// //
this.orgTree.forEach(item => { this.orgTree.forEach(item => {
this.expandedKeys.push(item.id) this.expandedKeys.push(item.id)
@ -224,6 +232,7 @@ export default {
created() { created() {
this.getOrgTree() this.getOrgTree()
this.initPersonList() this.initPersonList()
this.fetchTemplateData()
}, },
// - 访DOM // - 访DOM
mounted() { }, mounted() { },