设备管理-工装管理-挂具设置-新增排序/权限

设备管理-工装管理-飞靶设置-新增排序/权限
dev-scheduling
ysn 1 month ago
parent 24bc6d144b
commit 56b1770339
  1. 16
      src/views/equiptManagement/workwearManagement/columnData.js
  2. 329
      src/views/equiptManagement/workwearManagement/index.vue

@ -5,6 +5,7 @@ export default {
prop: 'fsCode', prop: 'fsCode',
span: 24, span: 24,
search: true, search: true,
sortable: 'custom',
rules: [ rules: [
{ {
required: true, required: true,
@ -18,6 +19,7 @@ export default {
prop: 'fsType', prop: 'fsType',
span: 24, span: 24,
search: true, search: true,
sortable: 'custom',
rules: [ rules: [
{ {
required: true, required: true,
@ -33,6 +35,7 @@ export default {
search: true, search: true,
type: 'select', type: 'select',
display: false, display: false,
sortable: 'custom',
dicUrl: '/api/blade-system/dict/dictionary?code=workwear_status', dicUrl: '/api/blade-system/dict/dictionary?code=workwear_status',
}, },
@ -42,6 +45,7 @@ export default {
label: '挂具编号', label: '挂具编号',
prop: 'rsCode', prop: 'rsCode',
search: true, search: true,
sortable: 'custom',
span: 24, span: 24,
rules: [ rules: [
{ {
@ -56,6 +60,7 @@ export default {
prop: 'rsType', prop: 'rsType',
span: 24, span: 24,
search: true, search: true,
sortable: 'custom',
rules: [ rules: [
{ {
required: true, required: true,
@ -69,6 +74,7 @@ export default {
label: '挂具状态', label: '挂具状态',
prop: 'rsStatus', prop: 'rsStatus',
search: true, search: true,
sortable: 'custom',
type: 'select', type: 'select',
display: false, display: false,
dicUrl: '/api/blade-system/dict/dictionary?code=workwear_status', dicUrl: '/api/blade-system/dict/dictionary?code=workwear_status',
@ -111,7 +117,7 @@ export const feiBaOption = {
labelWidth: 80, labelWidth: 80,
searchLabelWidth: 80, searchLabelWidth: 80,
menuWidth: 80, menuWidth: 80,
menuAlign:"center", menuAlign: "center",
dialogWidth: 600, dialogWidth: 600,
dialogClickModal: false, dialogClickModal: false,
searchEnter: true, searchEnter: true,
@ -138,6 +144,7 @@ export const feiBaOption = {
prop: 'fsCode', prop: 'fsCode',
span: 24, span: 24,
search: true, search: true,
sortable: 'custom',
rules: [ rules: [
{ {
required: true, required: true,
@ -151,6 +158,7 @@ export const feiBaOption = {
prop: 'fsType', prop: 'fsType',
span: 24, span: 24,
search: true, search: true,
sortable: 'custom',
rules: [ rules: [
{ {
required: true, required: true,
@ -164,6 +172,7 @@ export const feiBaOption = {
label: '飞靶状态', label: '飞靶状态',
prop: 'status', prop: 'status',
search: true, search: true,
sortable: 'custom',
type: 'select', type: 'select',
display: false, display: false,
dicUrl: '/api/blade-system/dict/dictionary?code=workwear_status', dicUrl: '/api/blade-system/dict/dictionary?code=workwear_status',
@ -194,7 +203,7 @@ export const rackOption = {
labelWidth: 80, labelWidth: 80,
searchLabelWidth: 80, searchLabelWidth: 80,
menuWidth: 80, menuWidth: 80,
menuAlign:"center", menuAlign: "center",
dialogWidth: 600, dialogWidth: 600,
dialogClickModal: false, dialogClickModal: false,
searchEnter: true, searchEnter: true,
@ -220,6 +229,7 @@ export const rackOption = {
label: '挂具编号', label: '挂具编号',
prop: 'rsCode', prop: 'rsCode',
search: true, search: true,
sortable: 'custom',
span: 24, span: 24,
rules: [ rules: [
{ {
@ -234,6 +244,7 @@ export const rackOption = {
prop: 'rsType', prop: 'rsType',
span: 24, span: 24,
search: true, search: true,
sortable: 'custom',
rules: [ rules: [
{ {
required: true, required: true,
@ -247,6 +258,7 @@ export const rackOption = {
label: '挂具状态', label: '挂具状态',
prop: 'status', prop: 'status',
search: true, search: true,
sortable: 'custom',
type: 'select', type: 'select',
display: false, display: false,
dicUrl: '/api/blade-system/dict/dictionary?code=workwear_status', dicUrl: '/api/blade-system/dict/dictionary?code=workwear_status',

@ -22,9 +22,13 @@
@current-change="currentChange" @current-change="currentChange"
@size-change="sizeChange" @size-change="sizeChange"
@refresh-change="refreshChange" @refresh-change="refreshChange"
@sort-change="sortChange"
:permission="permissionList"
> >
<template #menu-left> <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> </template>
</avue-crud> </avue-crud>
@ -45,42 +49,56 @@
@current-change="currentChange" @current-change="currentChange"
@size-change="sizeChange" @size-change="sizeChange"
@refresh-change="refreshChange" @refresh-change="refreshChange"
@sort-change="sortChange"
:permission="permissionList"
> >
<template #menu-left> <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> </template>
</avue-crud> </avue-crud>
</basic-container> </basic-container>
</template> </template>
<script> <script>
import columnData from "./columnData.js"; import columnData from './columnData.js';
import {getFeiBaSetList,addFeiBaSet,editFeiBaSet,deleteFeiba,getRackSetList,addRackSet,editRackSet,deleteRackSet} from '@/api/equiptManagement/workwearManagement' import {
getFeiBaSetList,
addFeiBaSet,
editFeiBaSet,
deleteFeiba,
getRackSetList,
addRackSet,
editRackSet,
deleteRackSet,
} from '@/api/equiptManagement/workwearManagement';
import { add } from '@/api/system/menu.js'; 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 { export default {
data() { data() {
return { return {
loading: false, loading: false,
tabPosition: "rackSet", tabPosition: 'rackSet',
feibaLoading:false, feibaLoading: false,
gjLoading:false, gjLoading: false,
feiBaOption:feiBaOption, feiBaOption: feiBaOption,
rackOption:rackOption, rackOption: rackOption,
selectionList: [], selectionList: [],
formInline: { formInline: {
type: "", // type: '', //
user: "", // user: '', //
}, },
page: { page: {
pageSize: 10, pageSize: 10,
currentPage: 1, currentPage: 1,
total: 0, total: 0,
}, },
query: {},
option: { option: {
columnSort: true, columnSort: true,
tip: false, tip: false,
height: "auto", height: 'auto',
calcHeight: 32, calcHeight: 32,
simplePage: false, simplePage: false,
searchShow: true, searchShow: true,
@ -103,24 +121,55 @@ export default {
gridBtn: false, gridBtn: false,
index: false, index: false,
searchShowBtn: false, searchShowBtn: false,
searchLabelPosition: "left", searchLabelPosition: 'left',
searchLabelPosition: "left", searchLabelPosition: 'left',
searchGutter: 24, searchGutter: 24,
searchSpan: 6, searchSpan: 6,
menuAlign: "left", menuAlign: 'left',
gridBtn: false, gridBtn: false,
searchMenuPosition: "right", searchMenuPosition: 'right',
addBtnIcon: " ", addBtnIcon: ' ',
viewBtnIcon: " ", viewBtnIcon: ' ',
delBtnIcon: " ", delBtnIcon: ' ',
editBtnIcon: " ", editBtnIcon: ' ',
align: "center", align: 'center',
column: [], column: [],
}, },
data: [], 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: { methods: {
// //
selectionChange(list) { selectionChange(list) {
@ -128,171 +177,191 @@ export default {
}, },
removeFn() { removeFn() {
if (this.selectionList.length === 0) { if (this.selectionList.length === 0) {
return this.$message.warning("请先选择数据再进行删除!"); return this.$message.warning('请先选择数据再进行删除!');
} }
this.$confirm("此操作将永久删除该数据, 是否继续?", "提示", { this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
confirmButtonText: "确认", confirmButtonText: '确认',
cancelButtonText: "取消", cancelButtonText: '取消',
type: "warning", type: 'warning',
}).then(() => { })
if(this.tabPosition == "feiBaSet"){ .then(() => {
deleteFeiba({ids:this.selectionList.map(item => item.id).join(',')}).then(res =>{ if (this.tabPosition == 'feiBaSet') {
if(res.data.code == 200){ deleteFeiba({ ids: this.selectionList.map(item => item.id).join(',') }).then(res => {
this.$message.success('删除成功') if (res.data.code == 200) {
this.getFeiBa() this.$message.success('删除成功');
} this.getFeiBa();
}) }
}else{ });
deleteRackSet({ids:this.selectionList.map(item => item.id).join(',')}).then(res =>{ } else {
if(res.data.code == 200){ deleteRackSet({ ids: this.selectionList.map(item => item.id).join(',') }).then(res => {
this.$message.success('删除成功') if (res.data.code == 200) {
this.getRackSet() 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) { searchChange(params, done) {
if (this.tabPosition == "feiBaSet") { if (this.tabPosition == 'feiBaSet') {
this.query = params; this.query = params;
this.page.currentPage = 1; this.page.currentPage = 1;
this.getFeiBa(); this.getFeiBa();
done(); done();
}else{ } else {
this.query = params; this.query = params;
this.page.currentPage = 1; this.page.currentPage = 1;
this.getRackSet(); this.getRackSet();
done(); done();
} }
}, },
currentChange(currentPage){ currentChange(currentPage) {
this.page.currentPage = currentPage; this.page.currentPage = currentPage;
if(this.tabPosition == "feiBaSet"){ if (this.tabPosition == 'feiBaSet') {
this.getFeiBa(); this.getFeiBa();
}else{ } else {
this.getRackSet(); this.getRackSet();
} }
}, },
sizeChange(pageSize){ sizeChange(pageSize) {
this.page.pageSize = pageSize; this.page.pageSize = pageSize;
if(this.tabPosition == "feiBaSet"){ if (this.tabPosition == 'feiBaSet') {
this.getFeiBa(); this.getFeiBa();
}else{ } else {
this.getRackSet(); this.getRackSet();
} }
}, },
// //
searchReset() { searchReset() {
if (this.tabPosition == "feiBaSet") { if (this.tabPosition == 'feiBaSet') {
this.query = {}; this.query = {};
this.getFeiBa(); this.getFeiBa();
done(); done();
}else{ } else {
this.query = {}; this.query = {};
this.getRackSet(); this.getRackSet();
done(); done();
} }
}, },
rowSave(row, done, loading){ rowSave(row, done, loading) {
if (this.tabPosition == "feiBaSet") { if (this.tabPosition == 'feiBaSet') {
let params = { let params = {
fsCode:row.fsCode, fsCode: row.fsCode,
fsType:row.fsType fsType: row.fsType,
} };
addFeiBaSet(params).then(res =>{ addFeiBaSet(params).then(res => {
if(res.data.code == 200){ if (res.data.code == 200) {
this.$message.success('新增成功') this.$message.success('新增成功');
done() done();
this.getFeiBa() this.getFeiBa();
} }
}) });
}else{ } else {
let params = { let params = {
rsCode:row.rsCode, rsCode: row.rsCode,
rsType:row.rsType rsType: row.rsType,
} };
addRackSet(params).then(res =>{ addRackSet(params).then(res => {
if(res.data.code == 200){ if (res.data.code == 200) {
this.$message.success('新增成功') this.$message.success('新增成功');
done() done();
this.getRackSet() this.getRackSet();
} }
}) });
} }
}, },
rowUpdate(row, index, done, loading){ rowUpdate(row, index, done, loading) {
if (this.tabPosition == "feiBaSet") { if (this.tabPosition == 'feiBaSet') {
let params = { let params = {
id:row.id, id: row.id,
fsCode:row.fsCode, fsCode: row.fsCode,
fsType:row.fsType fsType: row.fsType,
} };
editFeiBaSet(params).then(res =>{ editFeiBaSet(params).then(res => {
if(res.data.code == 200){ if (res.data.code == 200) {
this.$message.success('修改成功') this.$message.success('修改成功');
done() done();
this.getFeiBa() this.getFeiBa();
}else{ } else {
this.$message.error(res.data.message) this.$message.error(res.data.message);
done() done();
} }
}) });
}else{ } else {
let params = { let params = {
id:row.id, id: row.id,
rsCode:row.rsCode, rsCode: row.rsCode,
rsType:row.rsType rsType: row.rsType,
} };
editRackSet(params).then(res =>{ editRackSet(params).then(res => {
if(res.data.code == 200){ if (res.data.code == 200) {
this.$message.success('修改成功') this.$message.success('修改成功');
done() done();
this.getRackSet() this.getRackSet();
}else{ } else {
this.$message.error(res.data.message) this.$message.error(res.data.message);
done() done();
} }
}) });
} }
}, },
getFeiBa(){ getFeiBa() {
// this.feibaLoading = true // this.feibaLoading = true
getFeiBaSetList({ getFeiBaSetList({
current:this.page.currentPage, current: this.page.currentPage,
size:this.page.pageSize, size: this.page.pageSize,
...this.query ...this.query,
}).then(res =>{ }).then(res => {
this.data = res.data.data.records this.data = res.data.data.records;
this.page.total = res.data.data.total this.page.total = res.data.data.total;
// setTimeout(() => { // setTimeout(() => {
// this.feibaLoading = false // this.feibaLoading = false
// }, 50); // }, 50);
}) });
}, },
getRackSet(){ getRackSet() {
// this.gjLoading = true // this.gjLoading = true
getRackSetList({ getRackSetList({
current:this.page.currentPage, current: this.page.currentPage,
size:this.page.pageSize, size: this.page.pageSize,
...this.query ...this.query,
}).then(res =>{ }).then(res => {
this.data = res.data.data.records this.data = res.data.data.records;
this.page.total = res.data.data.total this.page.total = res.data.data.total;
// setTimeout(() => { // setTimeout(() => {
// this.gjLoading = false // this.gjLoading = false
// }, 50); // }, 50);
}) });
}, },
tabPositionChange(value, event) { tabPositionChange(value, event) {
this.option.column = columnData[this.tabPosition]; this.option.column = columnData[this.tabPosition];
if (this.tabPosition == "feiBaSet") { if (this.tabPosition == 'feiBaSet') {
this.getFeiBa() this.getFeiBa();
} else { } else {
this.getRackSet() this.getRackSet();
} }
}, },
onLoad() {}, onLoad() {},

Loading…
Cancel
Save