<template>
|
<!-- 7.7质量监控计划-->
|
<div>
|
<div class="table-card">
|
<TableCard title="年度计划表" style="margin-top: 10px;">
|
<template v-slot:form>
|
<div class="items_center">
|
<span>计划名称:</span>
|
<el-input v-model="yearForm.monitorName" class="search" placeholder="请输入" size="small"></el-input>
|
<el-button size="small" type="primary" @click="getYearPlanList">查询</el-button>
|
<el-button size="small" @click="clearYear">重置</el-button>
|
</div>
|
<div>
|
<el-upload ref='upload' :action="action" :before-upload="beforeUpload" :headers="uploadHeader"
|
:on-error="onError" :data="uploadData" :on-success="handleSuccessUp" :show-file-list="false"
|
accept='.jpg,.jpeg,.png,.gif,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.pdf,.zip,.rar'>
|
<el-button :loading="upLoading" size="small" type="primary">导入</el-button>
|
</el-upload>
|
</div>
|
</template>
|
<template v-slot:table>
|
<limsTable ref="yearTable" :column="yearColumnData" :height="'28vh'" :highlightCurrentRow="true"
|
:rowClick="rowClick" :table-data="yearTableData" :table-loading="yearLoading"
|
style="margin-top: 0.5em;padding: 0 15px;" :page="yearPage" @pagination="pagination">
|
</limsTable>
|
</template>
|
</TableCard>
|
</div>
|
<div class="table-card">
|
<TableCard title="年度计划明细表" style="margin-top: 10px;">
|
<template v-slot:form>
|
<div class="items_center">
|
<span>监控目的:</span>
|
<el-input v-model="yearDetailForm.monitorPurpose" class="search" placeholder="请输入" size="small"></el-input>
|
<span>监控项目:</span>
|
<el-input v-model="yearDetailForm.monitorProject" class="search" placeholder="请输入" size="small"></el-input>
|
<el-button size="small" type="primary" @click="getYearDetailPlanList">查询</el-button>
|
<el-button size="small" @click="clearDetail">重置</el-button>
|
</div>
|
<div>
|
<el-button size="small" type="primary" @click="showDialog('add')">新增</el-button>
|
</div>
|
</template>
|
<template v-slot:table>
|
<limsTable :column="yearDetailColumnData" :height="'28vh'" :table-data="yearDetailTableData"
|
:table-loading="yearDetailLoading" style="margin-top: 18px; padding: 0 15px;" :page="yearDetailPage"
|
@pagination="pagination1">
|
</limsTable>
|
</template>
|
</TableCard>
|
</div>
|
<!--新增修改弹框-->
|
<detail-form-dialog v-if="formDia" ref="formDia" :qualityMonitorId="qualityMonitorId"
|
@closeDia="closeDia"></detail-form-dialog>
|
<!--实施流程弹框-->
|
<carry-out-dialog v-if="carryOutDia" ref="carryOutDia" :qualityMonitorId="qualityMonitorId"
|
@closeDia="closeCarryOutDia"></carry-out-dialog>
|
<!--评价流程弹框-->
|
<evaluate-dialog v-if="evaluateDialog" ref="evaluateDialog" @closeEvaDia="closeEvaDia"></evaluate-dialog>
|
<el-dialog :visible.sync="examineDialog" title="审核" width="30%" @close="closeExamineDia">
|
<span>
|
审核备注:
|
<el-input v-model="examineInfo.examineRemark" type="textarea"></el-input>
|
</span>
|
<span slot="footer" class="dialog-footer">
|
<el-button :loading="examineLoading" @click="handleReview(0)">不通过</el-button>
|
<el-button :loading="examineLoading" type="primary" @click="handleReview(1)">通 过</el-button>
|
</span>
|
</el-dialog>
|
<el-dialog :visible.sync="ratifyDialog" title="批准" width="30%" @close="closeRatifyDia">
|
<span>
|
批准备注:
|
<el-input v-model="ratifyInfo.ratifyRemark" type="textarea"></el-input>
|
</span>
|
<span slot="footer" class="dialog-footer">
|
<el-button :loading="ratifyLoading" @click="handleRatify(0)">不批准</el-button>
|
<el-button :loading="ratifyLoading" type="primary" @click="handleRatify(1)">批 准</el-button>
|
</span>
|
</el-dialog>
|
<el-dialog :visible.sync="downloadDialog" title="导出" width="600px">
|
<span>
|
<el-button plain type="primary" @click="controlDown">实施计划导出</el-button>
|
<el-button plain type="primary" @click="processingDown">评价导出</el-button>
|
</span>
|
<span slot="footer" class="dialog-footer">
|
<el-button @click="downloadDialog = false">取 消</el-button>
|
</span>
|
</el-dialog>
|
</div>
|
</template>
|
|
<script>
|
import TableCard from '@/components/TableCard/index.vue';
|
import limsTable from "@/components/Table/lims-table.vue";
|
import DetailFormDialog from './components/detailFormDialog.vue';
|
import CarryOutDialog from './components/carryOutDialog.vue';
|
import EvaluateDialog from './components/evaluateDialog.vue';
|
import {
|
pageQualityMonitor,
|
examineQualityMonitor,
|
ratifyQualityMonitor,
|
exportQualityMonitorDetail,
|
delQualitySupervise,
|
pageQualityMonitorDetail,
|
exportQualityMonitorRatify,
|
exportQualityMonitorEvaluate,
|
delQualityMonitorDetail,
|
} from '@/api/cnas/process/ensureResults/ensureResultsValidity.js'
|
|
export default {
|
name: 'a7-Ensure-results-validity',
|
// import 引入的组件需要注入到对象中才能使用
|
components: { EvaluateDialog, CarryOutDialog, DetailFormDialog, limsTable, TableCard },
|
data() {
|
// 这里存放数据
|
return {
|
uploadData: {},
|
yearForm: {
|
monitorName: '',
|
},
|
yearPage: {
|
current: 1,
|
size: 20,
|
total: 0
|
},
|
yearColumnData: [
|
{
|
label: '计划名称',
|
prop: 'monitorName',
|
minWidth: '150px'
|
}, {
|
label: '编制人',
|
prop: 'writeName',
|
minWidth: '100'
|
}, {
|
label: '编制日期',
|
prop: 'writeTime',
|
minWidth: '160'
|
}, {
|
dataType: 'tag',
|
label: '审核状态',
|
prop: 'examineStatus',
|
minWidth: '100',
|
formatData: (params) => {
|
if (params === 0) {
|
return '不通过';
|
} else if (params === 1) {
|
return '通过';
|
} else {
|
return null;
|
}
|
},
|
formatType: (params) => {
|
if (params === 0) {
|
return 'danger';
|
} else if (params === 1) {
|
return 'success';
|
} else {
|
return null;
|
}
|
}
|
}, {
|
label: '审核内容',
|
prop: 'examineRemark',
|
minWidth: '100'
|
}, {
|
label: '审核人',
|
prop: 'examineName',
|
minWidth: '100'
|
}, {
|
label: '审核日期',
|
prop: 'examineTime',
|
minWidth: '160'
|
}, {
|
dataType: 'tag',
|
label: '批准状态',
|
prop: 'ratifyStatus',
|
minWidth: '100',
|
formatData: (params) => {
|
if (params === 0) {
|
return '不批准';
|
} else if (params === 1) {
|
return '批准';
|
} else {
|
return null;
|
}
|
},
|
formatType: (params) => {
|
if (params === 0) {
|
return 'danger';
|
} else if (params === 1) {
|
return 'success';
|
} else {
|
return null;
|
}
|
}
|
}, {
|
label: '批准内容',
|
prop: 'ratifyRemark',
|
minWidth: '100'
|
}, {
|
label: '批准人',
|
prop: 'ratifyName',
|
minWidth: '100'
|
}, {
|
label: '批准日期',
|
prop: 'ratifyTime',
|
minWidth: '160'
|
}, {
|
label: '创建日期',
|
prop: 'createTime',
|
minWidth: '160'
|
}, {
|
label: '创建人',
|
prop: 'createUser',
|
minWidth: '100'
|
}, {
|
dataType: 'action',
|
minWidth: '170',
|
label: '操作',
|
fixed: 'right',
|
operation: [
|
{
|
name: '审核',
|
type: 'text',
|
disabled: (row) => {
|
if (row.examineStatus === 1) {
|
return true
|
} else {
|
return false
|
}
|
},
|
clickFun: (row) => {
|
this.examinePlan(row)
|
}
|
},
|
{
|
name: '批准',
|
type: 'text',
|
disabled: (row) => {
|
if (row.ratifyStatus === 1 || row.examineStatus !== 1) {
|
return true
|
} else {
|
return false
|
}
|
},
|
clickFun: (row) => {
|
this.approvalPlan(row)
|
}
|
},
|
{
|
name: '导出',
|
type: 'text',
|
clickFun: (row) => {
|
this.handleDown(row)
|
}
|
},
|
{
|
name: '删除',
|
type: 'text',
|
color: '#f56c6c',
|
clickFun: (row) => {
|
this.delPlan(row)
|
}
|
}
|
]
|
}],
|
yearTableData: [], // 年表
|
yearLoading: false,
|
yearDetailForm: {
|
monitorPurpose: '',
|
monitorProject: ''
|
},
|
yearDetailColumnData: [
|
{
|
label: '监控目的',
|
prop: 'monitorPurpose',
|
width: '150px',
|
showOverflowTooltip: true,
|
}, {
|
label: '计划开展时间',
|
prop: 'plannedTime',
|
minWidth: '150px'
|
}, {
|
label: '监控项目',
|
prop: 'monitorProject',
|
minWidth: '150px'
|
}, {
|
label: '参加单位(人员)',
|
prop: 'participant',
|
minWidth: '150px'
|
}, {
|
label: '预算(元)',
|
prop: 'budget',
|
minWidth: '150px'
|
}, {
|
label: '组织人员',
|
prop: 'organization',
|
minWidth: '150px'
|
}, {
|
label: '监控方式',
|
prop: 'monitorWay',
|
minWidth: '150px'
|
}, {
|
dataType: 'action',
|
width: '180',
|
label: '操作',
|
fixed: 'right',
|
operation: [
|
{
|
name: '编辑',
|
type: 'text',
|
clickFun: (row) => {
|
this.showDialog('edit', row)
|
}
|
},
|
{
|
name: '实施',
|
type: 'text',
|
clickFun: (row) => {
|
this.carryOut(row)
|
}
|
},
|
{
|
name: '评价',
|
type: 'text',
|
clickFun: (row) => {
|
this.evaluate(row)
|
}
|
},
|
{
|
name: '导出',
|
type: 'text',
|
clickFun: (row) => {
|
this.downLoadPost(row);
|
},
|
},
|
{
|
name: '删除',
|
type: 'text',
|
color: '#f56c6c',
|
clickFun: (row) => {
|
this.delYearPlanDetail(row)
|
}
|
}
|
]
|
}
|
],
|
yearDetailTableData: [], // 年明细表
|
yearDetailLoading: false,
|
yearDetailPage: {
|
current: 1,
|
size: 20,
|
total: 0
|
},
|
formDia: false,
|
qualityMonitorId: '',
|
carryOutDia: false,
|
evaluateDialog: false,
|
examineDialog: false,
|
examineLoading: false,
|
ratifyDialog: false,
|
ratifyLoading: false,
|
examineInfo: {},
|
ratifyInfo: {},
|
upLoading: false,
|
downloadDialog: false,
|
download: {},
|
};
|
},
|
mounted() {
|
this.getYearPlanList()
|
},
|
// 方法集合
|
methods: {
|
// 查询年度计划表
|
getYearPlanList() {
|
const entity = {
|
monitorName: this.yearForm.monitorName,
|
}
|
const page = this.yearPage
|
this.yearLoading = true
|
pageQualityMonitor({ ...entity, ...page }).then(res => {
|
this.yearLoading = false
|
if (res.code === 201) return
|
this.yearTableData = res.data.records
|
this.yearPage.total = res.data.total
|
if (this.yearTableData.length > 0) {
|
this.rowClick(this.yearTableData[0])
|
}
|
}).catch(err => {
|
console.log('err---', err);
|
this.yearLoading = false
|
})
|
},
|
clearYear() {
|
this.yearForm.monitorName = ''
|
this.getYearPlanList()
|
},
|
// 导入流程
|
beforeUpload(file) {
|
if (file.size > 1024 * 1024 * 10) {
|
this.$message.error('上传文件不超过10M');
|
this.$refs.upload.clearFiles()
|
return false;
|
} else {
|
this.upLoading = true;
|
let list = file.name.split(".")
|
let suffix = list[list.length - 1]
|
this.$set(this.uploadData, 'suffix', suffix)
|
return true;
|
}
|
},
|
onError(err, file, fileList) {
|
this.$message.error('上传失败')
|
this.$refs.upload.clearFiles()
|
},
|
handleSuccessUp(response) {
|
this.upLoading = false;
|
if (response.code == 200) {
|
this.$message.success('上传成功');
|
this.getYearPlanList()
|
}
|
},
|
// 审核
|
examinePlan(row) {
|
this.examineDialog = true
|
this.examineInfo = row
|
},
|
handleReview(examineStatus) {
|
// 审核状态 , 0 不通过, 1通过
|
this.examineInfo.examineStatus = examineStatus
|
this.examineLoading = true
|
examineQualityMonitor(this.examineInfo).then(res => {
|
this.examineLoading = false
|
if (res.code === 201) return
|
this.$message.success('操作成功')
|
this.closeExamineDia()
|
}).catch(err => {
|
console.log('err---', err);
|
this.examineLoading = false
|
})
|
},
|
closeExamineDia() {
|
this.examineDialog = false
|
this.examineInfo.examineRemark = ''
|
this.getYearPlanList()
|
},
|
// 批准
|
approvalPlan(row) {
|
this.ratifyDialog = true
|
this.ratifyInfo = row
|
},
|
handleRatify(ratifyStatus) {
|
// 批准状态 , 0 不通过, 1通过
|
this.ratifyInfo.ratifyStatus = ratifyStatus
|
this.ratifyLoading = true
|
ratifyQualityMonitor(this.ratifyInfo).then(res => {
|
this.ratifyLoading = false
|
if (res.code === 201) return
|
this.$message.success('操作成功')
|
this.closeRatifyDia()
|
}).catch(err => {
|
console.log('err---', err);
|
this.ratifyLoading = false
|
})
|
},
|
closeRatifyDia() {
|
this.ratifyDialog = false
|
this.ratifyInfo.ratifyRemark = ''
|
this.getYearPlanList()
|
},
|
// 导出
|
handleDown(row) {
|
exportQualityMonitorDetail({ qualityMonitorId: row.qualityMonitorId }).then(res => {
|
this.outLoading = false
|
const blob = new Blob([res], { type: 'application/msword' });
|
this.$download.saveAs(blob, row.monitorName + '.docx')
|
})
|
},
|
// 删除进度计划表
|
delPlan(row) {
|
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
|
confirmButtonText: '确定',
|
cancelButtonText: '取消',
|
type: 'warning'
|
}).then(() => {
|
this.yearLoading = true
|
delQualitySupervise({ qualityMonitorId: row.qualityMonitorId }).then(res => {
|
this.yearLoading = false
|
if (res.code === 201) return
|
this.$message.success('删除成功')
|
this.getYearPlanList();
|
|
}).catch(err => {
|
this.yearLoading = false
|
console.log('err---', err);
|
})
|
}).catch(() => {
|
this.$message({
|
type: 'info',
|
message: '已取消删除'
|
});
|
});
|
},
|
// 年度计划表格,点击行数据后刷新详情
|
rowClick(row) {
|
this.qualityMonitorId = row.qualityMonitorId
|
this.getYearDetailPlanList()
|
},
|
// 获取年度明细表
|
getYearDetailPlanList() {
|
const entity = {
|
qualityMonitorId: this.qualityMonitorId,
|
monitorPurpose: this.yearDetailForm.monitorPurpose,
|
monitorProject: this.yearDetailForm.monitorProject,
|
}
|
const page = this.yearDetailPage
|
this.yearDetailLoading = true
|
pageQualityMonitorDetail({ ...entity, ...page }).then(res => {
|
this.yearDetailLoading = false
|
if (res.code === 201) return
|
this.yearDetailTableData = res.data.records
|
this.yearDetailPage.total = res.data.total
|
}).catch(err => {
|
console.log('err---', err);
|
this.yearDetailLoading = false
|
})
|
},
|
// 重置明细表
|
clearDetail() {
|
this.yearDetailForm = {
|
monitorPurpose: '',
|
monitorProject: ''
|
}
|
this.getYearDetailPlanList()
|
},
|
// 明细表实施
|
carryOut(row) {
|
this.carryOutDia = true
|
this.$nextTick(() => {
|
this.$refs.carryOutDia.openDia(row)
|
})
|
},
|
closeCarryOutDia() {
|
this.carryOutDia = false
|
this.getYearDetailPlanList()
|
},
|
// 打开评价弹框
|
evaluate(row) {
|
this.evaluateDialog = true
|
this.$nextTick(() => {
|
this.$refs.evaluateDialog.openDia(row)
|
})
|
},
|
closeEvaDia() {
|
this.evaluateDialog = false
|
this.getYearDetailPlanList()
|
},
|
// 打开导出弹框
|
downLoadPost(row) {
|
this.downloadDialog = true
|
this.download = row
|
},
|
// 打开年度明细新增、修改弹框
|
showDialog(type, row) {
|
this.formDia = true
|
this.$nextTick(() => {
|
this.$refs.formDia.openDia(type, row)
|
})
|
},
|
closeDia() {
|
this.formDia = false
|
this.getYearDetailPlanList()
|
},
|
// 控制单导出
|
controlDown() {
|
exportQualityMonitorRatify({
|
qualityMonitorDetailsId: this.download.qualityMonitorDetailsId
|
}).then(res => {
|
this.outLoading = false
|
const blob = new Blob([res], { type: 'application/msword' });
|
this.$download.saveAs(blob, '质量监控实施计划.docx')
|
})
|
},
|
// 处理单导出
|
processingDown() {
|
exportQualityMonitorEvaluate({ qualityMonitorDetailsId: this.download.qualityMonitorDetailsId }).then(res => {
|
this.outLoading = false
|
const blob = new Blob([res], { type: 'application/msword' });
|
this.$download.saveAs(blob, '质量监控评价.docx')
|
})
|
},
|
delYearPlanDetail(row) {
|
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
|
confirmButtonText: '确定',
|
cancelButtonText: '取消',
|
type: 'warning'
|
}).then(() => {
|
this.yearDetailLoading = true
|
delQualityMonitorDetail({ qualityMonitorDetailsId: row.qualityMonitorDetailsId }).then(res => {
|
this.yearDetailLoading = false
|
if (res.code === 201) return
|
this.$message.success('删除成功')
|
this.getYearDetailPlanList()
|
}).catch(err => {
|
this.yearDetailLoading = false
|
console.log('err---', err);
|
})
|
})
|
},
|
// 年计划分页
|
pagination({ page, limit }) {
|
this.yearPage.current = page;
|
this.yearPage.size = limit;
|
this.getYearPlanList();
|
},
|
// 年明细计划分页
|
pagination1({ page, limit }) {
|
this.yearDetailPage.current = page;
|
this.yearDetailPage.size = limit;
|
this.getYearDetailPlanList();
|
},
|
},
|
// 用于上传文件的信息
|
computed: {
|
action() {
|
return this.javaApi + '/qualityMonitor/importQualityMonitor'
|
}
|
},
|
};
|
</script>
|
|
<style scoped>
|
.table-card {
|
background-color: #ffffff;
|
}
|
|
.flex_column {
|
display: flex;
|
height: 80vh;
|
flex-direction: column;
|
overflow: auto;
|
justify-content: space-between;
|
}
|
|
.pagination {
|
display: flex;
|
justify-content: space-between
|
}
|
|
.items_center {
|
display: flex;
|
align-items: center;
|
}
|
|
.date_box {
|
margin: 0 5px;
|
}
|
|
.search {
|
width: 150px;
|
padding: 0 16px;
|
}
|
</style>
|