parent
1c7a946b4f
commit
5a15020e04
13 changed files with 687 additions and 184 deletions
@ -0,0 +1,22 @@ |
||||
import request from '@/axios'; |
||||
//列表接口
|
||||
export const getList = (current, size, params) => { |
||||
return request({ |
||||
url: '/blade-desk/BA/UrgentPart/page', |
||||
method: 'get', |
||||
params: { |
||||
...params, |
||||
current, |
||||
size, |
||||
}, |
||||
}); |
||||
}; |
||||
|
||||
// 作废
|
||||
export const voidRecords = (data) => { |
||||
return request({ |
||||
url: '/blade-desk/BA/UrgentPart/voidRecords', |
||||
method: 'post', |
||||
data: data, |
||||
}); |
||||
}; |
||||
@ -0,0 +1,307 @@ |
||||
<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 #menu-left> |
||||
<el-button type="danger" @click="handleOut">作废</el-button> |
||||
</template> |
||||
<template #menu-right> |
||||
<el-button type="primary" @click="handleImport">导入 </el-button> |
||||
</template> |
||||
<template #menu="{ row }"> </template> |
||||
</avue-crud> |
||||
<!-- 导入 --> |
||||
<basic-import |
||||
v-if="isShowImport" |
||||
title="导入" |
||||
:isShow="isShowImport" |
||||
templateUrl="/blade-desk/BA/UrgentPart/downloadExcelTemplate" |
||||
templateName="急件维护模板.xls" |
||||
importUrl="/blade-desk/BA/UrgentPart/importExcel" |
||||
@closeDialog="closeDialog" |
||||
></basic-import> |
||||
</basic-container> |
||||
</template> |
||||
|
||||
<script> |
||||
import { getList, voidRecords } from '@/api/orderManagement/urgentUphold'; |
||||
import basicImport from '@/components/basic-import/main.vue'; |
||||
|
||||
export default { |
||||
components: {basicImport}, |
||||
data() { |
||||
return { |
||||
form: {}, |
||||
selectionList: [], |
||||
query: {}, |
||||
loading: false, |
||||
page: { |
||||
pageSize: 10, |
||||
currentPage: 1, |
||||
total: 0, |
||||
}, |
||||
option: { |
||||
columnSort: true, |
||||
tip: false, |
||||
height: 'auto', |
||||
calcHeight: 32, |
||||
simplePage: false, |
||||
searchShow: true, |
||||
searchMenuSpan: 6, |
||||
searchIcon: true, |
||||
searchIndex: 3, |
||||
tree: false, |
||||
border: true, |
||||
index: false, |
||||
selection: true, |
||||
addBtn: false, |
||||
editBtn: false, |
||||
viewBtn: false, |
||||
delBtn: false, |
||||
editBtnText: '修改', |
||||
labelWidth: 120, |
||||
menuWidth: 80, |
||||
dialogWidth: 900, |
||||
dialogClickModal: false, |
||||
searchEnter: true, |
||||
excelBtn: false, |
||||
filterBtn: true, |
||||
searchShowBtn: false, |
||||
excelBtn: true, |
||||
showOverflowTooltip: true, |
||||
addBtnIcon: ' ', |
||||
viewBtnIcon: ' ', |
||||
delBtnIcon: ' ', |
||||
editBtnIcon: ' ', |
||||
gridBtn: false, |
||||
searchLabelPosition: 'left', |
||||
searchGutter: 24, |
||||
searchSpan: 6, |
||||
menuAlign: 'left', |
||||
gridBtn: false, |
||||
searchMenuPosition: 'right', |
||||
searchLabelWidth: 'auto', |
||||
align: 'center', |
||||
menu: false, |
||||
column: [ |
||||
{ |
||||
label: '计划单号', |
||||
prop: 'planNo', |
||||
search: true, |
||||
sortable: true, |
||||
span: 12, |
||||
}, |
||||
{ |
||||
label: '零件号', |
||||
prop: 'partCode', |
||||
search: true, |
||||
sortable: true, |
||||
span: 12, |
||||
}, |
||||
{ |
||||
label: '批次号', |
||||
prop: 'batchNo', |
||||
search: true, |
||||
sortable: true, |
||||
span: 12, |
||||
}, |
||||
{ |
||||
label: '需求交期', |
||||
prop: 'requireDate', |
||||
search: true, |
||||
sortable: true, |
||||
span: 12, |
||||
type: 'date', // 启用日期类型 |
||||
format: 'YYYY-MM-DD', // 展示格式 |
||||
valueFormat: 'YYYY-MM-DD', // 如果作为搜索条件传给后端的格式也需要一致 |
||||
}, |
||||
{ |
||||
label: '到期日期', |
||||
prop: 'expireDate', |
||||
search: false, |
||||
sortable: true, |
||||
span: 12, |
||||
type: 'date', // 启用日期类型 |
||||
format: 'YYYY-MM-DD', // 展示格式 |
||||
valueFormat: 'YYYY-MM-DD', // 如果作为搜索条件传给后端的格式也需要一致 |
||||
}, |
||||
{ |
||||
label: '状态', |
||||
prop: 'status', |
||||
search: true, |
||||
sortable: true, |
||||
span: 12, |
||||
type: 'select', |
||||
dicData: [ |
||||
{ label: '生效', value: 0 }, |
||||
{ label: '作废', value: 1 }, |
||||
], |
||||
}, |
||||
{ |
||||
label: '维护人', |
||||
prop: 'updateUserName', |
||||
search: false, |
||||
sortable: true, |
||||
span: 12, |
||||
}, |
||||
{ |
||||
label: '维护时间', |
||||
prop: 'updateTime', |
||||
search: false, |
||||
sortable: true, |
||||
span: 12, |
||||
}, |
||||
], |
||||
}, |
||||
|
||||
data: [], |
||||
isShowImport: false, |
||||
}; |
||||
}, |
||||
methods: { |
||||
// 点击导入按钮 |
||||
handleImport() { |
||||
this.isShowImport = true; |
||||
}, |
||||
closeDialog(val) { |
||||
this.isShowImport = false; |
||||
this.onLoad(this.page); |
||||
|
||||
}, |
||||
// 作废 |
||||
handleOut() { |
||||
if (this.selectionList.length == 0) { |
||||
this.$message({ |
||||
type: 'warning', |
||||
message: '请选择数据!', |
||||
}); |
||||
return; |
||||
} |
||||
const validRecords = this.selectionList.filter(item => item.status == 0); |
||||
if (validRecords.length === 0) { |
||||
this.$message.warning('请选择生效中的数据!'); |
||||
return; |
||||
} |
||||
this.$confirm('确定将选择数据状态改成作废?', { |
||||
confirmButtonText: '确定', |
||||
cancelButtonText: '取消', |
||||
type: 'warning', |
||||
}).then(() => { |
||||
let ids = validRecords.map(item => item.id); |
||||
voidRecords(ids).then(res => { |
||||
this.onLoad(this.page); |
||||
this.$message({ |
||||
type: 'success', |
||||
message: '操作成功!', |
||||
}); |
||||
}); |
||||
|
||||
// return removePersonAbility(row.id); |
||||
}); |
||||
}, |
||||
rowSave(row, done, loading) { |
||||
// addPersonAbility(row).then( |
||||
// () => { |
||||
// this.onLoad(this.page); |
||||
// this.$message({ |
||||
// type: 'success', |
||||
// message: '操作成功!', |
||||
// }); |
||||
// done(); |
||||
// }, |
||||
// error => { |
||||
// window.console.log(error); |
||||
// loading(); |
||||
// } |
||||
// ); |
||||
}, |
||||
rowUpdate(row, index, done, loading) { |
||||
// updatePersonAbility(row).then( |
||||
// () => { |
||||
// this.onLoad(this.page); |
||||
// this.$message({ |
||||
// type: 'success', |
||||
// message: '操作成功!', |
||||
// }); |
||||
// done(); |
||||
// }, |
||||
// error => { |
||||
// window.console.log(error); |
||||
// loading(); |
||||
// } |
||||
// ); |
||||
}, |
||||
rowDel(row) { |
||||
this.$confirm('确定将选择数据删除?', { |
||||
confirmButtonText: '确定', |
||||
cancelButtonText: '取消', |
||||
type: 'warning', |
||||
}) |
||||
.then(() => { |
||||
// return removePersonAbility(row.id); |
||||
}) |
||||
.then(() => { |
||||
this.onLoad(this.page); |
||||
this.$message({ |
||||
type: 'success', |
||||
message: '操作成功!', |
||||
}); |
||||
}); |
||||
}, |
||||
|
||||
searchReset() { |
||||
this.query = {}; |
||||
this.onLoad(this.page); |
||||
}, |
||||
searchChange(params, done) { |
||||
this.query = params; |
||||
this.page.currentPage = 1; |
||||
this.onLoad(this.page, params); |
||||
done(); |
||||
}, |
||||
selectionChange(list) { |
||||
this.selectionList = list; |
||||
}, |
||||
selectionClear() { |
||||
this.selectionList = []; |
||||
this.$refs.crud.toggleSelection(); |
||||
}, |
||||
|
||||
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; |
||||
getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => { |
||||
this.data = res.data.data.records; |
||||
this.loading = false; |
||||
this.page.total = res.data.data.total; |
||||
this.selectionClear(); |
||||
}); |
||||
}, |
||||
}, |
||||
mounted() {}, |
||||
}; |
||||
</script> |
||||
d |
||||
Loading…
Reference in new issue