库管员,维修员配置

This commit is contained in:
jjLv 2024-10-31 12:53:24 +08:00
parent acc96ac903
commit dcbad6826e
5 changed files with 93 additions and 182 deletions

View File

@ -0,0 +1,28 @@
import request from '@/utils/request'
//组织人员树类型管理
export function getMatConfigList(query) {
return request({
url: '/system/user/deptUserTree',
method: 'get',
params: query,
})
}
//组织人员树类型管理列表
export function getListByMatConfig(query) {
return request({
url: '/material/ma_type_keeper/list',
method: 'get',
params: query,
})
}
// 物资类型管理--新增
export function bindRepair(data) {
return request({
url: '/material/ma_type_config/updateMaTypeBindInfo',
method: 'post',
data: data,
})
}

View File

@ -225,7 +225,7 @@
<!-- 图片查看弹窗 -->
<el-dialog :visible.sync="dialogVisible" width="600px" height="600px" >
<img width="100%" height="100%" :src="dialogImageUrl" />
<img width="100%" height="500px" :src="dialogImageUrl" />
</el-dialog>
</div>
</template>

View File

@ -113,8 +113,6 @@
default-expand-all
:tree-props="{ children: 'children' }"
border
@select="selectTr"
@select-all="handleSelectAll"
@selection-change="handleSelectionChange"
>
<el-table-column
@ -179,7 +177,7 @@
<!-- <div v-else style="color: red;"></div> -->
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="300">
<el-table-column label="操作" align="center" width="130">
<template slot-scope="scope">
<el-button
size="mini"
@ -187,12 +185,20 @@
icon="el-icon-user-solid"
@click="handleUpdateKeep(scope.row)"
v-hasPermi="['machinery:type:config']"
v-if="scope.row.keeperUserName != null"
>
库管解绑
</el-button>
</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>
@ -220,7 +226,7 @@ import {
getMatConfigList,
getListByMatConfig,
bindRepair,
} from "@/api/ma/typeConfig";
} from "@/api/ma/typeConfigKeeper";
import { getUserList } from "@/api/basic/basic";
import { getInfo } from "@/api/login";
import { downloadFile } from "@/utils/download";
@ -343,65 +349,6 @@ export default {
},
keeperDataChange(e) {
this.keeperDataRange.forEach((item) => {
if (e === item.value) {
this.form.keeperDataPro = null;
this.form.keeperDataMat = null;
this.form.keeperDataName = null;
//
let keeper = queryKeeperProApi({
houseId: e,
}).then((projRes) => {
this.keeperProRange = projRes.data.map((item) => {
return {
label: item.typeName,
value: item.typeId,
};
});
});
}
});
},
keeperDataProChange(e) {
this.keeperProRange.forEach((item) => {
if (e === item.value) {
this.form.keeperDataMat = null;
this.form.keeperDataName = null;
//
let keeper = queryKeeperMatApi({
typeId: e,
}).then((projRes) => {
this.keeperMatRange = projRes.data.map((item) => {
return {
label: item.typeName,
value: item.typeId,
};
});
});
}
});
},
keeperDataMatChange(e) {
this.keeperMatRange.forEach((item) => {
if (e === item.value) {
this.form.keeperDataName = null;
//
let keeper = queryKeeperNameApi({
typeId: e,
}).then((projRes) => {
this.keeperNameRange = projRes.data.map((item) => {
return {
label: item.typeName,
value: item.typeId,
};
});
});
}
});
},
/** 查询物资类型 */
async getKeeperDataList(data) {
@ -453,13 +400,8 @@ export default {
getList() {
this.loading = true;
getListByMatConfig(this.queryParams).then((response) => {
this.typeList = response.data;
// response.data.forEach(item=>{
// if(item.children.length!=0){
// this.totalTemp=this.totalTemp+item.children.length
// }
// })
// this.totalTemp = this.totalTemp + response.data.length
this.total = response.total;
this.typeList = response.rows;
this.loading = false;
});
@ -513,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();
// }
// });
// },
/** 绑定按钮操作 */

View File

@ -179,7 +179,7 @@
<!-- <div v-else style="color: red;"></div> -->
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="300">
<el-table-column label="操作" align="center" width="130">
<template slot-scope="scope">
<el-button
size="mini"
@ -187,6 +187,7 @@
icon="el-icon-user-solid"
@click="handleUpdate(scope.row)"
v-hasPermi="['machinery:type:edit']"
v-if="scope.row.repairUserName != null"
>
维修解绑
</el-button>
@ -219,7 +220,7 @@ import {
getMatConfigList,
getListByMatConfig,
bindRepair,
} from "@/api/ma/typeConfig";
} from "@/api/ma/typeConfigRepair";
import { getUserList } from "@/api/basic/basic";
export default {
name: "typeConfig",
@ -339,66 +340,6 @@ export default {
},
keeperDataChange(e) {
this.keeperDataRange.forEach((item) => {
if (e === item.value) {
this.form.keeperDataPro = null;
this.form.keeperDataMat = null;
this.form.keeperDataName = null;
//
let keeper = queryKeeperProApi({
houseId: e,
}).then((projRes) => {
this.keeperProRange = projRes.data.map((item) => {
return {
label: item.typeName,
value: item.typeId,
};
});
});
}
});
},
keeperDataProChange(e) {
this.keeperProRange.forEach((item) => {
if (e === item.value) {
this.form.keeperDataMat = null;
this.form.keeperDataName = null;
//
let keeper = queryKeeperMatApi({
typeId: e,
}).then((projRes) => {
this.keeperMatRange = projRes.data.map((item) => {
return {
label: item.typeName,
value: item.typeId,
};
});
});
}
});
},
keeperDataMatChange(e) {
this.keeperMatRange.forEach((item) => {
if (e === item.value) {
this.form.keeperDataName = null;
//
let keeper = queryKeeperNameApi({
typeId: e,
}).then((projRes) => {
this.keeperNameRange = projRes.data.map((item) => {
return {
label: item.typeName,
value: item.typeId,
};
});
});
}
});
},
/** 查询物资类型 */
async getKeeperDataList(data) {
let keepdataRes = await queryKeeperDataApi({