库管员页面

This commit is contained in:
jjLv 2024-11-04 13:00:40 +08:00
parent cf304ce8ee
commit 43bf81c75f
3 changed files with 83 additions and 54 deletions

View File

@ -144,11 +144,11 @@ export function getUnitPerson(unitId) {
} }
// 往来单位-人员配置-左侧人员 // 往来单位-人员配置-左侧人员
export function getUserList(query) { export function getUserList(data) {
return request({ return request({
url: '/system/user/deptUserTree', url: '/system/user/deptUserTree',
method: 'get', method: 'post',
params: query data: data
}) })
} }

View File

@ -794,22 +794,6 @@ export default {
getTreeData() { getTreeData() {
getMaTypeList().then((response) => { getMaTypeList().then((response) => {
this.treeOptions = response.data this.treeOptions = response.data
// if(response.data!=null){
// const firstTree = response.data[0];
// for(let i = 1;i<response.data.length;i++){
// firstTree.children.push(...response.data[i].children)
// }
// this.treeOptions = [firstTree]
// // this.treeTempTwo[0] = response.data[0]
// // this.treeTempTwo[0].children[0]=response.data[0].children
// // console.log('treeTempTwo',this.treeTempTwo)
// // for(let i=1;i<response.data.length;i++){
// // this.treeTempTwo[0].children.push(response.data[i].children)
// // }
// // console.log('treeTempTwo',this.treeTempTwo)
// // this.treeOptions = this.treeTempTwo
// }
// console.log('treeOptions',this.treeOptions)
}) })
}, },
/** 查询列表 */ /** 查询列表 */

View File

@ -3,11 +3,11 @@
<div class="app-container" id="toolsType"> <div class="app-container" id="toolsType">
<el-row :gutter="20"> <el-row :gutter="20">
<!--树数据--> <!--树数据-->
<el-col :span="5" :xs="24"> <el-col :span="4" :xs="24">
<div class="head-container"> <div class="head-container">
<el-input <el-input
v-model="typeName" v-model="peopleName"
placeholder="请输入类型名称" placeholder="请输入人员名称"
clearable clearable
maxlength="50" maxlength="50"
size="small" size="small"
@ -32,8 +32,37 @@
</el-tree> </el-tree>
</div> </div>
</el-col> </el-col>
<!--树数据-->
<el-col :span="4" :xs="24">
<div class="head-container">
<el-input
v-model="typeName"
placeholder="请输入类型名称"
clearable
maxlength="50"
size="small"
prefix-icon="el-icon-search"
style="margin-bottom: 20px"
/>
</div>
<div class="head-container" style>
<el-tree
style="height: 700px; overflow: scroll"
:data="treeOptionsTwo"
:props="defaultPropsTwo"
:expand-on-click-node="false"
:filter-node-method="filterNodeTwo"
ref="treeTwo"
node-key="id"
default-expand-all
highlight-current
@node-click="handleNodeClickTwo"
>
</el-tree>
</div>
</el-col>
<!--用户数据--> <!--用户数据-->
<el-col :span="19" :xs="24"> <el-col :span="16" :xs="24">
<el-form <el-form
:model="queryParams" :model="queryParams"
ref="queryForm" ref="queryForm"
@ -42,9 +71,9 @@
v-show="showSearch" v-show="showSearch"
label-width="68px" label-width="68px"
> >
<el-form-item label="关键字" prop="typeName"> <el-form-item label="关键字" prop="keyword">
<el-input <el-input
v-model="queryParams.typeName" v-model="queryParams.keyword"
placeholder="请输入关键字" placeholder="请输入关键字"
clearable clearable
style="width: 240px" style="width: 240px"
@ -135,38 +164,30 @@
label="施工类型" label="施工类型"
align="center" align="center"
show-overflow-tooltip show-overflow-tooltip
prop="itemType"
> >
<template slot-scope="scope" >
<span v-if="scope.row.level==1" >{{ scope.row.typeName }}</span>
</template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
label="物资类型" label="物资类型"
align="center" align="center"
show-overflow-tooltip show-overflow-tooltip
width="100" width="100"
prop="materialType"
> >
<template slot-scope="scope" >
<span v-if="scope.row.level==2" >{{ scope.row.typeName }}</span>
</template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
label="物资名称" label="物资名称"
align="center" align="center"
show-overflow-tooltip show-overflow-tooltip
prop="materialName"
> >
<template slot-scope="scope" >
<span v-if="scope.row.level==3" >{{ scope.row.typeName }}</span>
</template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
label="规格型号" label="规格型号"
align="center" align="center"
show-overflow-tooltip show-overflow-tooltip
prop="typeName"
> >
<template slot-scope="scope" >
<span v-if="scope.row.level==4" >{{ scope.row.typeName }}</span>
</template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
label="库管员" label="库管员"
@ -209,17 +230,10 @@ import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import { getUserByRoleList, getMaUserList } from "@/api/system/user"; import { getUserByRoleList, getMaUserList } from "@/api/system/user";
import { import {
getProLists,
getMaTypeList, getMaTypeList,
getListByMaType,
getMaType,
queryKeeperDataApi, queryKeeperDataApi,
queryKeeperProApi, queryKeeperProApi,
queryKeeperMatApi, getListByMaType,
queryKeeperNameApi,
delMaType,
addMaType,
updateMaType,
} from "@/api/ma/base"; } from "@/api/ma/base";
import { import {
getMatConfigList, getMatConfigList,
@ -262,8 +276,12 @@ export default {
propList: null, propList: null,
// //
typeName: undefined, typeName: undefined,
//
peopleName: undefined,
// //
treeOptions: undefined, treeOptions: undefined,
//
treeOptionsTwo: undefined,
// //
typeList: undefined, typeList: undefined,
// //
@ -287,6 +305,10 @@ export default {
children: "children", children: "children",
label: "label", label: "label",
}, },
defaultPropsTwo: {
children: "children",
label: "label",
},
userList:[], userList:[],
userNoList:[], userNoList:[],
userIdTemp: -1, userIdTemp: -1,
@ -313,6 +335,10 @@ export default {
watch: { watch: {
// //
typeName(val) { typeName(val) {
this.$refs.treeTwo.filter(val);
},
//
peopleName(val) {
this.$refs.tree.filter(val); this.$refs.tree.filter(val);
}, },
}, },
@ -320,6 +346,7 @@ export default {
// this.getInfo() // this.getInfo()
this.getList(); this.getList();
this.getTreeData(); this.getTreeData();
this.getTreeDataTwo();
this.getKeeperDataList(); this.getKeeperDataList();
// this.getUserList() // this.getUserList()
// this.getPropData() // this.getPropData()
@ -334,7 +361,7 @@ export default {
renderConent(h, { node }) { renderConent(h, { node }) {
let iconClass = ''; let iconClass = '';
// node // node
if (node.data.level == 3) { if (node.data.level == 99) {
iconClass = 'el-icon-user-solid'; iconClass = 'el-icon-user-solid';
} }
// else if (node.type === 'file') { // else if (node.type === 'file') {
@ -392,18 +419,25 @@ export default {
// getMatConfigList().then((response) => { // getMatConfigList().then((response) => {
// this.treeOptions = response.data; // this.treeOptions = response.data;
// }); // });
getUserList({ userName: this.userName ,deptId:0}).then(response => { const roleIds = [7,14];
getUserList({ roleIds: roleIds}).then(response => {
this.treeOptions = response.data this.treeOptions = response.data
}); });
}, },
/** 查询新增页面-上级类型下拉树结构 */
getTreeDataTwo() {
getMaTypeList().then((response) => {
this.treeOptionsTwo = response.data
})
},
/** 查询列表 */ /** 查询列表 */
getList() { getList() {
this.loading = true; this.loading = true
getListByMatConfig(this.queryParams).then((response) => { getListByMaType(this.queryParams).then((response) => {
// this.total = response.total; this.typeList = response.data.rows
this.typeList = this.handleTree(response.data, "typeId"); this.total = response.data.total
this.loading = false; this.loading = false
}); })
}, },
// - // -
filterNode(value, data) { filterNode(value, data) {
@ -413,10 +447,21 @@ export default {
// - // -
handleNodeClick(data, node) { handleNodeClick(data, node) {
// this.queryParams.level = data.level // this.queryParams.level = data.level
this.handleQuery(); // this.handleQuery();
this.$refs.multipleTable.clearSelection(); this.$refs.multipleTable.clearSelection();
(this.userIdTemp = data.id), (this.queryParams.userId = data.id); (this.userIdTemp = data.id), (this.queryParams.userId = data.id);
}, },
// -
filterNodeTwo(value, data) {
if (!value) return true
return data.label.indexOf(value) !== -1
},
// -
async handleNodeClickTwo(data,node) {
this.queryParams.typeId = data.id
this.queryParams.level = data.level
this.handleQuery()
},
// //
cancel() { cancel() {
this.open = false; this.open = false;