<template>
|
<!-- 7.7质量监控计划-->
|
<div>
|
<div class="table-card">
|
<TableCard title="年度计划表">
|
<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="headers" :on-error="onError"
|
: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>
|
<ZTTable
|
ref="yearTable"
|
:column="yearColumnData"
|
:height="'25vh'"
|
:highlightCurrentRow="true"
|
:rowClick="rowClick"
|
:table-data="yearTableData"
|
:table-loading="yearLoading"
|
style="margin-top: 0.5em;padding: 0 15px;"
|
>
|
</ZTTable>
|
<el-divider></el-divider>
|
<!-- 分页 -->
|
<div class="pagination">
|
<div></div>
|
<el-pagination :page-size="yearPage.size" :page-sizes="[10, 20, 30, 40]"
|
:total="yearPage.total" layout="total, sizes, prev, pager, next, jumper"
|
@current-change="handleYearCurrent" @size-change="handleYearSizeChange">
|
</el-pagination>
|
</div>
|
</template>
|
</TableCard>
|
</div>
|
<div class="table-card">
|
<TableCard title="年度计划明细表">
|
<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>
|
<ZTTable :column="yearDetailColumnData" :height="'25vh'" :table-data="yearDetailTableData"
|
:table-loading="yearDetailLoading" style="margin-top: 18px; padding: 0 15px;">
|
</ZTTable>
|
<el-divider></el-divider>
|
<!-- 分页 -->
|
<div class="pagination">
|
<div></div>
|
<el-pagination :page-size="yearDetailPage.size" :page-sizes="[10, 20, 30, 40]"
|
:total="yearDetailPage.total" layout="total, sizes, prev, pager, next, jumper"
|
@current-change="handleYearDetailCurrent" @size-change="handleYearDetailSizeChange">
|
</el-pagination>
|
</div>
|
</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>
|
</div>
|
</template>
|
|
<script>
|
import UploadExcel from '../caorui/Department/components/Plan/UploadExcel.vue';
|
import TableCard from '../caorui/TableCard/index.vue';
|
import ZTTable from '../caorui/ZTTable/index.vue';
|
import DetailFormDialog from '../do/a7-Ensure-results-validity/detailFormDialog.vue';
|
import CarryOutDialog from '../do/a7-Ensure-results-validity/carryOutDialog.vue';
|
import EvaluateDialog from '../do/a7-Ensure-results-validity/evaluateDialog.vue';
|
import fileDownload from "../../util/file";
|
|
export default {
|
name: 'a7-Ensure-results-validity',
|
// import 引入的组件需要注入到对象中才能使用
|
components: { EvaluateDialog, CarryOutDialog, DetailFormDialog, ZTTable, TableCard, UploadExcel },
|
data() {
|
// 这里存放数据
|
return {
|
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: '200',
|
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',
|
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,
|
};
|
},
|
mounted() {
|
this.getYearPlanList()
|
},
|
// 方法集合
|
methods: {
|
// 查询年度计划表
|
getYearPlanList () {
|
const entity = {
|
monitorName: this.yearForm.monitorName,
|
}
|
const page = this.yearPage
|
this.yearLoading = true
|
this.$axios.post(this.$api.qualityMonitor.pageQualityMonitor, { entity, page }, {
|
headers: {
|
"Content-Type": "application/json"
|
},
|
noQs: true
|
}).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;
|
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
|
this.$axios.post(this.$api.qualityMonitor.examineQualityMonitor, this.examineInfo, {
|
headers: {
|
"Content-Type": "application/json"
|
},
|
noQs: true
|
}).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
|
this.$axios.post(this.$api.qualityMonitor.ratifyQualityMonitor, this.ratifyInfo, {
|
headers: {
|
"Content-Type": "application/json"
|
},
|
noQs: true
|
}).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) {
|
this.$axios.get(this.$api.qualityMonitor.exportQualityMonitorDetail + '?qualityMonitorId=' + row.qualityMonitorId,{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 = row.monitorName + '.docx';
|
link.click();
|
})
|
},
|
// 删除进度计划表
|
delPlan (row) {
|
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
|
confirmButtonText: '确定',
|
cancelButtonText: '取消',
|
type: 'warning'
|
}).then(() => {
|
this.yearLoading = true
|
this.$axios.get(this.$api.qualityMonitor.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
|
this.$axios.post(this.$api.qualityMonitor.pageQualityMonitorDetail, { entity, page }, {
|
headers: {
|
"Content-Type": "application/json"
|
},
|
noQs: true
|
}).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()
|
},
|
// 打开年度明细新增、修改弹框
|
showDialog (type, row) {
|
this.formDia = true
|
this.$nextTick(() => {
|
this.$refs.formDia.openDia(type, row)
|
})
|
},
|
closeDia () {
|
this.formDia = false
|
this.getYearDetailPlanList()
|
},
|
delYearPlanDetail (row) {
|
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
|
confirmButtonText: '确定',
|
cancelButtonText: '取消',
|
type: 'warning'
|
}).then(() => {
|
this.yearDetailLoading = true
|
this.$axios.get(this.$api.qualityMonitor.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);
|
})
|
})
|
},
|
// 年计划分页
|
handleYearCurrent(page) {
|
this.yearPage.current = page
|
this.getYearPlanList()
|
},
|
handleYearSizeChange(size) {
|
this.yearPage.size = size
|
this.getYearPlanList()
|
},
|
// 年明细计划分页
|
handleYearDetailCurrent(page) {
|
this.yearDetailPage.current = page
|
this.getYearDetailPlanList()
|
},
|
handleYearDetailSizeChange(size) {
|
this.yearDetailPage.size = size
|
this.getYearDetailPlanList()
|
},
|
},
|
// 用于上传文件的信息
|
computed: {
|
headers() {
|
return {
|
'token': sessionStorage.getItem('token')
|
}
|
},
|
action() {
|
return this.javaApi + this.$api.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>
|