<template>
|
<div>
|
<div class="search-background">
|
<span class="search-group">
|
<span style="width: 200px">不合格描述:</span>
|
<el-input v-model="searchForm.raiseResult" clearable size="small"></el-input>
|
<el-button size="medium" style="margin-left: 10px" @click="resetSearchForm">重 置</el-button>
|
<el-button size="medium" type="primary" @click="searchList">查 询</el-button>
|
</span>
|
<span class="search-group">
|
<el-button size="medium" type="primary" @click="openFormDia('add')">新 增</el-button>
|
</span>
|
</div>
|
<div class="table">
|
<ZTTable
|
:column="tableColumn"
|
:height="'calc(100vh - 20em)'"
|
:table-data="tableData"
|
:table-loading="tableLoading"
|
style="padding: 0 10px;margin-bottom: 16px">
|
</ZTTable>
|
<el-pagination :current-page="1" :page-size="page.size" :page-sizes="[10, 20, 30, 50, 100]"
|
:total="total" layout="->,total, sizes, prev, pager, next, jumper"
|
@size-change="handleSizeChange"
|
@current-change="handleCurrentChange">
|
</el-pagination>
|
</div>
|
<corrective-action-d-ia v-if="correctiveActionDIa" ref="correctiveActionDIa" @closeRectifyDia="closeRectifyDia"></corrective-action-d-ia>
|
<view-test-record v-if="viewTestRecordDialog" ref="viewTestRecordDialog"></view-test-record>
|
</div>
|
</template>
|
|
<script>
|
import TableCard from '../../caorui/TableCard/index.vue';
|
import ZTTable from '../../caorui/ZTTable/index.vue';
|
import CorrectiveActionDIa from './correctiveActionDIa.vue';
|
import ViewTestRecord from './ViewTestRecord.vue';
|
|
export default {
|
name: 'correctiveAction',
|
// import 引入的组件需要注入到对象中才能使用
|
components: { CorrectiveActionDIa, ZTTable, TableCard, ViewTestRecord },
|
data() {
|
// 这里存放数据
|
return {
|
searchForm: {
|
raiseResult: '',
|
},
|
tableColumn: [
|
{
|
label: '不合格或偏离事实的描述',
|
prop: 'raiseResult',
|
minWidth: '100'
|
},
|
{
|
label: '原因分析',
|
prop: 'causeResult',
|
minWidth: '100'
|
},
|
{
|
label: '纠正措施',
|
prop: 'correctResult',
|
minWidth: '100'
|
},
|
{
|
label: '实施验证结果',
|
prop: 'validationResult',
|
minWidth: '100'
|
},
|
{
|
dataType: 'action',
|
minWidth: '220',
|
label: '操作',
|
operation: [
|
{
|
name: '导出',
|
type: 'text',
|
clickFun: (row) => {
|
this.handleDown(row)
|
}
|
},
|
{
|
name: '纠正',
|
type: 'text',
|
clickFun: (row) => {
|
this.openFormDia('rectify', row);
|
},
|
},
|
{
|
name: '查看附件',
|
type: 'text',
|
clickFun: (row) => {
|
this.viewFiles(row);
|
},
|
},
|
]
|
}
|
],
|
tableData: [],
|
tableLoading: false,
|
page: {
|
size: 20,
|
current: 1,
|
},
|
total: 0,
|
correctiveActionDIa: false,
|
viewTestRecordDialog: false,
|
};
|
},
|
mounted() {
|
this.searchList()
|
},
|
// 方法集合
|
methods: {
|
// 查询列表
|
searchList() {
|
const entity = {
|
raiseResult: this.searchForm.raiseResult,
|
}
|
const page = this.page
|
this.tableLoading = true
|
this.$axios.post(this.$api.internalCorrect.pageInternalCorrect, { entity, page }, {
|
headers: {
|
"Content-Type": "application/json"
|
},
|
noQs: true
|
}).then(res => {
|
this.tableLoading = false
|
if (res.code === 201) return
|
this.tableData = res.data.records
|
this.total = res.data.total
|
}).catch(err => {
|
console.log('err---', err);
|
this.tableLoading = false
|
})
|
},
|
// 重置查询条件
|
resetSearchForm() {
|
this.searchForm.raiseResult = '';
|
this.searchList()
|
},
|
// 查看附件
|
viewFiles (row) {
|
this.viewTestRecordDialog = true
|
this.$nextTick(() => {
|
this.$refs.viewTestRecordDialog.openDia(row)
|
})
|
},
|
openFormDia (type, row) {
|
this.correctiveActionDIa = true
|
this.$nextTick(() => {
|
this.$refs.correctiveActionDIa.openDia(type,row)
|
})
|
},
|
// 导出
|
handleDown (row) {
|
this.$axios.get(this.$api.internalCorrect.exportInternalCorrect + '?correctId=' + row.correctId,{responseType: "blob"}).then(res => {
|
this.outLoading = false
|
this.$message.success('导出成功')
|
const blob = new Blob([res],{ type: 'application/msword' });
|
const url = URL.createObjectURL(blob);
|
const link = document.createElement('a');
|
link.href = url;
|
link.download = '内审纠正措施' + '.docx';
|
link.click();
|
})
|
},
|
closeRectifyDia () {
|
this.correctiveActionDIa = false
|
this.searchList()
|
},
|
// 分页
|
handleSizeChange(val) {
|
this.page.size = val;
|
this.searchList();
|
},
|
handleCurrentChange(val) {
|
this.page.current = val;
|
this.searchList();
|
},
|
}
|
};
|
</script>
|
|
<style scoped>
|
.search-background {
|
width: 100%;
|
height: 60px;
|
line-height: 60px;
|
display: flex;
|
justify-content: space-between;
|
}
|
.search-group {
|
display: flex;
|
align-items: center;
|
margin: 0 20px;
|
}
|
</style>
|