库管员页面

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({
url: '/system/user/deptUserTree',
method: 'get',
params: query
method: 'post',
data: data
})
}

View File

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