|
@@ -7,8 +7,22 @@
|
|
|
append-to-body
|
|
append-to-body
|
|
|
:before-close="cancel"
|
|
:before-close="cancel"
|
|
|
:maxable="true"
|
|
:maxable="true"
|
|
|
- >
|
|
|
|
|
- <div id="printSection" style="padding: 20px; background-color: white;">
|
|
|
|
|
|
|
+ >
|
|
|
|
|
+ <div v-if="isView && processInstanceId" class="switch">
|
|
|
|
|
+ <div class="switch_left">
|
|
|
|
|
+ <ul>
|
|
|
|
|
+ <li
|
|
|
|
|
+ v-for="item in tabOptions"
|
|
|
|
|
+ :key="item.key"
|
|
|
|
|
+ :class="{ active: activeComp == item.key }"
|
|
|
|
|
+ @click="activeComp = item.key"
|
|
|
|
|
+ >
|
|
|
|
|
+ {{ item.name }}
|
|
|
|
|
+ </li>
|
|
|
|
|
+ </ul>
|
|
|
|
|
+ </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>
|
|
<h1 style="text-align: center; font-size: 24px; margin-bottom: 20px; font-weight: bold;">质检报告</h1>
|
|
|
|
|
|
|
|
<!-- 编号和报告单号 -->
|
|
<!-- 编号和报告单号 -->
|
|
@@ -206,6 +220,10 @@
|
|
|
</el-row>
|
|
</el-row>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+ <bpmDetail
|
|
|
|
|
+ v-if="activeComp === 'bpm' && processInstanceId"
|
|
|
|
|
+ :id="processInstanceId"
|
|
|
|
|
+ ></bpmDetail>
|
|
|
<template v-slot:footer>
|
|
<template v-slot:footer>
|
|
|
<el-button v-if="isView" type="primary" @click="print" v-loading="loading">打印</el-button>
|
|
<el-button v-if="isView" type="primary" @click="print" v-loading="loading">打印</el-button>
|
|
|
<el-button v-if="!isView" type="primary" @click="save" v-loading="loading">确认</el-button>
|
|
<el-button v-if="!isView" type="primary" @click="save" v-loading="loading">确认</el-button>
|
|
@@ -215,7 +233,9 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
- import { queryInspectionReportData, queryInspectionReportList, generateReport } from '@/api/inspectionReport';
|
|
|
|
|
|
|
+import { queryInspectionReportData, queryInspectionReportList, generateReport } from '@/api/inspectionReport';
|
|
|
|
|
+import bpmDetail from '@/views/bpm/processInstance/detail.vue';
|
|
|
|
|
+import { getDetailById } from '@/api/inspectionWork/index';
|
|
|
export default {
|
|
export default {
|
|
|
name: 'QualityReport',
|
|
name: 'QualityReport',
|
|
|
props: {
|
|
props: {
|
|
@@ -236,18 +256,27 @@ export default {
|
|
|
default: () => {}
|
|
default: () => {}
|
|
|
},
|
|
},
|
|
|
},
|
|
},
|
|
|
|
|
+ components: {
|
|
|
|
|
+ bpmDetail
|
|
|
|
|
+ },
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
- // visible: false,
|
|
|
|
|
- loading: false,
|
|
|
|
|
- currentRow: {}, // 存储当前行数据
|
|
|
|
|
- templateItem: {}, // 存储当前模板项数据
|
|
|
|
|
- // 基本信息数据
|
|
|
|
|
- basicInfoData: {},
|
|
|
|
|
-
|
|
|
|
|
- // 检验项目
|
|
|
|
|
- inspectionItems: [],
|
|
|
|
|
-
|
|
|
|
|
|
|
+ // visible: false,
|
|
|
|
|
+ loading: false,
|
|
|
|
|
+ currentRow: {}, // 存储当前行数据
|
|
|
|
|
+ templateItem: {}, // 存储当前模板项数据
|
|
|
|
|
+ // 基本信息数据
|
|
|
|
|
+ basicInfoData: {},
|
|
|
|
|
+
|
|
|
|
|
+ // 检验项目
|
|
|
|
|
+ inspectionItems: [],
|
|
|
|
|
+ tabOptions: [
|
|
|
|
|
+ { key: 'main', name: '业务详情' },
|
|
|
|
|
+ { key: 'bpm', name: '流程详情' }
|
|
|
|
|
+ ],
|
|
|
|
|
+ activeComp: 'main',
|
|
|
|
|
+ processInstanceId: '',
|
|
|
|
|
+ reportApprovalTaskVos: [],
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
watch: {
|
|
watch: {
|
|
@@ -255,6 +284,7 @@ export default {
|
|
|
handler: function (val) {
|
|
handler: function (val) {
|
|
|
console.log('visible~~~', val);
|
|
console.log('visible~~~', val);
|
|
|
if (val) {
|
|
if (val) {
|
|
|
|
|
+ // this.getProcessInstance();
|
|
|
this.open(this.row, this.item);
|
|
this.open(this.row, this.item);
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
@@ -267,18 +297,35 @@ export default {
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
/* 打开质检报告 */
|
|
/* 打开质检报告 */
|
|
|
- open(row, item) {
|
|
|
|
|
|
|
+ async open(row, item) {
|
|
|
this.currentRow = row;
|
|
this.currentRow = row;
|
|
|
this.templateItem = item || row;
|
|
this.templateItem = item || row;
|
|
|
console.log('currentRow~~~', this.currentRow, this.templateItem);
|
|
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;
|
|
// this.visible = true;
|
|
|
if(this.currentRow.reportTemplateJson?.basicInfoData) {
|
|
if(this.currentRow.reportTemplateJson?.basicInfoData) {
|
|
|
this.basicInfoData = this.currentRow.reportTemplateJson.basicInfoData || {};
|
|
this.basicInfoData = this.currentRow.reportTemplateJson.basicInfoData || {};
|
|
|
this.inspectionItems = this.currentRow.reportTemplateJson.inspectionItems || [];
|
|
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, '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 {
|
|
} else {
|
|
|
this.getBasicInfo();
|
|
this.getBasicInfo();
|
|
|
this.getInspectionItems();
|
|
this.getInspectionItems();
|
|
@@ -287,9 +334,17 @@ export default {
|
|
|
getBasicInfo() {
|
|
getBasicInfo() {
|
|
|
queryInspectionReportData(this.currentRow.id).then(res => {
|
|
queryInspectionReportData(this.currentRow.id).then(res => {
|
|
|
this.basicInfoData = 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, '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() {
|
|
getInspectionItems() {
|
|
@@ -297,6 +352,12 @@ export default {
|
|
|
this.inspectionItems = res;
|
|
this.inspectionItems = res;
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
|
|
+ getProcessInstance() {
|
|
|
|
|
+ getDetailById(this.row.id).then(res => {
|
|
|
|
|
+ console.log('res~~~~', res);
|
|
|
|
|
+ this.processInstanceId = res.data.reportProcessInstanceId;
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
cancel() {
|
|
cancel() {
|
|
|
// this.visible = false;
|
|
// this.visible = false;
|
|
|
this.$emit('update:visible', false);
|
|
this.$emit('update:visible', false);
|