You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
526 lines
18 KiB
526 lines
18 KiB
<template> |
|
<basic-container> |
|
<avue-crud :option="option" :table-loading="loading" :data="data" v-model="form" v-model:page="page" ref="crud" |
|
@row-del="rowDel" @search-change="searchChange" @search-reset="searchReset" |
|
@selection-change="selectionChange" @current-change="currentChange" @size-change="sizeChange" |
|
@refresh-change="refreshChange" @on-load="onLoad"> |
|
<template #bsWorkType.wtName="scope"> |
|
<span> |
|
{{ scope.row.bsWorkType ? scope.row.bsWorkType.wtName : '-' }} |
|
</span> |
|
</template> |
|
<template #name="{ row }"> |
|
<i :class="row.source" style="margin-right: 5px" /> |
|
<span>{{ row.name }}</span> |
|
</template> |
|
<template #source="{ row }"> |
|
<div style="text-align: center"> |
|
<i :class="row.source" /> |
|
</div> |
|
</template> |
|
</avue-crud> |
|
</basic-container> |
|
</template> |
|
<script> |
|
import { getLazyList, remove, update, add, getMenu } from '@/api/system/menu'; |
|
|
|
import { mapGetters } from 'vuex'; |
|
import { getQueryAllCaList, getQueryAllCaDeatils, getQueryAllCaSave, getQueryAllCaDel } from '@/api/processManagement/processCapability'; |
|
import { getDictionary } from '@/api/system/dict'; |
|
|
|
export default { |
|
data() { |
|
return { |
|
form: {}, |
|
query: {}, |
|
loading: true, |
|
selectionList: [], |
|
parentId: '', |
|
page: { |
|
pageSize: 10, |
|
currentPage: 1, |
|
total: 0, |
|
}, |
|
option: { |
|
height: 'auto', |
|
calcHeight: 32, |
|
tip: false, |
|
size: 'medium', |
|
simplePage: true, |
|
searchShow: true, |
|
searchMenuSpan: 6, |
|
searchIcon: true, |
|
searchIndex: 3, |
|
tree: false, |
|
border: true, |
|
index: true, |
|
selection: false, |
|
viewBtn: false, |
|
delBtn: true, |
|
editBtnText: '修改', |
|
addBtnIcon: ' ', |
|
viewBtnIcon: ' ', |
|
delBtnIcon: ' ', |
|
editBtnIcon: ' ', |
|
viewBtnText: '详情', |
|
labelWidth: 120, |
|
menuWidth: 140, |
|
dialogWidth: 1200, |
|
dialogClickModal: false, |
|
searchEnter: true, |
|
excelBtn: false, |
|
filterBtn: true, |
|
searchShowBtn: false, |
|
columnSort: true, |
|
excelBtn: true, |
|
columnSort: true, |
|
showOverflowTooltip: true, |
|
menuAlign: 'left', |
|
gridBtn:false, |
|
searchLabelPosition:'left', |
|
searchGutter:24, |
|
searchSpan:6, |
|
searchMenuPosition:'right', |
|
column: [ |
|
{ |
|
label: '模板编码', |
|
prop: 'pmCode', |
|
search: true, |
|
sortable: true, |
|
overHidden: true, |
|
width: 120, |
|
headerAlign: 'center', |
|
align: 'left', |
|
rules: [ |
|
{ |
|
required: true, |
|
message: '请输入名称分类', |
|
trigger: 'blur', |
|
}, |
|
], |
|
}, |
|
{ |
|
label: '模板名称', |
|
prop: 'pmName', |
|
sortable: true, |
|
search: true, |
|
width: 120, |
|
headerAlign: 'center', |
|
align: 'left', |
|
rules: [ |
|
{ |
|
required: false, |
|
message: '请选择镀种分类', |
|
trigger: 'click', |
|
}, |
|
], |
|
}, |
|
{ |
|
label: '作业中心', |
|
prop: 'bsWorkCenter.wcName', |
|
sortable: true, |
|
search: true, |
|
width: 120, |
|
headerAlign: 'center', |
|
align: 'left', |
|
rules: [ |
|
{ |
|
required: false, |
|
message: '请选择镀种分类', |
|
trigger: 'click', |
|
}, |
|
], |
|
}, |
|
{ |
|
label: '镀种分类', |
|
prop: 'bsBasicClass.name', |
|
sortable: true, |
|
search: true, |
|
width: 120, |
|
headerAlign: 'center', |
|
align: 'center', |
|
rules: [ |
|
{ |
|
required: false, |
|
message: '请选择镀种分类', |
|
trigger: 'click', |
|
}, |
|
], |
|
}, |
|
{ |
|
label: '优先级', |
|
prop: 'priority', |
|
sortable: true, |
|
search: false, |
|
width: 120, |
|
headerAlign: 'center', |
|
align: 'center', |
|
rules: [ |
|
{ |
|
required: false, |
|
message: '请选择镀种分类', |
|
trigger: 'click', |
|
}, |
|
], |
|
}, |
|
{ |
|
label: '工序数', |
|
prop: 'proQuantity', |
|
sortable: true, |
|
search: true, |
|
width: 120, |
|
headerAlign: 'center', |
|
align: 'center', |
|
rules: [ |
|
{ |
|
required: false, |
|
message: '请选择镀种分类', |
|
trigger: 'click', |
|
}, |
|
], |
|
}, |
|
{ |
|
label: '修改人', |
|
prop: 'updateMan.userName', |
|
sortable: true, |
|
search: true, |
|
width: 120, |
|
headerAlign: 'center', |
|
align: 'center', |
|
rules: [ |
|
{ |
|
required: false, |
|
message: '请选择镀种分类', |
|
trigger: 'click', |
|
}, |
|
], |
|
}, |
|
{ |
|
label: '修改时间', |
|
prop: 'updateTime', |
|
sortable: true, |
|
search: true, |
|
width: 120, |
|
display: false, |
|
headerAlign: 'center', |
|
align: 'center', |
|
rules: [ |
|
{ |
|
required: false, |
|
message: '请选择镀种分类', |
|
trigger: 'click', |
|
}, |
|
], |
|
}, |
|
{ |
|
label: '状态', |
|
prop: 'pmStatusTitle', |
|
sortable: true, |
|
search: true, |
|
headerAlign: 'center', |
|
align: 'center', |
|
rules: [ |
|
{ |
|
required: false, |
|
message: '请选择镀种分类', |
|
trigger: 'click', |
|
}, |
|
], |
|
}, |
|
{ |
|
label: '备注', |
|
prop: 'memo', |
|
sortable: true, |
|
search: false, |
|
width: 120, |
|
headerAlign: 'center', |
|
align: 'left', |
|
rules: [ |
|
{ |
|
required: false, |
|
message: '请输入备注', |
|
trigger: 'click', |
|
}, |
|
], |
|
}, |
|
], |
|
}, |
|
data: [], |
|
|
|
|
|
} |
|
}, |
|
computed: { |
|
...mapGetters(['userInfo', 'permission']), |
|
permissionList() { |
|
return { |
|
addBtn: this.validData(this.permission.menu_add, false), |
|
viewBtn: this.validData(this.permission.menu_view, false), |
|
delBtn: this.validData(this.permission.menu_delete, false), |
|
editBtn: this.validData(this.permission.menu_edit, false), |
|
}; |
|
}, |
|
ids() { |
|
let ids = []; |
|
this.selectionList.forEach(ele => { |
|
ids.push(ele.id); |
|
}); |
|
return ids.join(','); |
|
}, |
|
}, |
|
methods: { |
|
initData() { |
|
// getMenuTree().then(res => { |
|
// const column = this.findObject(this.option.column, 'parentId'); |
|
// column.dicData = res.data.data; |
|
// }); |
|
}, |
|
handleAdd(row) { |
|
this.parentId = row.id; |
|
const column = this.findObject(this.option.column, 'parentId'); |
|
column.value = row.id; |
|
column.addDisabled = true; |
|
this.$refs.crud.rowAdd(); |
|
}, |
|
// 保存 |
|
rowSave(row, done, loading) { |
|
// add(row).then( |
|
// res => { |
|
// // 获取新增数据的相关字段 |
|
// const data = res.data.data; |
|
// row.id = data.id; |
|
// this.$message({ |
|
// type: 'success', |
|
// message: '操作成功!', |
|
// }); |
|
// // 数据回调进行刷新 |
|
// done(row); |
|
// }, |
|
// error => { |
|
// window.console.log(error); |
|
// loading(); |
|
// } |
|
// ); |
|
}, |
|
// 修改 |
|
rowUpdate(row, index, done, loading) { |
|
// update(row).then( |
|
// () => { |
|
// this.$message({ |
|
// type: 'success', |
|
// message: '操作成功!', |
|
// }); |
|
// // 数据回调进行刷新 |
|
// done(row); |
|
// }, |
|
// error => { |
|
// window.console.log(error); |
|
// loading(); |
|
// } |
|
// ); |
|
}, |
|
rowDel(row, index, done) { |
|
this.$confirm('确定将选择数据删除?', { |
|
confirmButtonText: '确定', |
|
cancelButtonText: '取消', |
|
type: 'warning', |
|
}) |
|
.then(() => { |
|
return remove(row.id); |
|
}) |
|
.then(() => { |
|
this.$message({ |
|
type: 'success', |
|
message: '操作成功!', |
|
}); |
|
// 数据回调进行刷新 |
|
done(row); |
|
}); |
|
}, |
|
// 重置 |
|
searchReset() { |
|
this.query = {}; |
|
this.parentId = 0; |
|
this.onLoad(this.page); |
|
}, |
|
// 搜索 |
|
searchChange(params, done) { |
|
this.query = params; |
|
this.parentId = ''; |
|
this.page.currentPage = 1; |
|
this.onLoad(this.page, params); |
|
done(); |
|
}, |
|
// 选中表格数据 |
|
selectionChange(list) { |
|
this.selectionList = list; |
|
}, |
|
// |
|
selectionClear() { |
|
this.selectionList = []; |
|
this.$refs.crud.toggleSelection(); |
|
}, |
|
// 打开弹框 前操作 打开表单前会执行beforeOpen方法 |
|
beforeOpen(done, type) { |
|
if (['add', 'edit'].includes(type)) { |
|
this.initData(); |
|
} |
|
if (['edit', 'view'].includes(type)) { |
|
getMenu(this.form.id).then(res => { |
|
this.form = Object.assign(res.data.data, { |
|
hasChildren: this.form.hasChildren, |
|
}); |
|
if (this.form.parentId === '0') { |
|
this.form.parentId = ''; |
|
} |
|
}); |
|
} |
|
done(); |
|
}, |
|
// 关闭 弹框 关闭表单前会执行beforeClose方法, |
|
beforeClose(done) { |
|
this.parentId = ''; |
|
const column = this.findObject(this.option.column, 'parentId'); |
|
column.value = ''; |
|
column.addDisabled = false; |
|
done(); |
|
}, |
|
// 切换 页码 |
|
currentChange(currentPage) { |
|
this.page.currentPage = currentPage; |
|
}, |
|
// 切换页面 数量 |
|
sizeChange(pageSize) { |
|
this.page.pageSize = pageSize; |
|
}, |
|
|
|
refreshChange() { |
|
this.onLoad(this.page, this.query); |
|
}, |
|
// 加载页面数据 |
|
onLoad(page, params = {}) { |
|
this.loading = true; |
|
|
|
// getLazyList(this.parentId, Object.assign(params, this.query)).then(res => { |
|
// this.data = res.data.data; |
|
this.data = [ |
|
{ |
|
"bsBasicClass": { |
|
"bcId": 23, |
|
"code": "C类", |
|
"deleted": false, |
|
"keyValue": 23, |
|
"memo": "镀镍、锌镍、镀锡", |
|
"name": "C类", |
|
"type": 5, |
|
"updateTime": null |
|
}, |
|
"bsWorkCenter": { |
|
"wcCode": "010", |
|
"wcId": 202, |
|
"wcName": "玻璃烧结作业中心" |
|
}, |
|
"createMan": { |
|
"userId": 541, |
|
"userName": "崔殿龙" |
|
}, |
|
"keyValue": 141, |
|
"memo": null, |
|
"pmCode": "玻璃烧结001", |
|
"pmId": 141, |
|
"pmName": "玻璃烧结001", |
|
"pmStatus": 0, |
|
"pmStatusTitle": "正常", |
|
"priority": 1, |
|
"proQuantity": 5, |
|
"quGrText": null, |
|
"qualityGrade": null, |
|
"updateMan": { |
|
"userId": 541, |
|
"userName": "崔殿龙" |
|
}, |
|
"updateTime": "2024-01-19" |
|
}, |
|
{ |
|
"bsBasicClass": { |
|
"bcId": 21, |
|
"code": "A1", |
|
"deleted": false, |
|
"keyValue": 21, |
|
"memo": "镀金", |
|
"name": "A类", |
|
"type": 5, |
|
"updateTime": null |
|
}, |
|
"bsWorkCenter": { |
|
"wcCode": "001", |
|
"wcId": 81, |
|
"wcName": "化学镀镍作业中心" |
|
}, |
|
"createMan": { |
|
"userId": 541, |
|
"userName": "崔殿龙" |
|
}, |
|
"keyValue": 123, |
|
"memo": null, |
|
"pmCode": "32", |
|
"pmId": 123, |
|
"pmName": "32", |
|
"pmStatus": 0, |
|
"pmStatusTitle": "正常", |
|
"priority": 1, |
|
"proQuantity": 6, |
|
"quGrText": null, |
|
"qualityGrade": "[]", |
|
"updateMan": { |
|
"userId": 541, |
|
"userName": "崔殿龙" |
|
}, |
|
"updateTime": "2023-07-03" |
|
}, |
|
{ |
|
"bsBasicClass": { |
|
"bcId": 21, |
|
"code": "A1", |
|
"deleted": false, |
|
"keyValue": 21, |
|
"memo": "镀金", |
|
"name": "A类", |
|
"type": 5, |
|
"updateTime": null |
|
}, |
|
"bsWorkCenter": { |
|
"wcCode": "001", |
|
"wcId": 81, |
|
"wcName": "化学镀镍作业中心" |
|
}, |
|
"createMan": { |
|
"userId": 541, |
|
"userName": "崔殿龙" |
|
}, |
|
"keyValue": 122, |
|
"memo": null, |
|
"pmCode": "12", |
|
"pmId": 122, |
|
"pmName": "12", |
|
"pmStatus": 0, |
|
"pmStatusTitle": "正常", |
|
"priority": 3, |
|
"proQuantity": 6, |
|
"quGrText": null, |
|
"qualityGrade": "[]", |
|
"updateMan": { |
|
"userId": 541, |
|
"userName": "崔殿龙" |
|
}, |
|
"updateTime": "2023-07-03" |
|
} |
|
] |
|
this.loading = false; |
|
this.page.total = this.data.length |
|
this.selectionClear(); |
|
// }); |
|
}, |
|
}, |
|
} |
|
</script> |