物资管理
This commit is contained in:
parent
7f53d4a40d
commit
3dd8720bb6
|
|
@ -12,7 +12,7 @@ export function getMaTypeList(query) {
|
|||
//机具类型管理列表信息
|
||||
export function getListByMaType(query) {
|
||||
return request({
|
||||
url: '/material/ma_type/list',
|
||||
url: '/material/ma_type/getListByMaType',
|
||||
method: 'get',
|
||||
params: query,
|
||||
})
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import request from '@/utils/request'
|
|||
//组织人员树类型管理
|
||||
export function getMatConfigList(query) {
|
||||
return request({
|
||||
url: '/material/ma_type_config/getDeptUserTree',
|
||||
url: '/system/user/deptUserTree',
|
||||
method: 'get',
|
||||
params: query,
|
||||
})
|
||||
|
|
@ -12,7 +12,7 @@ export function getMatConfigList(query) {
|
|||
//组织人员树类型管理列表
|
||||
export function getListByMatConfig(query) {
|
||||
return request({
|
||||
url: '/material/ma_type_config/getMaTypeConfigList',
|
||||
url: '/material/ma_type/getMaTypeConfigList',
|
||||
method: 'get',
|
||||
params: query,
|
||||
})
|
||||
|
|
|
|||
|
|
@ -530,8 +530,6 @@ export default {
|
|||
getUserList({ userName: this.userName ,deptId:0}).then(response => {
|
||||
console.log('response',response)
|
||||
this.deptOptions = response.data
|
||||
// this.total = response.total;
|
||||
console.log('response',response)
|
||||
}
|
||||
);
|
||||
},
|
||||
|
|
|
|||
|
|
@ -179,7 +179,7 @@
|
|||
<el-form-item label="营业执照">
|
||||
<el-upload
|
||||
class = "upload-demo"
|
||||
:action="upload.url"
|
||||
action="#"
|
||||
:file-list="businessLicenseList"
|
||||
:show-file-list="true"
|
||||
:auto-upload="false"
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -112,9 +112,9 @@
|
|||
default-expand-all
|
||||
:tree-props="{ children: 'children' }"
|
||||
border
|
||||
@selection-change="handleSelectionChange"
|
||||
@select="handleSelect"
|
||||
@select="selectTr"
|
||||
@select-all="handleSelectAll"
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column
|
||||
type="selection"
|
||||
|
|
@ -159,7 +159,7 @@
|
|||
<el-table-column
|
||||
label="规格型号"
|
||||
align="center"
|
||||
prop="parentThreeLevelName"
|
||||
prop="parentOneLevelName"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
|
|
@ -343,6 +343,8 @@ export default {
|
|||
afterPrice: "",
|
||||
useDate: "",
|
||||
},
|
||||
isAllSelect:false,
|
||||
selectionRows:[],
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
|
|
@ -474,12 +476,12 @@ export default {
|
|||
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
|
||||
// response.data.forEach(item=>{
|
||||
// if(item.children.length!=0){
|
||||
// this.totalTemp=this.totalTemp+item.children.length
|
||||
// }
|
||||
// })
|
||||
// this.totalTemp = this.totalTemp + response.data.length
|
||||
|
||||
this.loading = false;
|
||||
});
|
||||
|
|
@ -493,6 +495,7 @@ export default {
|
|||
handleNodeClick(data, node) {
|
||||
// this.queryParams.level = data.level
|
||||
this.handleQuery();
|
||||
this.$refs.multipleTable.clearSelection();
|
||||
(this.userIdTemp = data.id), (this.queryParams.userId = data.id);
|
||||
},
|
||||
// 取消按钮
|
||||
|
|
@ -514,6 +517,7 @@ export default {
|
|||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
// this.queryParams.pageNum = 1;
|
||||
this.$refs.multipleTable.clearSelection();
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
|
|
@ -528,76 +532,73 @@ export default {
|
|||
this.handleQuery();
|
||||
},
|
||||
|
||||
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.selectionRows = selection,
|
||||
this.ids = selection.map((item) =>item.typeId);
|
||||
console.log('ids----',this.ids)
|
||||
this.single = selection.length != 1;
|
||||
this.multiple = !selection.length;
|
||||
console.log('ids---------',this.ids)
|
||||
},
|
||||
handleSelect(selection, row) {
|
||||
this.toggleSelection(selection, row);
|
||||
},
|
||||
handleSelectAll(selection) {
|
||||
// this.countTemp++;
|
||||
console.log('selectionThree',selection)
|
||||
if (this.countTemp == 1 && selection.length == this.typeList.length) {
|
||||
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);
|
||||
});
|
||||
}
|
||||
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');
|
||||
});
|
||||
},
|
||||
|
||||
//递归子级
|
||||
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() {
|
||||
console.log('ids----',this.ids)
|
||||
if (this.userIdTemp == -1) {
|
||||
this.$alert("未勾选绑定人,无法绑定", "提示", {
|
||||
type: "warning",
|
||||
|
|
@ -605,24 +606,26 @@ export default {
|
|||
});
|
||||
return;
|
||||
}
|
||||
// if (this.ids.length == 0) {
|
||||
// this.$alert("未进行勾选,无法绑定", "提示", {
|
||||
// type: "warning",
|
||||
// confirmButtonText: "确定",
|
||||
// });
|
||||
// return;
|
||||
// } else {
|
||||
// const ids = this.ids.join(",");
|
||||
// }
|
||||
console.log(this.typeIdTemp);
|
||||
if (this.ids.length == 0) {
|
||||
this.$alert("未进行勾选相关物资,无法绑定", "提示", {
|
||||
type: "warning",
|
||||
confirmButtonText: "确定",
|
||||
});
|
||||
return;
|
||||
} else {
|
||||
const ids = this.ids.join(",");
|
||||
}
|
||||
bindRepair({
|
||||
typeId: this.typeIdTemp,
|
||||
typeId: 3,
|
||||
userId: this.userIdTemp,
|
||||
bindFlag: 1,
|
||||
bindRoleType: 1,
|
||||
}).then((response) => {
|
||||
this.$modal.msgSuccess("绑定成功");
|
||||
this.ids = null;
|
||||
this.getTreeData();
|
||||
this.getList();
|
||||
this.$refs.multipleTable.clearSelection();
|
||||
});
|
||||
},
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue