物资管理

This commit is contained in:
jjLv 2024-10-25 18:13:13 +08:00
parent 7f53d4a40d
commit 3dd8720bb6
6 changed files with 233 additions and 567 deletions

View File

@ -12,7 +12,7 @@ export function getMaTypeList(query) {
//机具类型管理列表信息 //机具类型管理列表信息
export function getListByMaType(query) { export function getListByMaType(query) {
return request({ return request({
url: '/material/ma_type/list', url: '/material/ma_type/getListByMaType',
method: 'get', method: 'get',
params: query, params: query,
}) })

View File

@ -3,7 +3,7 @@ import request from '@/utils/request'
//组织人员树类型管理 //组织人员树类型管理
export function getMatConfigList(query) { export function getMatConfigList(query) {
return request({ return request({
url: '/material/ma_type_config/getDeptUserTree', url: '/system/user/deptUserTree',
method: 'get', method: 'get',
params: query, params: query,
}) })
@ -12,7 +12,7 @@ export function getMatConfigList(query) {
//组织人员树类型管理列表 //组织人员树类型管理列表
export function getListByMatConfig(query) { export function getListByMatConfig(query) {
return request({ return request({
url: '/material/ma_type_config/getMaTypeConfigList', url: '/material/ma_type/getMaTypeConfigList',
method: 'get', method: 'get',
params: query, params: query,
}) })

View File

@ -530,8 +530,6 @@ export default {
getUserList({ userName: this.userName ,deptId:0}).then(response => { getUserList({ userName: this.userName ,deptId:0}).then(response => {
console.log('response',response) console.log('response',response)
this.deptOptions = response.data this.deptOptions = response.data
// this.total = response.total;
console.log('response',response)
} }
); );
}, },

View File

@ -179,7 +179,7 @@
<el-form-item label="营业执照"> <el-form-item label="营业执照">
<el-upload <el-upload
class = "upload-demo" class = "upload-demo"
:action="upload.url" action="#"
:file-list="businessLicenseList" :file-list="businessLicenseList"
:show-file-list="true" :show-file-list="true"
:auto-upload="false" :auto-upload="false"

File diff suppressed because it is too large Load Diff

View File

@ -112,9 +112,9 @@
default-expand-all default-expand-all
:tree-props="{ children: 'children' }" :tree-props="{ children: 'children' }"
border border
@selection-change="handleSelectionChange" @select="selectTr"
@select="handleSelect"
@select-all="handleSelectAll" @select-all="handleSelectAll"
@selection-change="handleSelectionChange"
> >
<el-table-column <el-table-column
type="selection" type="selection"
@ -159,7 +159,7 @@
<el-table-column <el-table-column
label="规格型号" label="规格型号"
align="center" align="center"
prop="parentThreeLevelName" prop="parentOneLevelName"
show-overflow-tooltip show-overflow-tooltip
/> />
<el-table-column <el-table-column
@ -343,6 +343,8 @@ export default {
afterPrice: "", afterPrice: "",
useDate: "", useDate: "",
}, },
isAllSelect:false,
selectionRows:[],
}; };
}, },
watch: { watch: {
@ -474,12 +476,12 @@ export default {
this.loading = true; this.loading = true;
getListByMatConfig(this.queryParams).then((response) => { getListByMatConfig(this.queryParams).then((response) => {
this.typeList = response.data; this.typeList = response.data;
response.data.forEach(item=>{ // response.data.forEach(item=>{
if(item.children.length!=0){ // if(item.children.length!=0){
this.totalTemp=this.totalTemp+item.children.length // this.totalTemp=this.totalTemp+item.children.length
} // }
}) // })
this.totalTemp = this.totalTemp + response.data.length // this.totalTemp = this.totalTemp + response.data.length
this.loading = false; this.loading = false;
}); });
@ -493,6 +495,7 @@ 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.userIdTemp = data.id), (this.queryParams.userId = data.id); (this.userIdTemp = data.id), (this.queryParams.userId = data.id);
}, },
// //
@ -514,6 +517,7 @@ export default {
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
// this.queryParams.pageNum = 1; // this.queryParams.pageNum = 1;
this.$refs.multipleTable.clearSelection();
this.getList(); this.getList();
}, },
/** 重置按钮操作 */ /** 重置按钮操作 */
@ -528,76 +532,73 @@ export default {
this.handleQuery(); this.handleQuery();
}, },
// //
handleSelectionChange(selection) { handleSelectionChange(selection) {
this.selectionRows = selection,
this.ids = selection.map((item) =>item.typeId); this.ids = selection.map((item) =>item.typeId);
console.log('ids----',this.ids)
this.single = selection.length != 1; this.single = selection.length != 1;
this.multiple = !selection.length; this.multiple = !selection.length;
console.log('ids---------',this.ids)
}, },
handleSelect(selection, row) { handleSelect(selection, row) {
this.toggleSelection(selection, row); this.toggleSelection(selection, row);
}, },
handleSelectAll(selection) { handleSelectAll(selection) {
// this.countTemp++; this.isAllSelect = !this.isAllSelect;
console.log('selectionThree',selection) let data = this.typeList;
if (this.countTemp == 1 && selection.length == this.typeList.length) { this.toggleSelect(data,this.isAllSelect,'all');
this.typeList.forEach((row) => {
this.toggleSelection([row], row);
});
this.countTemp=2
} else if (
this.countTemp == 2 &&
selection.length == this.totalTemp - this.typeList.length
) {
this.typeList.forEach((row) => {
this.toggleSelectionFalse([row], row);
});
this.countTemp=1
}
},
// else if (
// this.countTemp != 1 &&
// this.countTemp != 2 &&
// selection.length == this.totalTemp
// ) {
// this.typeList.forEach((row) => {
// this.toggleSelection([row], row);
// });
// } else if (
// this.countTemp != 1 &&
// this.countTemp != 2 &&
// selection.length == this.totalTemp - this.typeList.length
// ) {
// this.typeList.forEach((row) => {
// this.toggleSelectionFalse([row], row);
// });
// }
// },
toggleSelection(selection, row) {
if (row.children && row.children.length) {
row.children.forEach((child) => {
this.$refs.multipleTable.toggleRowSelection(
child,
selection.includes(row)
);
this.toggleSelection(selection, child);
});
}
},
toggleSelectionFalse(selection, row) {
if (row.children && row.children.length) {
row.children.forEach((child) => {
this.$refs.multipleTable.toggleRowSelection(
child,
!selection.includes(row)
);
this.toggleSelectionFalse(selection, child);
});
}
}, },
//
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);
})
}
}
},
//
toggleSelection(row, flag) {
this.$set(row,'isChecked',flag);
this.$nextTick(()=>{
if (flag) {
this.$refs.multipleTable.toggleRowSelection(row, flag);
} else {
this.$refs.multipleTable.clearSelection();
}
});
},
/** 绑定按钮操作 */ /** 绑定按钮操作 */
handleBind() { handleBind() {
console.log('ids----',this.ids)
if (this.userIdTemp == -1) { if (this.userIdTemp == -1) {
this.$alert("未勾选绑定人,无法绑定", "提示", { this.$alert("未勾选绑定人,无法绑定", "提示", {
type: "warning", type: "warning",
@ -605,24 +606,26 @@ export default {
}); });
return; return;
} }
// if (this.ids.length == 0) { if (this.ids.length == 0) {
// this.$alert("", "", { this.$alert("未进行勾选相关物资,无法绑定", "提示", {
// type: "warning", type: "warning",
// confirmButtonText: "", confirmButtonText: "确定",
// }); });
// return; return;
// } else { } else {
// const ids = this.ids.join(","); const ids = this.ids.join(",");
// } }
console.log(this.typeIdTemp);
bindRepair({ bindRepair({
typeId: this.typeIdTemp, typeId: 3,
userId: this.userIdTemp, userId: this.userIdTemp,
bindFlag: 1, bindFlag: 1,
bindRoleType: 1, bindRoleType: 1,
}).then((response) => { }).then((response) => {
this.$modal.msgSuccess("绑定成功"); this.$modal.msgSuccess("绑定成功");
this.ids = null;
this.getTreeData();
this.getList(); this.getList();
this.$refs.multipleTable.clearSelection();
}); });
}, },