库管员配置
This commit is contained in:
parent
dcbad6826e
commit
6ad52f4107
|
|
@ -12,17 +12,26 @@ export function getMatConfigList(query) {
|
|||
//组织人员树类型管理列表
|
||||
export function getListByMatConfig(query) {
|
||||
return request({
|
||||
url: '/material/ma_type_keeper/list',
|
||||
url: '/material/ma_type/list',
|
||||
method: 'get',
|
||||
params: query,
|
||||
})
|
||||
}
|
||||
|
||||
// 物资类型管理--新增
|
||||
export function bindRepair(data) {
|
||||
// 库管员管理--绑定
|
||||
export function bindKeeper(data) {
|
||||
return request({
|
||||
url: '/material/ma_type_config/updateMaTypeBindInfo',
|
||||
url: '/material/ma_type_keeper',
|
||||
method: 'post',
|
||||
data: data,
|
||||
})
|
||||
}
|
||||
|
||||
// 库管员管理--绑定
|
||||
export function noBindKeeper(data) {
|
||||
return request({
|
||||
url: '/material/ma_type_keeper',
|
||||
method: 'put',
|
||||
data: data,
|
||||
})
|
||||
}
|
||||
|
|
@ -111,8 +111,9 @@
|
|||
ref="multipleTable"
|
||||
row-key="typeId"
|
||||
default-expand-all
|
||||
:tree-props="{ children: 'children' }"
|
||||
border
|
||||
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
|
||||
@select="selectTr"
|
||||
@select-all="handleSelectAll"
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column
|
||||
|
|
@ -130,37 +131,43 @@
|
|||
}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="仓库信息"
|
||||
align="center"
|
||||
prop="parentOneLevelName"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
label="施工类型"
|
||||
align="center"
|
||||
prop="parentFourLevelName"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
>
|
||||
<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"
|
||||
prop="parentThreeLevelName"
|
||||
show-overflow-tooltip
|
||||
width="100"
|
||||
/>
|
||||
>
|
||||
<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"
|
||||
prop="parentTwoLevelName"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
>
|
||||
<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"
|
||||
prop="parentOneLevelName"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
>
|
||||
<template slot-scope="scope" >
|
||||
<span v-if="scope.row.level==4" >{{ scope.row.typeName }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="库管员"
|
||||
align="center"
|
||||
|
|
@ -192,13 +199,6 @@
|
|||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
|
|
@ -225,7 +225,8 @@ import {
|
|||
import {
|
||||
getMatConfigList,
|
||||
getListByMatConfig,
|
||||
bindRepair,
|
||||
bindKeeper,
|
||||
noBindKeeper
|
||||
} from "@/api/ma/typeConfigKeeper";
|
||||
import { getUserList } from "@/api/basic/basic";
|
||||
import { getInfo } from "@/api/login";
|
||||
|
|
@ -400,9 +401,8 @@ export default {
|
|||
getList() {
|
||||
this.loading = true;
|
||||
getListByMatConfig(this.queryParams).then((response) => {
|
||||
this.total = response.total;
|
||||
this.typeList = response.rows;
|
||||
|
||||
// this.total = response.total;
|
||||
this.typeList = this.handleTree(response.rows, "typeId");
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
|
|
@ -455,65 +455,65 @@ export default {
|
|||
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
// this.selectionRows = selection,
|
||||
this.selectionRows = selection,
|
||||
this.ids = selection.map((item) =>item.typeId);
|
||||
this.single = selection.length != 1;
|
||||
this.multiple = !selection.length;
|
||||
console.log('ids---------',this.ids)
|
||||
},
|
||||
// handleSelect(selection, row) {
|
||||
// this.toggleSelection(selection, row);
|
||||
// },
|
||||
// handleSelectAll(selection) {
|
||||
// this.isAllSelect = !this.isAllSelect;
|
||||
// let data = this.typeList;
|
||||
// this.toggleSelect(data,this.isAllSelect,'all');
|
||||
handleSelect(selection, row) {
|
||||
this.toggleSelection(selection, row);
|
||||
},
|
||||
handleSelectAll(selection) {
|
||||
this.isAllSelect = !this.isAllSelect;
|
||||
let data = this.typeList;
|
||||
this.toggleSelect(data,this.isAllSelect,'all');
|
||||
|
||||
// },
|
||||
},
|
||||
|
||||
// //选择某行
|
||||
// selectTr(selection,row){
|
||||
// this.$set(row,'isChecked',!row.isChecked);
|
||||
// this.$nextTick(()=>{
|
||||
// this.isAllSelect = row.isChecked;
|
||||
// this.toggleSelect(row,row.isChecked,'tr');
|
||||
// });
|
||||
// },
|
||||
//选择某行
|
||||
selectTr(selection,row){
|
||||
this.$set(row,'isChecked',!row.isChecked);
|
||||
this.$nextTick(()=>{
|
||||
this.isAllSelect = row.isChecked;
|
||||
this.toggleSelect(row,row.isChecked,'tr');
|
||||
});
|
||||
},
|
||||
|
||||
// //递归子级
|
||||
// toggleSelect(data,flag,type){
|
||||
// if(type === 'all'){
|
||||
// if(data.length > 0){
|
||||
// data.forEach(item=>{
|
||||
// this.toggleSelection(item, flag);
|
||||
// if(item.children && item.children.length > 0){
|
||||
// this.toggleSelect(item.children,flag,type)
|
||||
// }
|
||||
// })
|
||||
// }
|
||||
// }else {
|
||||
// if(data.children && data.children.length > 0){
|
||||
// data.children.forEach(item =>{
|
||||
// item.isChecked = !item.isChecked;
|
||||
// this.$refs.multipleTable.toggleRowSelection(item, flag);
|
||||
// this.toggleSelect(item,flag,type);
|
||||
// })
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
//递归子级
|
||||
toggleSelect(data,flag,type){
|
||||
if(type === 'all'){
|
||||
if(data.length > 0){
|
||||
data.forEach(item=>{
|
||||
this.toggleSelection(item, flag);
|
||||
if(item.children && item.children.length > 0){
|
||||
this.toggleSelect(item.children,flag,type)
|
||||
}
|
||||
})
|
||||
}
|
||||
}else {
|
||||
if(data.children && data.children.length > 0){
|
||||
data.children.forEach(item =>{
|
||||
item.isChecked = !item.isChecked;
|
||||
this.$refs.multipleTable.toggleRowSelection(item, flag);
|
||||
this.toggleSelect(item,flag,type);
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
// //改变选中
|
||||
// toggleSelection(row, flag) {
|
||||
// this.$set(row,'isChecked',flag);
|
||||
// this.$nextTick(()=>{
|
||||
// if (flag) {
|
||||
// this.$refs.multipleTable.toggleRowSelection(row, flag);
|
||||
// } else {
|
||||
// this.$refs.multipleTable.clearSelection();
|
||||
// }
|
||||
// });
|
||||
// },
|
||||
//改变选中
|
||||
toggleSelection(row, flag) {
|
||||
this.$set(row,'isChecked',flag);
|
||||
this.$nextTick(()=>{
|
||||
if (flag) {
|
||||
this.$refs.multipleTable.toggleRowSelection(row, flag);
|
||||
} else {
|
||||
this.$refs.multipleTable.clearSelection();
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
/** 绑定按钮操作 */
|
||||
|
|
@ -535,11 +535,9 @@ export default {
|
|||
} else {
|
||||
const ids = this.ids.join(",");
|
||||
}
|
||||
bindRepair({
|
||||
bindKeeper({
|
||||
typeId: 3,
|
||||
userId: this.userIdTemp,
|
||||
bindFlag: 1,
|
||||
bindRoleType: 1,
|
||||
}).then((response) => {
|
||||
this.$modal.msgSuccess("绑定成功");
|
||||
this.ids = null;
|
||||
|
|
@ -573,8 +571,6 @@ export default {
|
|||
bindRepair({
|
||||
typeId: typeId,
|
||||
userId: userId,
|
||||
bindFlag: 2,
|
||||
bindRoleType: 2,
|
||||
}).then((response) => {
|
||||
this.$modal.msgSuccess("解绑成功");
|
||||
this.getList();
|
||||
|
|
@ -584,13 +580,9 @@ export default {
|
|||
handleUpdateKeep(row) {
|
||||
const typeId = row.typeId;
|
||||
const userId = row.keeperUserId;
|
||||
console.log("typeId", typeId);
|
||||
console.log("userId", userId);
|
||||
bindRepair({
|
||||
noBindKeeper({
|
||||
typeId: typeId,
|
||||
userId: userId,
|
||||
bindFlag: 2,
|
||||
bindRoleType: 1,
|
||||
}).then((response) => {
|
||||
this.$modal.msgSuccess("解绑成功");
|
||||
this.getList();
|
||||
|
|
@ -598,44 +590,44 @@ export default {
|
|||
},
|
||||
|
||||
/** 提交按钮 */
|
||||
submitForm: function () {
|
||||
console.log(this.form, "提交参数---");
|
||||
this.$refs["form"].validate((valid) => {
|
||||
if (valid) {
|
||||
if (this.form.typeId != undefined) {
|
||||
updateMaType(this.form).then((response) => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
this.getTreeData();
|
||||
});
|
||||
} else {
|
||||
// this.form.companyId = this.companyId
|
||||
addMaType(this.form).then((response) => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
this.getTreeData();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const typeIds = row.typeId;
|
||||
this.$modal
|
||||
.confirm("是否确认删除数据项?")
|
||||
.then(function () {
|
||||
return delMaType(typeIds);
|
||||
})
|
||||
.then(() => {
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
this.getList();
|
||||
this.getTreeData();
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
// submitForm: function () {
|
||||
// console.log(this.form, "提交参数---");
|
||||
// this.$refs["form"].validate((valid) => {
|
||||
// if (valid) {
|
||||
// if (this.form.typeId != undefined) {
|
||||
// updateMaType(this.form).then((response) => {
|
||||
// this.$modal.msgSuccess("修改成功");
|
||||
// this.open = false;
|
||||
// this.getList();
|
||||
// this.getTreeData();
|
||||
// });
|
||||
// } else {
|
||||
// // this.form.companyId = this.companyId
|
||||
// addMaType(this.form).then((response) => {
|
||||
// this.$modal.msgSuccess("新增成功");
|
||||
// this.open = false;
|
||||
// this.getList();
|
||||
// this.getTreeData();
|
||||
// });
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
// },
|
||||
// /** 删除按钮操作 */
|
||||
// handleDelete(row) {
|
||||
// const typeIds = row.typeId;
|
||||
// this.$modal
|
||||
// .confirm("是否确认删除数据项?")
|
||||
// .then(function () {
|
||||
// return delMaType(typeIds);
|
||||
// })
|
||||
// .then(() => {
|
||||
// this.$modal.msgSuccess("删除成功");
|
||||
// this.getList();
|
||||
// this.getTreeData();
|
||||
// })
|
||||
// .catch(() => {});
|
||||
// },
|
||||
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
|
|
|
|||
Loading…
Reference in New Issue