<template>
|
<div>
|
<div>
|
<div class="view-title">
|
<span>纠正措施</span>
|
</div>
|
<div class="search-background">
|
<span class="search-group">
|
<span style="width: 150px">不合格描述:</span>
|
<el-input v-model="searchForm.raiseResult" clearable size="small"></el-input>
|
</span>
|
<span class="search-group">
|
<el-button size="medium" @click="resetSearchForm">重 置</el-button>
|
<el-button size="medium" type="primary" @click="searchList">查 询</el-button>
|
</span>
|
</div>
|
<div class="table">
|
<div>
|
<TableCard :showForm="false" :showTitle="false">
|
<template v-slot:table>
|
<ZTTable
|
:column="tableColumn"
|
:height="'calc(100vh - 23em)'"
|
:table-data="tableData"
|
:table-loading="tableLoading"
|
style="padding: 0 15px;margin-bottom: 16px">
|
</ZTTable>
|
</template>
|
</TableCard>
|
<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>
|
</div>
|
</div>
|
<corrective-info v-if="correctiveInfo" ref="correctiveInfo"></corrective-info>
|
<ViewTestRecord v-if="viewTestRecordDialog" ref="viewTestRecordDialog"></ViewTestRecord>
|
</div>
|
</template>
|
|
<script>
|
import TableCard from '../caorui/TableCard/index.vue';
|
import ZTTable from '../caorui/ZTTable/index.vue';
|
import CorrectiveInfo from '../do/a8-corrective-action/correctiveInfo.vue';
|
import QualityInfo from '../do/a7-nonconforming-item/qualityInfo.vue';
|
import ViewTestRecord from '../do/a8-corrective-action/ViewTestRecord.vue';
|
|
export default {
|
name: 'a8-corrective-action',
|
// import 引入的组件需要注入到对象中才能使用
|
components: { QualityInfo, CorrectiveInfo, 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: '60',
|
label: '操作',
|
operation: [
|
{
|
name: '查看',
|
type: 'text',
|
clickFun: (row) => {
|
this.viewInfo(row);
|
},
|
},
|
{
|
name: '导出',
|
type: 'text',
|
clickFun: (row) => {
|
this.handleDown(row)
|
}
|
},
|
{
|
name: '查看附件',
|
type: 'text',
|
clickFun: (row) => {
|
this.viewFiles(row);
|
},
|
},
|
]
|
}
|
],
|
tableData: [],
|
tableLoading: false,
|
page: {
|
size: 20,
|
current: 1,
|
},
|
total: 0,
|
correctiveInfo: 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.qualitySupervise.pageSuperviseDetailCorrect, { 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
|
})
|
},
|
// 导出
|
handleDown (row) {
|
this.$axios.get(this.$api.qualitySupervise.exportSuperviseDetaillCorrect + '?superviseDetailsCorrectId=' + row.superviseDetailsCorrectId,{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();
|
})
|
},
|
// 重置查询条件
|
resetSearchForm() {
|
this.searchForm.raiseResult = '';
|
this.searchList()
|
},
|
// 查看详情
|
viewInfo (row) {
|
this.correctiveInfo = true
|
this.$nextTick(() => {
|
this.$refs.correctiveInfo.openDia(row)
|
})
|
},
|
// 查看附件
|
viewFiles (row) {
|
this.viewTestRecordDialog = true
|
this.$nextTick(() => {
|
this.$refs.viewTestRecordDialog.openDia(row)
|
})
|
},
|
// 分页
|
handleSizeChange(val) {
|
this.page.size = val;
|
this.searchList();
|
},
|
handleCurrentChange(val) {
|
this.page.current = val;
|
this.searchList();
|
},
|
}
|
};
|
</script>
|
|
<style scoped>
|
.view-title {
|
display: flex;
|
justify-content: space-between;
|
align-items: center;
|
height: 60px;
|
padding-left: 20px;
|
}
|
|
.search-background {
|
width: 100%;
|
height: 80px;
|
line-height: 80px;
|
background-color: #ffffff;
|
display: flex;
|
}
|
|
.search-group {
|
display: flex;
|
align-items: center;
|
margin: 0 20px;
|
}
|
|
.table {
|
margin-top: 20px;
|
background-color: #ffffff;
|
padding-top: 20px;
|
}
|
</style>
|