中航光电热表web
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.

248 lines
6.1 KiB

5 months ago
<template>
4 months ago
<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" @click="addFn()">新增</el-button>
4 months ago
<el-button type="danger" @click="handleDelete()">删除</el-button>
</template>
<template #menu-right> </template>
<template #menu="scope">
<el-button
type="primary"
text
plain
style="border: 0; background-color: transparent !important"
size="medium"
@click.stop="addFn(scope.row)"
4 months ago
>修改</el-button
>
</template>
</avue-crud>
<addAnnmualEditDialog
v-if="isOpen"
:showDialog="isOpen"
@closeDialog="closeDialog"
:row-id="rowId"
4 months ago
></addAnnmualEditDialog>
</div>
5 months ago
</template>
<script>
import { getYearData,deleteYear } from "@/api/qualityManagement/qualityObjective"
4 months ago
import addAnnmualEditDialog from './components/addAnnmualEditDialog.vue';
5 months ago
export default {
4 months ago
components: {
addAnnmualEditDialog,
},
data() {
return {
selectionList: [],
loading:false,
4 months ago
option: {
height: 'auto',
calcHeight: 32,
tip: false,
1 month ago
// size: 'medium',
4 months ago
simplePage: true,
searchShow: true,
searchMenuSpan: 18,
searchIcon: true,
searchIndex: 3,
tree: false,
border: true,
index: true,
selection: true,
editBtn: false,
viewBtn: false,
delBtn: false,
addBtn: false,
editBtnText: '修改',
viewBtnIcon: ' ',
delBtnIcon: ' ',
editBtnIcon: ' ',
viewBtnText: '详情',
labelWidth: 120,
menuWidth: 70,
dialogWidth: 640,
dialogClickModal: false,
searchEnter: true,
excelBtn: false,
filterBtn: true,
searchShowBtn: false,
columnSort: true,
excelBtn: true,
columnSort: true,
index: false,
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: 'indicatorType',
type:'select',
4 months ago
sortable: true,
filter: true,
span: 24,
search: true,
headerAlign: 'center',
// align: 'left',
dicUrl:'/api/blade-system/dict/dictionary?code=IndicatorYear-IndicatorType',
props:{
label:'dictValue',
value:'dictKey'
}
4 months ago
},
{
label: '年份',
prop: 'year',
4 months ago
sortable: true,
filter: true,
span: 24,
search: false,
},
{
label: '目标值',
prop: 'target',
4 months ago
sortable: true,
filter: true,
span: 24,
search: false,
},
{
label: '作业中心',
prop: 'workstationId',
// bind: 'bsWorkCenter.wcName',
4 months ago
sortable: true,
filter: true,
span: 24,
search: false,
headerAlign: 'center',
// align: 'left',
dicUrl: '/api/blade-desk/BA/WorkCenter/listForSelect',
4 months ago
props: {
label: 'wcName',
value: 'id',
},
},
{
label: '班组',
4 months ago
prop: 'teamName',
// bind: 'bsTeamSet.tsName',
4 months ago
sortable: true,
filter: true,
span: 24,
search: false,
headerAlign: 'center',
// align: 'left',
4 months ago
},
],
},
form: {
name: '',
},
page: {
pageSize: 10,
currentPage: 1,
total: 0,
},
isOpen: false,
rowId:'',
query:{}
4 months ago
};
},
methods: {
addFn(row) {
4 months ago
this.isOpen = true;
this.rowId = row ? row.id : ''
5 months ago
},
closeDialog(val) {
4 months ago
this.isOpen = false;
if(val){
this.onLoad()
}
},
searchChange(params, done) {
this.query = params;
this.page.currentPage = 1;
this.onLoad();
done();
},
searchReset(){
this.query = {}
this.onLoad()
},
refreshChange() {
this.onLoad();
},
currentChange(currentPage) {
this.page.currentPage = currentPage;
},
sizeChange(pageSize) {
this.page.pageSize = pageSize;
5 months ago
},
4 months ago
handleDelete() {
if (this.selectionList.length === 0) {
this.$message.warning('请选择至少一条数据');
return;
}
this.$confirm('确定将选择数据删除?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}).then(() => {
deleteYear({
ids:this.selectionList.map(item => item.id).join(',')
}).then(res =>{
if(res.data.code == 200){
this.$message.success('删除成功')
this.onLoad()
}
})
});
4 months ago
},
// 多选
selectionChange(list) {
this.selectionList = list;
},
onLoad() {
this.loading = true;
getYearData({
current:this.page.currentPage,
size:this.page.pageSize,
...this.query
}).then(res =>{
this.data = res.data.data.records
this.page.total = res.data.data.total
this.loading = false
})
4 months ago
},
},
};
5 months ago
</script>
4 months ago
<style lang="scss" scoped></style>