<template>
<div class="app-container">
<div class="filter-container">
<el-button type="primary" @click="add">
新增
</el-button>
<div class="filter-container">
<el-input
v-model="listQuery.projectName"
placeholder="项目名称"
style="width: 200px"
class="filter-item"
/>
<el-button class="filter-item" type="primary" icon="el-icon-search" @click="handleFilter">
搜索
</el-button>
<el-button class="filter-item" type="reset" icon="el-icon-reset" @click="reset">
重置
</el-button>
<!-- <el-button v-if="buttonPermissions.add" type="primary" @click="add">
新增
</el-button> -->
</div>
</div>
<div>
<el-table
:data="data"
highlight-current-row
stripe
:default-sort="{prop: 'code', order: 'descending'}"
:header-cell-style="{background:'#6B9BCC', color:'#fff'}"
class="table-margin"
border
:height="tableHeight"
>
<el-table-column
prop="projectType"
header-align="center"
align="center"
label="项目名称"
/>
<el-table-column
prop="jcsj"
header-align="center"
label="基础数据"
align="center"
>
<template slot-scope="scop">
<el-tag v-if="scop.row.jcsj!==null" type="success">已提交数据</el-tag>
<el-tag v-else type="warning">未提交数据</el-tag>
</template>
</el-table-column>
<el-table-column
prop="tfsjyz"
header-align="center"
label="通风设计原则"
align="center"
>
<template slot-scope="scop">
<el-tag v-if="scop.row.tfsjyz!==null" type="success">已提交数据</el-tag>
<el-tag v-else type="warning">未提交数据</el-tag>
</template>
</el-table-column>
<el-table-column
prop="tfjs"
header-align="center"
label="通风计算"
align="center"
>
<template slot-scope="scop">
<el-tag v-if="scop.row.tfjs!==null" type="success">已提交数据</el-tag>
<el-tag v-else type="warning">未提交数据</el-tag>
</template>
</el-table-column>
<el-table-column
prop="ftktjs"
header-align="center"
label="分体空调计算"
align="center"
>
<template slot-scope="scop">
<el-tag v-if="scop.row.ftktjs!==null" type="success">已提交数据</el-tag>
<el-tag v-else type="warning">未提交数据</el-tag>
</template>
</el-table-column>
<el-table-column
prop="dyjss"
header-align="center"
label="打印机算书"
align="center"
>
<template slot-scope="scop">
<el-tag v-if="scop.row.dyjss!==null" type="success">已提交数据</el-tag>
<el-tag v-else type="warning">未提交数据</el-tag>
</template>
</el-table-column>
<el-table-column
prop="listairconditioners"
header-align="center"
label="LIST-AIR CONDITIONERS"
align="center"
>
<template slot-scope="scop">
<el-tag v-if="scop.row.listairconditioners!==null" type="success">已提交数据</el-tag>
<el-tag v-else type="warning">未提交数据</el-tag>
</template>
</el-table-column>
<el-table-column
prop="listfans"
header-align="center"
label="LIST-FANS"
align="center"
>
<template slot-scope="scop">
<el-tag v-if="scop.row.listfans!==null" type="success">已提交数据</el-tag>
<el-tag v-else type="warning">未提交数据</el-tag>
</template>
</el-table-column>
<el-table-column
prop="listheatingfan"
header-align="center"
label="LIST-FANS"
align="center"
>
<template slot-scope="scop">
<el-tag v-if="scop.row.listheatingfan!==null" type="success">已提交数据</el-tag>
<el-tag v-else type="warning">未提交数据</el-tag>
</template>
</el-table-column>
<el-table-column
prop="listfiredampers"
header-align="center"
label="LIST-FIRE DAMPERS"
align="center"
>
<template slot-scope="scop">
<el-tag v-if="scop.row.listfiredampers!==null" type="success">已提交数据</el-tag>
<el-tag v-else type="warning">未提交数据</el-tag>
</template>
</el-table-column>
<el-table-column
prop="listotherdamper"
header-align="center"
label="LIST-OTHER DAMPER"
align="center"
>
<template slot-scope="scop">
<el-tag v-if="scop.row.listotherdamper!==null" type="success">已提交数据</el-tag>
<el-tag v-else type="warning">未提交数据</el-tag>
</template>
</el-table-column>
<el-table-column
prop="xfljs"
header-align="center"
label="新风量计算"
align="center"
>
<template slot-scope="scop">
<el-tag v-if="scop.row.xfljs!==null" type="success">已提交数据</el-tag>
<el-tag v-else type="warning">未提交数据</el-tag>
</template>
</el-table-column>
<el-table-column
prop="tbld"
header-align="center"
label="投标料单"
align="center"
>
<template slot-scope="scop">
<el-tag v-if="scop.row.tbld!==null" type="success">已提交数据</el-tag>
<el-tag v-else type="warning">未提交数据</el-tag>
</template>
</el-table-column>
<el-table-column
header-align="center"
label="操作"
align="center"
>
<template slot-scope="scope">
<el-button
type="text"
size="small"
@click="modifyRow(scope.row)"
>
编辑
</el-button>
<el-button
type="text"
size="small"
@click="deleteData(scope.row)"
>
移除
</el-button>
</template>
</el-table-column>
</el-table>
<pagination v-show="total > 0" :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.size" @pagination="getList" />
</div>
<div>
<el-dialog title="新增" :visible.sync="dialogVisible" width="50%" center>
<el-form ref="dataForm" :model="temp" label-width="80px" label-position="left" style="width: 40%; margin: 0px auto" :rules="rules">
<el-form-item label="项目名称" prop="projectType">
<el-input v-model="temp.projectType" auto-complete="off" placeholder="项目名称" style="width: 300px" />
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button type="danger" @click="dialogVisible = false">取消</el-button>
<el-button type="primary" @click="confirm">确认</el-button>
</span>
</el-dialog>
</div>
</div>
</template>
<script>
import { getAllCalculationResultList, updateAllCalculationResult } from '@/api/projectMaintenance/projectMaintenance'
import Pagination from '@/components/Pagination'
export default {
components: {
Pagination
},
data() {
return {
tableHeight: window.innerHeight - 250,
dialogVisible: false,
temp: {
projectType: null
},
data: null,
listQuery: {
projectName: '',
page: 1,
size: 10
},
total: 0,
rules: {
projectType: [{ required: true, message: '请输入项目名称', trigger: 'blur' }]
}
}
},
created() {
this.getList()
},
methods: {
getList() {
getAllCalculationResultList(this.listQuery).then(response => {
this.data = response.data
this.total = response.totalElements
console.log(this.data)
})
},
handleFilter() {
this.listQuery.page = 1
this.getList()
},
confirm() {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
updateAllCalculationResult(this.temp).then(response => {
if (response.success) {
this.$notify({
title: '提示',
message: '添加成功',
type: 'success',
duration: 2000
})
this.getList()
this.dialogVisible = false
} else {
this.$notify({
title: '提示',
message: response.msg,
type: 'warning',
duration: 2000
})
}
})
}
})
},
add() {
this.dialogVisible = true
}
}
}
</script>
<style lang="scss" scoped>
.el-dialog{
border-radius: 15px;
margin-bottom: 100px;
}
.el-dialog__header{
border-radius: 15px 15px 0px 0px;
border-bottom: 1px solid #e8eaec;
background-color: #66B1FF;
}
.el-dialog__title {
line-height: 24px;
letter-spacing:18px;
font-size: 20px;
color: #fefeff;
}
.el-dialog__footer {
border-top: 1px solid #e8eaec;
}
.filter-container {
margin-top: 0.5%;
}
</style>
链接: 后台代码