|
|
@@ -8,7 +8,7 @@
|
|
|
:before-close="cancel"
|
|
|
:maxable="true"
|
|
|
>
|
|
|
- <!-- <div class="switch">
|
|
|
+ <div v-if="isView && processInstanceId" class="switch">
|
|
|
<div class="switch_left">
|
|
|
<ul>
|
|
|
<li
|
|
|
@@ -21,7 +21,7 @@
|
|
|
</li>
|
|
|
</ul>
|
|
|
</div>
|
|
|
- </div> -->
|
|
|
+ </div>
|
|
|
<div v-show="activeComp === 'main'" id="printSection" style="padding: 20px; background-color: white;">
|
|
|
<h1 style="text-align: center; font-size: 24px; margin-bottom: 20px; font-weight: bold;">质检报告</h1>
|
|
|
|
|
|
@@ -221,8 +221,8 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<bpmDetail
|
|
|
- v-if="activeComp === 'bpm' && form.processInstance.id"
|
|
|
- :id="form.processInstance.id"
|
|
|
+ v-if="activeComp === 'bpm' && processInstanceId"
|
|
|
+ :id="processInstanceId"
|
|
|
></bpmDetail>
|
|
|
<template v-slot:footer>
|
|
|
<el-button v-if="isView" type="primary" @click="print" v-loading="loading">打印</el-button>
|
|
|
@@ -235,6 +235,7 @@
|
|
|
<script>
|
|
|
import { queryInspectionReportData, queryInspectionReportList, generateReport } from '@/api/inspectionReport';
|
|
|
import bpmDetail from '@/views/bpm/processInstance/detail.vue';
|
|
|
+import { getDetailById } from '@/api/inspectionWork/index';
|
|
|
export default {
|
|
|
name: 'QualityReport',
|
|
|
props: {
|
|
|
@@ -274,6 +275,8 @@ export default {
|
|
|
{ key: 'bpm', name: '流程详情' }
|
|
|
],
|
|
|
activeComp: 'main',
|
|
|
+ processInstanceId: '',
|
|
|
+ reportApprovalTaskVos: [],
|
|
|
}
|
|
|
},
|
|
|
watch: {
|
|
|
@@ -281,6 +284,7 @@ export default {
|
|
|
handler: function (val) {
|
|
|
console.log('visible~~~', val);
|
|
|
if (val) {
|
|
|
+ // this.getProcessInstance();
|
|
|
this.open(this.row, this.item);
|
|
|
}
|
|
|
},
|
|
|
@@ -293,18 +297,35 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
/* 打开质检报告 */
|
|
|
- open(row, item) {
|
|
|
+ async open(row, item) {
|
|
|
this.currentRow = row;
|
|
|
this.templateItem = item || row;
|
|
|
console.log('currentRow~~~', this.currentRow, this.templateItem);
|
|
|
+
|
|
|
+ try {
|
|
|
+ const res =await getDetailById(this.row.id)
|
|
|
+ this.processInstanceId = res.data.reportProcessInstanceId;
|
|
|
+ this.reportApprovalTaskVos = res.data.reportApprovalTaskVos
|
|
|
+
|
|
|
+ } catch (error) {
|
|
|
+ console.log('error~~~~', error);
|
|
|
+ }
|
|
|
+
|
|
|
// this.visible = true;
|
|
|
if(this.currentRow.reportTemplateJson?.basicInfoData) {
|
|
|
this.basicInfoData = this.currentRow.reportTemplateJson.basicInfoData || {};
|
|
|
this.inspectionItems = this.currentRow.reportTemplateJson.inspectionItems || [];
|
|
|
|
|
|
+ const reviewTime = this.reportApprovalTaskVos?.[this.reportApprovalTaskVos.length - 2]?.endTime?.split(' ')[0] || '';
|
|
|
+ const approvedDate = this.reportApprovalTaskVos?.[this.reportApprovalTaskVos.length - 3]?.endTime?.split(' ')[0] || '';
|
|
|
+ const reviewer = this.reportApprovalTaskVos?.[this.reportApprovalTaskVos.length - 2]?.approvalUserName || '';
|
|
|
+ const checker = this.reportApprovalTaskVos?.[this.reportApprovalTaskVos.length - 3]?.approvalUserName || '';
|
|
|
+
|
|
|
this.$set(this.basicInfoData, 'inspectionTime', this.basicInfoData.inspectionTime?.split(' ')[0] || '');
|
|
|
- this.$set(this.basicInfoData, 'reviewTime', this.basicInfoData.reviewTime?.split(' ')[0] || '');
|
|
|
- this.$set(this.basicInfoData, 'approvedDate', this.basicInfoData.approvedDate?.split(' ')[0] || '');
|
|
|
+ this.$set(this.basicInfoData, 'reviewTime', this.basicInfoData.reviewTime?.split(' ')[0] || reviewTime || '');
|
|
|
+ this.$set(this.basicInfoData, 'approvedDate', this.basicInfoData.approvedDate?.split(' ')[0] || approvedDate || '');
|
|
|
+ this.$set(this.basicInfoData, 'reviewer', this.basicInfoData.reviewer || reviewer || '');
|
|
|
+ this.$set(this.basicInfoData, 'checker', this.basicInfoData.checker || checker || '');
|
|
|
} else {
|
|
|
this.getBasicInfo();
|
|
|
this.getInspectionItems();
|
|
|
@@ -313,9 +334,17 @@ export default {
|
|
|
getBasicInfo() {
|
|
|
queryInspectionReportData(this.currentRow.id).then(res => {
|
|
|
this.basicInfoData = res;
|
|
|
+
|
|
|
+ const reviewTime = this.reportApprovalTaskVos?.[this.reportApprovalTaskVos.length - 2]?.endTime?.split(' ')[0] || '';
|
|
|
+ const approvedDate = this.reportApprovalTaskVos?.[this.reportApprovalTaskVos.length - 3]?.endTime?.split(' ')[0] || '';
|
|
|
+ const reviewer = this.reportApprovalTaskVos?.[this.reportApprovalTaskVos.length - 2]?.approvalUserName || '';
|
|
|
+ const checker = this.reportApprovalTaskVos?.[this.reportApprovalTaskVos.length - 3]?.approvalUserName || '';
|
|
|
+
|
|
|
this.$set(this.basicInfoData, 'inspectionTime', this.basicInfoData.inspectionTime?.split(' ')[0] || '');
|
|
|
- this.$set(this.basicInfoData, 'reviewTime', this.basicInfoData.reviewTime?.split(' ')[0] || '');
|
|
|
- this.$set(this.basicInfoData, 'approvedDate', this.basicInfoData.approvedDate?.split(' ')[0] || '');
|
|
|
+ this.$set(this.basicInfoData, 'reviewTime', this.basicInfoData.reviewTime?.split(' ')[0] || reviewTime || '');
|
|
|
+ this.$set(this.basicInfoData, 'approvedDate', this.basicInfoData.approvedDate?.split(' ')[0] || approvedDate || '');
|
|
|
+ this.$set(this.basicInfoData, 'reviewer', this.basicInfoData.reviewer || reviewer || '');
|
|
|
+ this.$set(this.basicInfoData, 'checker', this.basicInfoData.checker || checker || '');
|
|
|
});
|
|
|
},
|
|
|
getInspectionItems() {
|
|
|
@@ -323,6 +352,12 @@ export default {
|
|
|
this.inspectionItems = res;
|
|
|
});
|
|
|
},
|
|
|
+ getProcessInstance() {
|
|
|
+ getDetailById(this.row.id).then(res => {
|
|
|
+ console.log('res~~~~', res);
|
|
|
+ this.processInstanceId = res.data.reportProcessInstanceId;
|
|
|
+ });
|
|
|
+ },
|
|
|
cancel() {
|
|
|
// this.visible = false;
|
|
|
this.$emit('update:visible', false);
|