<template>
|
<zt-dialog ref="dialog" column="2" append-to-body title="评定数据管理" :editAble="false" :hasConfirm="false">
|
<el-form :inline="true" label-width="100px" :model="dataForm">
|
<el-form-item label="总体节点" prop="shipName" style="width: 26%">
|
<el-input v-model="dataForm.shipName" :readonly="true"></el-input>
|
</el-form-item>
|
<el-form-item>
|
<el-button type="primary" size="small" style="margin-left:20px;font-size: 15px" @click="exportData()">下载数据模板
|
</el-button>
|
<el-button type="primary" @click="add()">新增</el-button>
|
</el-form-item>
|
</el-form>
|
<el-table :data="assessData" border highlight-current-row
|
:header-cell-style="{'text-align':'center'}">
|
<el-table-column prop="name" label="评定数据名称" align="center"/>
|
<el-table-column width="100">
|
<template v-slot="{row}">
|
<zt-table-button type="primary" @click="updateAssess(row)">修改</zt-table-button>
|
<zt-table-button type="primary" @click="deleteAssess(row)">删除</zt-table-button>
|
</template>
|
</el-table-column>
|
</el-table>
|
<add-or-update @refreshDataList="refreshData" ref="addOrUpdate"/>
|
</zt-dialog>
|
</template>
|
|
<script>
|
import addOrUpdate from "./RelisbilityAssess-AddOrUpdate";
|
|
export default {
|
name: 'assess-Manage',
|
data() {
|
return {
|
dataForm: {
|
shipName: '',
|
name: '',
|
productId: ''
|
},
|
assessData: [],
|
productList: [],
|
}
|
},
|
components: {
|
addOrUpdate
|
},
|
methods: {
|
async init(id, param) {
|
this.dataForm.productId = param.productId
|
this.dataForm.shipName = param.shipName
|
this.getAssessDataList()
|
},
|
refreshData(){
|
this.getAssessDataList()
|
},
|
async getAssessDataList() {
|
let params = {
|
productId: this.dataForm.productId
|
}
|
let res = await this.$http.get(`/taskReliability/ReliabilityAssess/getAssessDataList`, {params: params})
|
if (res.success) {
|
this.assessData = res.data
|
}
|
},
|
add() {
|
this.$refs.addOrUpdate.$refs.dialog.init(null, {
|
productId: this.dataForm.productId,
|
shipName: this.dataForm.shipName
|
})
|
},
|
updateAssess(row) {
|
this.$refs.addOrUpdate.$refs.dialog.init(row.id, {
|
productId: row.productId,
|
shipName: this.dataForm.shipName,
|
name: row.name
|
})
|
},
|
async deleteAssess(row) {
|
let params = {
|
id: row.id
|
}
|
let res = await this.$http.get(`/taskReliability/ReliabilityAssess/delete`, {params: params})
|
if (res.success) {
|
this.getAssessDataList()
|
}
|
},
|
exportData() {
|
window.location.href = './评定数据导入模板.xlsx'
|
},
|
}
|
}
|
</script>
|