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.
266 lines
8.6 KiB
266 lines
8.6 KiB
<template> |
|
<div> |
|
<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="primary" icon="el-icon-plus" @click="addEdit">新增 |
|
</el-button> |
|
<el-button type="danger" icon="el-icon-delete" @click="handleDelete()">删除 |
|
</el-button> |
|
</template> |
|
<template #menu-right> |
|
|
|
</template> |
|
<template #menu="scope"> |
|
<el-button type="text" @click="editFn(scope.row)">编辑 |
|
</el-button> |
|
<el-button type="text" @click="handleDelete(scope.row)">删除 |
|
</el-button> |
|
</template> |
|
<template #produceTsTarget="scope"> |
|
|
|
</template> |
|
|
|
</avue-crud> |
|
<addEditDosing v-if="isOpen" :showDialog="isOpen" |
|
:formulaType="2" |
|
:checkRow="checkRow" @closeDialog="closeDialog"></addEditDosing> |
|
<workCenterSet v-if="isWorkOpen" :showDialog="isWorkOpen" @closeDialog="closeDialog"></workCenterSet> |
|
</div> |
|
</template> |
|
<script> |
|
import addEditDosing from './components/addEditDosing.vue' |
|
import workCenterSet from './components/workCenterSet.vue' |
|
import {getList,deleteFormula} from "@/api/basicData/calculationFormula" |
|
export default { |
|
components: { |
|
addEditDosing, |
|
workCenterSet |
|
}, |
|
data() { |
|
return { |
|
selectionList: [], |
|
loading: false, |
|
query: {}, |
|
option: { |
|
height: 'auto', |
|
calcHeight: 32, |
|
tip: false, |
|
size: 'medium', |
|
simplePage: true, |
|
searchShow: true, |
|
searchMenuSpan: 18, |
|
searchIcon: true, |
|
searchIndex: 3, |
|
tree: false, |
|
border: true, |
|
index: false, |
|
selection: true, |
|
viewBtn: false, |
|
delBtn: false, |
|
addBtn: false, |
|
editBtn: false, |
|
editBtnText: '修改', |
|
viewBtnIcon: ' ', |
|
delBtnIcon: ' ', |
|
editBtnIcon: ' ', |
|
viewBtnText: '详情', |
|
labelWidth: 120, |
|
menuWidth: 100, |
|
dialogWidth: 640, |
|
dialogClickModal: false, |
|
searchEnter: true, |
|
excelBtn: false, |
|
filterBtn: true, |
|
searchShowBtn: false, |
|
columnSort: true, |
|
excelBtn: true, |
|
columnSort: true, |
|
showOverflowTooltip: true, |
|
searchLabelPosition:'left', |
|
searchLabelPosition:'left', |
|
searchGutter:24, |
|
searchSpan:6, |
|
menuAlign: 'left', |
|
gridBtn:false, |
|
searchMenuPosition:'right', |
|
addBtnIcon: ' ', |
|
viewBtnIcon: ' ', |
|
delBtnIcon: ' ', |
|
editBtnIcon: ' ', |
|
align: 'center', |
|
|
|
column: [ |
|
{ |
|
label: '公式名称', |
|
prop: 'name', |
|
sortable: true, |
|
filter: true, |
|
span: 24, |
|
search: true, |
|
}, |
|
{ |
|
label: '公式内容', |
|
prop: 'content', |
|
sortable: true, |
|
filter: true, |
|
span: 24, |
|
search: false, |
|
}, |
|
{ |
|
label: '操作人', |
|
prop: 'subName', |
|
sortable: true, |
|
filter: true, |
|
span: 24, |
|
search: false, |
|
display: true, |
|
}, |
|
{ |
|
label: '更新时间', |
|
prop: 'subName', |
|
sortable: true, |
|
filter: true, |
|
span: 24, |
|
search: false, |
|
display: true, |
|
}, |
|
] |
|
}, |
|
form: { |
|
|
|
}, |
|
page: { |
|
pageSize: 10, |
|
currentPage: 1, |
|
total: 0, |
|
}, |
|
isOpen: false, |
|
isWorkOpen: false, |
|
checkRow:{} |
|
} |
|
}, |
|
methods: { |
|
addEdit() { |
|
this.checkRow = {} |
|
this.isOpen = true |
|
}, |
|
editFn(row) { |
|
this.isOpen = true |
|
this.checkRow = row |
|
}, |
|
closeDialog(val) { |
|
this.isOpen = false |
|
this.isWorkOpen = false |
|
if(val) { |
|
this.onLoad() |
|
} |
|
}, |
|
maintenanceClick() { |
|
// this.$refs.myTable.fullValidate((errMap) => { |
|
// if (errMap) { |
|
// return; |
|
// } |
|
// const dataList = this.$refs.myTable.getRecordset().updateRecords; |
|
// this.$ajax |
|
// .post('oemMerits/maintenance', { |
|
// dataList, |
|
// status: 2, |
|
// type: 'produce' |
|
// }) |
|
// .then((res) => { |
|
// if (res.code === 0) { |
|
// this.$message.success('维护成功'); |
|
// this.queryTable(); |
|
// } |
|
// }); |
|
// }); |
|
}, |
|
proofreadClick() { |
|
// const dataList = this.$refs.myTable.getTableData().tableData; |
|
// this.$ajax |
|
// .post('oemMerits/proofread', { |
|
// dataList, |
|
// status: 3, |
|
// type: 'produce' |
|
// }) |
|
// .then((res) => { |
|
// if (res.code === 0) { |
|
// this.$message.success('校对成功'); |
|
// this.queryTable(); |
|
// } |
|
// }); |
|
}, |
|
handleDelete(row) { |
|
if (!row && this.selectionList.length === 0) { |
|
this.$message.error('请选择至少一条数据'); |
|
return; |
|
} |
|
this.$confirm('确定将选择数据删除?', { |
|
confirmButtonText: '确定', |
|
cancelButtonText: '取消', |
|
type: 'warning', |
|
}).then(() => { |
|
if(row){ |
|
deleteFormula({ |
|
ids:row.id |
|
}).then(res =>{ |
|
if(res.data.code == 200){ |
|
this.$message.success('删除成功') |
|
this.onLoad() |
|
} |
|
}) |
|
}else{ |
|
deleteFormula({ |
|
ids:this.selectionList.map(item => item.id).join(',') |
|
}).then(res =>{ |
|
if(res.data.code == 200){ |
|
this.$message.success('删除成功') |
|
this.onLoad() |
|
} |
|
}) |
|
} |
|
}) |
|
}, |
|
searchChange(params, done){ |
|
this.query = params; |
|
this.page.currentPage = 1; |
|
this.onLoad() |
|
done(); |
|
}, |
|
searchReset(){ |
|
this.query = {} |
|
this.onLoad() |
|
}, |
|
currentChange(currentPage){ |
|
this.page.currentPage = currentPage; |
|
}, |
|
sizeChange(pageSize){ |
|
this.page.pageSize = pageSize; |
|
}, |
|
refreshChange(){ |
|
this.onLoad() |
|
}, |
|
// 多选 |
|
selectionChange(list) { |
|
this.selectionList = list; |
|
}, |
|
onLoad() { |
|
this.loading = true |
|
getList({ |
|
current:this.page.currentPage, |
|
size:this.page.pageSize, |
|
formulaType:2, |
|
...this.query |
|
}).then(res =>{ |
|
this.data = res.data.data.records |
|
this.page.total = res.data.data.total |
|
this.loading = false |
|
}) |
|
} |
|
} |
|
} |
|
</script> |
|
<style lang="scss" scoped></style> |