基础数据-分派规则维护-新增排序/权限

dev-scheduling
ysn 1 month ago
parent 6d50393ad7
commit c5409d6303
  1. 288
      src/views/basicData/ruleMaintenance.vue

@ -14,6 +14,8 @@
@size-change="sizeChange" @size-change="sizeChange"
@refresh-change="refreshChange" @refresh-change="refreshChange"
@on-load="onLoad" @on-load="onLoad"
@sort-change="sortChange"
:permission="permissionList"
> >
<template #singleArea="{ row }"> <template #singleArea="{ row }">
{{ row.lowArea + '~' + row.upArea }} {{ row.lowArea + '~' + row.upArea }}
@ -22,20 +24,39 @@
{{ row.singleDownArea + '~' + row.singleUpArea }} {{ row.singleDownArea + '~' + row.singleUpArea }}
</template> </template>
<template #menu-left> <template #menu-left>
<el-button type="primary" @click="handleAdd">新增</el-button> <el-button type="primary" v-if="permission.ruleMaintenance_add" @click="handleAdd"
<el-button type="danger" @click="handleDelete">删除</el-button> >新增</el-button
>
<el-button type="danger" v-if="permission.ruleMaintenance_del" @click="handleDelete"
>删除</el-button
>
</template> </template>
<template #menu-right> <template #menu-right>
<el-button type="primary" @click="handleImport">导入</el-button> <el-button type="primary" v-if="permission.ruleMaintenance_import" @click="handleImport"
>导入</el-button
>
</template> </template>
<template #menu="scope"> <template #menu="scope">
<el-button type="text" @click="editRow(scope.row)">修改</el-button> <el-button type="text" v-if="permission.ruleMaintenance_edit" @click="editRow(scope.row)"
<el-button type="text" @click="rowDel(scope.row)">删除</el-button> >修改</el-button
>
<el-button type="text" v-if="permission.ruleMaintenance_del" @click="rowDel(scope.row)"
>删除</el-button
>
</template> </template>
</avue-crud> </avue-crud>
<add-rule-dialog v-if="showDialog" :isOpen="showDialog" :row="checkRow" :moldAddMore="moldAddMore" @closeDialog="closeDialog"></add-rule-dialog> <add-rule-dialog
v-if="showDialog"
:isOpen="showDialog"
:row="checkRow"
:moldAddMore="moldAddMore"
@closeDialog="closeDialog"
></add-rule-dialog>
<!-- 导入 --> <!-- 导入 -->
<basic-import v-if="isShowImport" title="导入" :isShow="isShowImport" <basic-import
v-if="isShowImport"
title="导入"
:isShow="isShowImport"
templateUrl="/blade-desk/bsAssign/downloadExcelTemplate" templateUrl="/blade-desk/bsAssign/downloadExcelTemplate"
templateName="分派规则模板.xls" templateName="分派规则模板.xls"
importUrl="/blade-desk/bsAssign/importExcel" importUrl="/blade-desk/bsAssign/importExcel"
@ -45,9 +66,10 @@
</template> </template>
<script> <script>
import addRuleDialog from './components/addRuleDialog.vue' import addRuleDialog from './components/addRuleDialog.vue';
import basicImport from '@/components/basic-import/main.vue' import basicImport from '@/components/basic-import/main.vue';
import {getList,deleteRules} from "@/api/basicData/ruleMaintenance" import { getList, deleteRules } from '@/api/basicData/ruleMaintenance';
import { mapGetters } from 'vuex';
export default { export default {
components: { addRuleDialog, basicImport }, components: { addRuleDialog, basicImport },
data() { data() {
@ -65,7 +87,7 @@ export default {
form: {}, form: {},
selectionList: [], selectionList: [],
option: { option: {
height: "auto", height: 'auto',
calcHeight: 32, calcHeight: 32,
tip: false, tip: false,
// size: "medium", // size: "medium",
@ -82,11 +104,11 @@ export default {
delBtn: false, delBtn: false,
editBtn: false, editBtn: false,
addBtn: false, addBtn: false,
editBtnText: "修改", editBtnText: '修改',
viewBtnIcon: " ", viewBtnIcon: ' ',
delBtnIcon: " ", delBtnIcon: ' ',
editBtnIcon: " ", editBtnIcon: ' ',
viewBtnText: "详情", viewBtnText: '详情',
labelWidth: 120, labelWidth: 120,
menuWidth: 120, menuWidth: 120,
dialogWidth: 1040, dialogWidth: 1040,
@ -100,49 +122,49 @@ export default {
columnSort: true, columnSort: true,
index: false, index: false,
showOverflowTooltip: true, showOverflowTooltip: true,
searchLabelPosition: "left", searchLabelPosition: 'left',
searchLabelPosition: "left", searchLabelPosition: 'left',
searchGutter: 24, searchGutter: 24,
searchSpan: 6, searchSpan: 6,
menuAlign: "center", menuAlign: 'center',
gridBtn: false, gridBtn: false,
searchMenuPosition: "right", searchMenuPosition: 'right',
addBtnIcon: " ", addBtnIcon: ' ',
viewBtnIcon: " ", viewBtnIcon: ' ',
delBtnIcon: " ", delBtnIcon: ' ',
editBtnIcon: " ", editBtnIcon: ' ',
align: "center", align: 'center',
column: [ column: [
{ {
label: "工艺能力", label: '工艺能力',
prop: "craftAbilityId", prop: 'craftAbilityId',
type:"select", type: 'select',
sortable: false, sortable: 'custom',
filter: true, filter: true,
span: 12, span: 12,
search: true, search: true,
filterable: true, filterable: true,
dicUrl:"/blade-desk/BA/craftAbility/findList", dicUrl: '/blade-desk/BA/craftAbility/findList',
props: { props: {
label:"caName", label: 'caName',
value:"id" value: 'id',
}, },
width: 200, width: 200,
}, },
{ {
label: "零件号", label: '零件号',
prop: "partCode", prop: 'partCode',
sortable: false, sortable: 'custom',
filter: true, filter: true,
span: 12, span: 12,
width: 150, width: 150,
search: true, search: true,
}, },
{ {
label: "生产标识", label: '生产标识',
prop: "prodMark", prop: 'prodMark',
// type:"select", // type:"select",
sortable: false, sortable: 'custom',
filter: true, filter: true,
span: 12, span: 12,
width: 150, width: 150,
@ -155,9 +177,9 @@ export default {
// } // }
}, },
{ {
label: "单件面积上下限(dm²)", label: '单件面积上下限(dm²)',
prop: "singleArea", prop: 'singleArea',
sortable: false, sortable: 'custom',
filter: true, filter: true,
span: 12, span: 12,
width: 200, width: 200,
@ -165,9 +187,9 @@ export default {
multiple: true, multiple: true,
}, },
{ {
label: "单批面积上下限(dm²)", label: '单批面积上下限(dm²)',
prop: "batchArea", prop: 'batchArea',
sortable: false, sortable: 'custom',
filter: true, filter: true,
width: 200, width: 200,
span: 12, span: 12,
@ -175,122 +197,130 @@ export default {
multiple: true, multiple: true,
}, },
{ {
label: "限制类型", label: '限制类型',
prop: "limitType", prop: 'limitType',
type:"select", type: 'select',
sortable: false, sortable: 'custom',
filter: true, filter: true,
span: 12, span: 12,
search: true, search: true,
width: 200, width: 200,
dicUrl: '/api/blade-system/dict/dictionary?code=AssignLimit', dicUrl: '/api/blade-system/dict/dictionary?code=AssignLimit',
props: { props: {
label:"dictValue", label: 'dictValue',
value:"dictKey" value: 'dictKey',
} },
// dicData:[ // dicData:[
// {label:"",value:1} // {label:"",value:1}
// ] // ]
}, },
{ {
label: "指定类型", label: '指定类型',
prop: "pointType", prop: 'pointType',
type:"select", type: 'select',
sortable: false, sortable: 'custom',
filter: true, filter: true,
span: 12, span: 12,
search: true, search: true,
width: 200, width: 200,
dicUrl: '/api/blade-system/dict/dictionary?code=AssignPoint', dicUrl: '/api/blade-system/dict/dictionary?code=AssignPoint',
props: { props: {
label:"dictValue", label: 'dictValue',
value:"dictKey" value: 'dictKey',
} },
// dicData:[ // dicData:[
// {label:"",value:1}, // {label:"",value:1},
// {label:"",value:2}, // {label:"",value:2},
// ] // ]
}, },
{ {
label: "外协厂商", label: '外协厂商',
prop: "oemId", prop: 'oemId',
type: 'select', type: 'select',
sortable: false, sortable: 'custom',
filter: true, filter: true,
span: 12, span: 12,
search: true, search: true,
width: 200, width: 200,
dicUrl:"/api/blade-desk/BA/Oem/listForSelect", dicUrl: '/api/blade-desk/BA/Oem/listForSelect',
props: { props: {
label:"ocName", label: 'ocName',
value:"id" value: 'id',
} },
}, },
{ {
label: "作业中心", label: '作业中心',
prop: "centerId", prop: 'centerId',
type: 'select', type: 'select',
sortable: false, sortable: 'custom',
filter: true, filter: true,
span: 12, span: 12,
search: true, search: true,
width: 200, width: 200,
dicUrl:"/api/blade-desk/BA/WorkCenter/listForSelect", dicUrl: '/api/blade-desk/BA/WorkCenter/listForSelect',
props: { props: {
label:"wcName", label: 'wcName',
value:"id" value: 'id',
} },
}, },
{ {
label: "备注", label: '备注',
prop: "remark", prop: 'remark',
sortable: false, sortable: 'custom',
filter: true, filter: true,
width: 150, width: 150,
span: 12, span: 12,
search: false, search: false,
}, },
{ {
label: "维护人", label: '维护人',
prop: "createUserName", prop: 'createUserName',
sortable: false, sortable: 'custom',
filter: true, filter: true,
width: 150, width: 150,
span: 12, span: 12,
search: false, search: false,
}, },
{ {
label: "维护时间", label: '维护时间',
prop: "updateTime", prop: 'updateTime',
sortable: false, sortable: 'custom',
width: 200, width: 200,
filter: true, filter: true,
span: 12, span: 12,
search: false, search: false,
}, },
] ],
}, },
checkRow:{} checkRow: {},
} };
},
computed: {
...mapGetters(['permission']),
permissionList() {
return {
addBtn: this.validData(this.permission.ruleMaintenance_add, false),
editBtn: this.validData(this.permission.ruleMaintenance_edit, false),
delBtn: this.validData(this.permission.ruleMaintenance_del, false),
};
}, },
mounted() {
}, },
methods: { methods: {
handleImport() { handleImport() {
this.isShowImport = true this.isShowImport = true;
}, },
handleAdd() { handleAdd() {
this.checkRow = {} this.checkRow = {};
this.moldAddMore = true this.moldAddMore = true;
this.showDialog = true this.showDialog = true;
}, },
selectionChange(list) { selectionChange(list) {
this.selectionList = list this.selectionList = list;
}, },
handleDelete() { handleDelete() {
if (this.selectionList.length == 0) { if (this.selectionList.length == 0) {
this.$message.error('请至少选择一条数据') this.$message.error('请至少选择一条数据');
return return;
} }
this.$confirm('确定删除数据吗?', { this.$confirm('确定删除数据吗?', {
confirmButtonText: '确定', confirmButtonText: '确定',
@ -298,17 +328,17 @@ export default {
type: 'warning', type: 'warning',
}).then(() => { }).then(() => {
deleteRules({ deleteRules({
ids:this.selectionList.map(item => item.id).join(',') ids: this.selectionList.map(item => item.id).join(','),
}).then(res => { }).then(res => {
this.$message.success('删除成功') this.$message.success('删除成功');
this.onLoad() this.onLoad();
}) });
}) });
}, },
editRow(row) { editRow(row) {
this.moldAddMore = false this.moldAddMore = false;
this.checkRow = row this.checkRow = row;
this.showDialog = true this.showDialog = true;
}, },
rowDel(row) { rowDel(row) {
this.$confirm('确定删除数据吗?', { this.$confirm('确定删除数据吗?', {
@ -317,53 +347,63 @@ export default {
type: 'warning', type: 'warning',
}).then(() => { }).then(() => {
deleteRules({ deleteRules({
ids:row.id ids: row.id,
}).then(res => { }).then(res => {
this.$message.success('删除成功') this.$message.success('删除成功');
this.onLoad() this.onLoad();
}) });
}) });
}, },
closeDialog(val) { closeDialog(val) {
this.showDialog = false this.showDialog = false;
this.isShowImport = false this.isShowImport = false;
if (val) { if (val) {
this.onLoad() this.onLoad();
} }
}, },
searchChange(params, done) { searchChange(params, done) {
this.query = params; this.query = params;
this.page.currentPage = 1 this.page.currentPage = 1;
this.onLoad() this.onLoad();
done() done();
}, },
searchReset() { searchReset() {
this.query = {} this.query = {};
this.onLoad() this.onLoad();
}, },
currentChange(currentPage) { currentChange(currentPage) {
this.page.currentPage = currentPage this.page.currentPage = currentPage;
}, },
sizeChange(pageSize) { sizeChange(pageSize) {
this.page.pageSize = pageSize this.page.pageSize = pageSize;
}, },
refreshChange() { refreshChange() {
this.onLoad() this.onLoad();
},
//
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.onLoad(this.page, this.query);
}, },
onLoad() { onLoad() {
getList({ getList({
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;
}) });
} },
} },
} };
</script> </script>
<style> <style>
</style> </style>
Loading…
Cancel
Save