|
|
|
|
@ -22,9 +22,13 @@ |
|
|
|
|
@current-change="currentChange" |
|
|
|
|
@size-change="sizeChange" |
|
|
|
|
@refresh-change="refreshChange" |
|
|
|
|
@sort-change="sortChange" |
|
|
|
|
:permission="permissionList" |
|
|
|
|
> |
|
|
|
|
<template #menu-left> |
|
|
|
|
<el-button type="danger" plain @click="removeFn">删除</el-button> |
|
|
|
|
<el-button type="danger" plain v-if="currentDeletePermission" @click="removeFn" |
|
|
|
|
>删除</el-button |
|
|
|
|
> |
|
|
|
|
</template> |
|
|
|
|
</avue-crud> |
|
|
|
|
|
|
|
|
|
@ -45,42 +49,56 @@ |
|
|
|
|
@current-change="currentChange" |
|
|
|
|
@size-change="sizeChange" |
|
|
|
|
@refresh-change="refreshChange" |
|
|
|
|
@sort-change="sortChange" |
|
|
|
|
:permission="permissionList" |
|
|
|
|
> |
|
|
|
|
<template #menu-left> |
|
|
|
|
<el-button type="danger" plain @click="removeFn">删除</el-button> |
|
|
|
|
<el-button type="danger" plain v-if="currentDeletePermission" @click="removeFn" |
|
|
|
|
>删除</el-button |
|
|
|
|
> |
|
|
|
|
</template> |
|
|
|
|
</avue-crud> |
|
|
|
|
|
|
|
|
|
</basic-container> |
|
|
|
|
</template> |
|
|
|
|
<script> |
|
|
|
|
import columnData from "./columnData.js"; |
|
|
|
|
import {getFeiBaSetList,addFeiBaSet,editFeiBaSet,deleteFeiba,getRackSetList,addRackSet,editRackSet,deleteRackSet} from '@/api/equiptManagement/workwearManagement' |
|
|
|
|
import columnData from './columnData.js'; |
|
|
|
|
import { |
|
|
|
|
getFeiBaSetList, |
|
|
|
|
addFeiBaSet, |
|
|
|
|
editFeiBaSet, |
|
|
|
|
deleteFeiba, |
|
|
|
|
getRackSetList, |
|
|
|
|
addRackSet, |
|
|
|
|
editRackSet, |
|
|
|
|
deleteRackSet, |
|
|
|
|
} from '@/api/equiptManagement/workwearManagement'; |
|
|
|
|
import { add } from '@/api/system/menu.js'; |
|
|
|
|
import {feiBaOption,rackOption} from './columnData.js' |
|
|
|
|
import { feiBaOption, rackOption } from './columnData.js'; |
|
|
|
|
import { mapGetters } from 'vuex'; |
|
|
|
|
export default { |
|
|
|
|
data() { |
|
|
|
|
return { |
|
|
|
|
loading: false, |
|
|
|
|
tabPosition: "rackSet", |
|
|
|
|
feibaLoading:false, |
|
|
|
|
gjLoading:false, |
|
|
|
|
feiBaOption:feiBaOption, |
|
|
|
|
rackOption:rackOption, |
|
|
|
|
tabPosition: 'rackSet', |
|
|
|
|
feibaLoading: false, |
|
|
|
|
gjLoading: false, |
|
|
|
|
feiBaOption: feiBaOption, |
|
|
|
|
rackOption: rackOption, |
|
|
|
|
selectionList: [], |
|
|
|
|
formInline: { |
|
|
|
|
type: "", //统计类型 |
|
|
|
|
user: "", //调度员 |
|
|
|
|
type: '', //统计类型 |
|
|
|
|
user: '', //调度员 |
|
|
|
|
}, |
|
|
|
|
page: { |
|
|
|
|
pageSize: 10, |
|
|
|
|
currentPage: 1, |
|
|
|
|
total: 0, |
|
|
|
|
}, |
|
|
|
|
query: {}, |
|
|
|
|
option: { |
|
|
|
|
columnSort: true, |
|
|
|
|
tip: false, |
|
|
|
|
height: "auto", |
|
|
|
|
height: 'auto', |
|
|
|
|
calcHeight: 32, |
|
|
|
|
simplePage: false, |
|
|
|
|
searchShow: true, |
|
|
|
|
@ -103,24 +121,55 @@ export default { |
|
|
|
|
gridBtn: false, |
|
|
|
|
index: false, |
|
|
|
|
searchShowBtn: false, |
|
|
|
|
searchLabelPosition: "left", |
|
|
|
|
searchLabelPosition: "left", |
|
|
|
|
searchLabelPosition: 'left', |
|
|
|
|
searchLabelPosition: 'left', |
|
|
|
|
searchGutter: 24, |
|
|
|
|
searchSpan: 6, |
|
|
|
|
menuAlign: "left", |
|
|
|
|
menuAlign: 'left', |
|
|
|
|
gridBtn: false, |
|
|
|
|
searchMenuPosition: "right", |
|
|
|
|
addBtnIcon: " ", |
|
|
|
|
viewBtnIcon: " ", |
|
|
|
|
delBtnIcon: " ", |
|
|
|
|
editBtnIcon: " ", |
|
|
|
|
align: "center", |
|
|
|
|
searchMenuPosition: 'right', |
|
|
|
|
addBtnIcon: ' ', |
|
|
|
|
viewBtnIcon: ' ', |
|
|
|
|
delBtnIcon: ' ', |
|
|
|
|
editBtnIcon: ' ', |
|
|
|
|
align: 'center', |
|
|
|
|
|
|
|
|
|
column: [], |
|
|
|
|
}, |
|
|
|
|
data: [], |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
computed: { |
|
|
|
|
...mapGetters(['permission']), |
|
|
|
|
permissionList() { |
|
|
|
|
// 根据当前tab页签返回对应的权限 |
|
|
|
|
if (this.tabPosition === 'rackSet') { |
|
|
|
|
// 挂具设置权限 |
|
|
|
|
return { |
|
|
|
|
addBtn: this.validData(this.permission.workwearManagement1_add, false), |
|
|
|
|
// viewBtn: this.validData(this.permission.workwearManagement1_view, false), |
|
|
|
|
delBtn: this.validData(this.permission.workwearManagement1_del, false), |
|
|
|
|
editBtn: this.validData(this.permission.workwearManagement1_edit, false), |
|
|
|
|
}; |
|
|
|
|
} else { |
|
|
|
|
// 飞靶设置权限 |
|
|
|
|
return { |
|
|
|
|
addBtn: this.validData(this.permission.workwearManagement2_add, false), |
|
|
|
|
// viewBtn: this.validData(this.permission.workwearManagement2_view, false), |
|
|
|
|
delBtn: this.validData(this.permission.workwearManagement2_del, false), |
|
|
|
|
editBtn: this.validData(this.permission.workwearManagement2_edit, false), |
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
currentDeletePermission() { |
|
|
|
|
// 当前tab页签对应的删除权限 |
|
|
|
|
if (this.tabPosition === 'rackSet') { |
|
|
|
|
return this.validData(this.permission.workwearManagement1_del, false); |
|
|
|
|
} else { |
|
|
|
|
return this.validData(this.permission.workwearManagement2_del, false); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
// 选中表格数据 |
|
|
|
|
selectionChange(list) { |
|
|
|
|
@ -128,171 +177,191 @@ export default { |
|
|
|
|
}, |
|
|
|
|
removeFn() { |
|
|
|
|
if (this.selectionList.length === 0) { |
|
|
|
|
return this.$message.warning("请先选择数据再进行删除!"); |
|
|
|
|
} |
|
|
|
|
this.$confirm("此操作将永久删除该数据, 是否继续?", "提示", { |
|
|
|
|
confirmButtonText: "确认", |
|
|
|
|
cancelButtonText: "取消", |
|
|
|
|
type: "warning", |
|
|
|
|
}).then(() => { |
|
|
|
|
if(this.tabPosition == "feiBaSet"){ |
|
|
|
|
deleteFeiba({ids:this.selectionList.map(item => item.id).join(',')}).then(res =>{ |
|
|
|
|
if(res.data.code == 200){ |
|
|
|
|
this.$message.success('删除成功') |
|
|
|
|
this.getFeiBa() |
|
|
|
|
return this.$message.warning('请先选择数据再进行删除!'); |
|
|
|
|
} |
|
|
|
|
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', { |
|
|
|
|
confirmButtonText: '确认', |
|
|
|
|
cancelButtonText: '取消', |
|
|
|
|
type: 'warning', |
|
|
|
|
}) |
|
|
|
|
}else{ |
|
|
|
|
deleteRackSet({ids:this.selectionList.map(item => item.id).join(',')}).then(res =>{ |
|
|
|
|
if(res.data.code == 200){ |
|
|
|
|
this.$message.success('删除成功') |
|
|
|
|
this.getRackSet() |
|
|
|
|
.then(() => { |
|
|
|
|
if (this.tabPosition == 'feiBaSet') { |
|
|
|
|
deleteFeiba({ ids: this.selectionList.map(item => item.id).join(',') }).then(res => { |
|
|
|
|
if (res.data.code == 200) { |
|
|
|
|
this.$message.success('删除成功'); |
|
|
|
|
this.getFeiBa(); |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}); |
|
|
|
|
} else { |
|
|
|
|
deleteRackSet({ ids: this.selectionList.map(item => item.id).join(',') }).then(res => { |
|
|
|
|
if (res.data.code == 200) { |
|
|
|
|
this.$message.success('删除成功'); |
|
|
|
|
this.getRackSet(); |
|
|
|
|
} |
|
|
|
|
}).catch(() => { |
|
|
|
|
this.$message.info("取消删除"); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
.catch(() => { |
|
|
|
|
this.$message.info('取消删除'); |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
// 刷新 |
|
|
|
|
refreshChange() { |
|
|
|
|
if (this.tabPosition == 'feiBaSet') { |
|
|
|
|
this.getFeiBa(); |
|
|
|
|
} else { |
|
|
|
|
this.getRackSet(); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
// 排序 |
|
|
|
|
sortChange({ prop, order }) { |
|
|
|
|
this.query.descs = undefined; |
|
|
|
|
this.query.ascs = undefined; |
|
|
|
|
let orderByFieldKey = order === 'descending' ? 'descs' : 'ascs'; |
|
|
|
|
this.query[orderByFieldKey] = !prop |
|
|
|
|
? undefined |
|
|
|
|
: prop.replace(/([a-z])([A-Z0-9])/g, '$1_$2').toUpperCase(); |
|
|
|
|
// 重新加载数据 |
|
|
|
|
this.refreshChange(); |
|
|
|
|
}, |
|
|
|
|
// 搜索 |
|
|
|
|
searchChange(params, done) { |
|
|
|
|
if (this.tabPosition == "feiBaSet") { |
|
|
|
|
if (this.tabPosition == 'feiBaSet') { |
|
|
|
|
this.query = params; |
|
|
|
|
this.page.currentPage = 1; |
|
|
|
|
this.getFeiBa(); |
|
|
|
|
done(); |
|
|
|
|
}else{ |
|
|
|
|
} else { |
|
|
|
|
this.query = params; |
|
|
|
|
this.page.currentPage = 1; |
|
|
|
|
this.getRackSet(); |
|
|
|
|
done(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
currentChange(currentPage){ |
|
|
|
|
currentChange(currentPage) { |
|
|
|
|
this.page.currentPage = currentPage; |
|
|
|
|
if(this.tabPosition == "feiBaSet"){ |
|
|
|
|
if (this.tabPosition == 'feiBaSet') { |
|
|
|
|
this.getFeiBa(); |
|
|
|
|
}else{ |
|
|
|
|
} else { |
|
|
|
|
this.getRackSet(); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
sizeChange(pageSize){ |
|
|
|
|
sizeChange(pageSize) { |
|
|
|
|
this.page.pageSize = pageSize; |
|
|
|
|
if(this.tabPosition == "feiBaSet"){ |
|
|
|
|
if (this.tabPosition == 'feiBaSet') { |
|
|
|
|
this.getFeiBa(); |
|
|
|
|
}else{ |
|
|
|
|
} else { |
|
|
|
|
this.getRackSet(); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
// 重置 |
|
|
|
|
searchReset() { |
|
|
|
|
if (this.tabPosition == "feiBaSet") { |
|
|
|
|
if (this.tabPosition == 'feiBaSet') { |
|
|
|
|
this.query = {}; |
|
|
|
|
this.getFeiBa(); |
|
|
|
|
done(); |
|
|
|
|
}else{ |
|
|
|
|
} else { |
|
|
|
|
this.query = {}; |
|
|
|
|
this.getRackSet(); |
|
|
|
|
done(); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
rowSave(row, done, loading){ |
|
|
|
|
if (this.tabPosition == "feiBaSet") { |
|
|
|
|
rowSave(row, done, loading) { |
|
|
|
|
if (this.tabPosition == 'feiBaSet') { |
|
|
|
|
let params = { |
|
|
|
|
fsCode:row.fsCode, |
|
|
|
|
fsType:row.fsType |
|
|
|
|
} |
|
|
|
|
addFeiBaSet(params).then(res =>{ |
|
|
|
|
if(res.data.code == 200){ |
|
|
|
|
this.$message.success('新增成功') |
|
|
|
|
done() |
|
|
|
|
this.getFeiBa() |
|
|
|
|
fsCode: row.fsCode, |
|
|
|
|
fsType: row.fsType, |
|
|
|
|
}; |
|
|
|
|
addFeiBaSet(params).then(res => { |
|
|
|
|
if (res.data.code == 200) { |
|
|
|
|
this.$message.success('新增成功'); |
|
|
|
|
done(); |
|
|
|
|
this.getFeiBa(); |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}else{ |
|
|
|
|
}); |
|
|
|
|
} else { |
|
|
|
|
let params = { |
|
|
|
|
rsCode:row.rsCode, |
|
|
|
|
rsType:row.rsType |
|
|
|
|
} |
|
|
|
|
addRackSet(params).then(res =>{ |
|
|
|
|
if(res.data.code == 200){ |
|
|
|
|
this.$message.success('新增成功') |
|
|
|
|
done() |
|
|
|
|
this.getRackSet() |
|
|
|
|
rsCode: row.rsCode, |
|
|
|
|
rsType: row.rsType, |
|
|
|
|
}; |
|
|
|
|
addRackSet(params).then(res => { |
|
|
|
|
if (res.data.code == 200) { |
|
|
|
|
this.$message.success('新增成功'); |
|
|
|
|
done(); |
|
|
|
|
this.getRackSet(); |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
rowUpdate(row, index, done, loading){ |
|
|
|
|
if (this.tabPosition == "feiBaSet") { |
|
|
|
|
rowUpdate(row, index, done, loading) { |
|
|
|
|
if (this.tabPosition == 'feiBaSet') { |
|
|
|
|
let params = { |
|
|
|
|
id:row.id, |
|
|
|
|
fsCode:row.fsCode, |
|
|
|
|
fsType:row.fsType |
|
|
|
|
} |
|
|
|
|
editFeiBaSet(params).then(res =>{ |
|
|
|
|
if(res.data.code == 200){ |
|
|
|
|
this.$message.success('修改成功') |
|
|
|
|
done() |
|
|
|
|
this.getFeiBa() |
|
|
|
|
}else{ |
|
|
|
|
this.$message.error(res.data.message) |
|
|
|
|
done() |
|
|
|
|
id: row.id, |
|
|
|
|
fsCode: row.fsCode, |
|
|
|
|
fsType: row.fsType, |
|
|
|
|
}; |
|
|
|
|
editFeiBaSet(params).then(res => { |
|
|
|
|
if (res.data.code == 200) { |
|
|
|
|
this.$message.success('修改成功'); |
|
|
|
|
done(); |
|
|
|
|
this.getFeiBa(); |
|
|
|
|
} else { |
|
|
|
|
this.$message.error(res.data.message); |
|
|
|
|
done(); |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}else{ |
|
|
|
|
}); |
|
|
|
|
} else { |
|
|
|
|
let params = { |
|
|
|
|
id:row.id, |
|
|
|
|
rsCode:row.rsCode, |
|
|
|
|
rsType:row.rsType |
|
|
|
|
} |
|
|
|
|
editRackSet(params).then(res =>{ |
|
|
|
|
if(res.data.code == 200){ |
|
|
|
|
this.$message.success('修改成功') |
|
|
|
|
done() |
|
|
|
|
this.getRackSet() |
|
|
|
|
}else{ |
|
|
|
|
this.$message.error(res.data.message) |
|
|
|
|
done() |
|
|
|
|
id: row.id, |
|
|
|
|
rsCode: row.rsCode, |
|
|
|
|
rsType: row.rsType, |
|
|
|
|
}; |
|
|
|
|
editRackSet(params).then(res => { |
|
|
|
|
if (res.data.code == 200) { |
|
|
|
|
this.$message.success('修改成功'); |
|
|
|
|
done(); |
|
|
|
|
this.getRackSet(); |
|
|
|
|
} else { |
|
|
|
|
this.$message.error(res.data.message); |
|
|
|
|
done(); |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
getFeiBa(){ |
|
|
|
|
getFeiBa() { |
|
|
|
|
// this.feibaLoading = true |
|
|
|
|
getFeiBaSetList({ |
|
|
|
|
current:this.page.currentPage, |
|
|
|
|
size:this.page.pageSize, |
|
|
|
|
...this.query |
|
|
|
|
}).then(res =>{ |
|
|
|
|
this.data = res.data.data.records |
|
|
|
|
this.page.total = res.data.data.total |
|
|
|
|
current: this.page.currentPage, |
|
|
|
|
size: this.page.pageSize, |
|
|
|
|
...this.query, |
|
|
|
|
}).then(res => { |
|
|
|
|
this.data = res.data.data.records; |
|
|
|
|
this.page.total = res.data.data.total; |
|
|
|
|
// setTimeout(() => { |
|
|
|
|
// this.feibaLoading = false |
|
|
|
|
// }, 50); |
|
|
|
|
}) |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
getRackSet(){ |
|
|
|
|
getRackSet() { |
|
|
|
|
// this.gjLoading = true |
|
|
|
|
getRackSetList({ |
|
|
|
|
current:this.page.currentPage, |
|
|
|
|
size:this.page.pageSize, |
|
|
|
|
...this.query |
|
|
|
|
}).then(res =>{ |
|
|
|
|
this.data = res.data.data.records |
|
|
|
|
this.page.total = res.data.data.total |
|
|
|
|
current: this.page.currentPage, |
|
|
|
|
size: this.page.pageSize, |
|
|
|
|
...this.query, |
|
|
|
|
}).then(res => { |
|
|
|
|
this.data = res.data.data.records; |
|
|
|
|
this.page.total = res.data.data.total; |
|
|
|
|
// setTimeout(() => { |
|
|
|
|
// this.gjLoading = false |
|
|
|
|
// }, 50); |
|
|
|
|
}) |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
tabPositionChange(value, event) { |
|
|
|
|
this.option.column = columnData[this.tabPosition]; |
|
|
|
|
if (this.tabPosition == "feiBaSet") { |
|
|
|
|
this.getFeiBa() |
|
|
|
|
if (this.tabPosition == 'feiBaSet') { |
|
|
|
|
this.getFeiBa(); |
|
|
|
|
} else { |
|
|
|
|
this.getRackSet() |
|
|
|
|
this.getRackSet(); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
onLoad() {}, |
|
|
|
|
|