|
@@ -82,7 +82,7 @@
|
|
|
<span class="info-label">检验日期:</span>
|
|
<span class="info-label">检验日期:</span>
|
|
|
<span class="info-value">{{ qualityInfo.inspectionTime || '-' }}</span>
|
|
<span class="info-value">{{ qualityInfo.inspectionTime || '-' }}</span>
|
|
|
</div>
|
|
</div>
|
|
|
- <div class="info-item">
|
|
|
|
|
|
|
+ <!-- <div class="info-item">
|
|
|
<span class="info-label">复核人:</span>
|
|
<span class="info-label">复核人:</span>
|
|
|
<span class="info-value">{{ qualityInfo.reviewer || '-' }}</span>
|
|
<span class="info-value">{{ qualityInfo.reviewer || '-' }}</span>
|
|
|
</div>
|
|
</div>
|
|
@@ -97,11 +97,18 @@
|
|
|
<div class="info-item">
|
|
<div class="info-item">
|
|
|
<span class="info-label">审核日期:</span>
|
|
<span class="info-label">审核日期:</span>
|
|
|
<span class="info-value">{{ qualityInfo.approvedDate || '-' }}</span>
|
|
<span class="info-value">{{ qualityInfo.approvedDate || '-' }}</span>
|
|
|
- </div>
|
|
|
|
|
|
|
+ </div> -->
|
|
|
<div class="images-section">
|
|
<div class="images-section">
|
|
|
<span class="section-subtitle">报告单:</span>
|
|
<span class="section-subtitle">报告单:</span>
|
|
|
<div class="images-grid">
|
|
<div class="images-grid">
|
|
|
<!-- <img class="detail-image" :src="detailImageSrc" alt="质检报告单"> -->
|
|
<!-- <img class="detail-image" :src="detailImageSrc" alt="质检报告单"> -->
|
|
|
|
|
+ <div v-if="template">
|
|
|
|
|
+ <div v-html="template"> </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <!-- <browse v-else :url="fileUrl"></browse> -->
|
|
|
|
|
+ <div v-else class="report-template-container">
|
|
|
|
|
+ <reportTemplate :templateInfo="this.qualityInfo"></reportTemplate>
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
@@ -117,8 +124,16 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
|
|
+// import browse from '@/components/jimureport/browse.vue';
|
|
|
|
|
+// import { getJmPrintViewUrl } from '@/components/jimureport//api.js';
|
|
|
|
|
+// import { getToken } from '@/utils/token-util';
|
|
|
|
|
+import reportTemplate from '@/views/traceability/traceabilityCode/reportTemplate.vue';
|
|
|
export default {
|
|
export default {
|
|
|
name: 'QualityTraceabilityPage',
|
|
name: 'QualityTraceabilityPage',
|
|
|
|
|
+ components: {
|
|
|
|
|
+ // browse,
|
|
|
|
|
+ reportTemplate,
|
|
|
|
|
+ },
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
// 使用项目中已有的图标路径
|
|
// 使用项目中已有的图标路径
|
|
@@ -127,9 +142,11 @@ export default {
|
|
|
detail: {},
|
|
detail: {},
|
|
|
purchaseInfo: {},
|
|
purchaseInfo: {},
|
|
|
qualityInfo: {},
|
|
qualityInfo: {},
|
|
|
|
|
+ fileUrl: '',
|
|
|
|
|
+ template: '',
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
- mounted() {
|
|
|
|
|
|
|
+ async mounted() {
|
|
|
console.log('路由参数:');
|
|
console.log('路由参数:');
|
|
|
console.log('路由参数:', this.$route.query);
|
|
console.log('路由参数:', this.$route.query);
|
|
|
// 从路由参数中获取detail对象
|
|
// 从路由参数中获取detail对象
|
|
@@ -140,6 +157,13 @@ export default {
|
|
|
console.log('获取到的detail参数:', this.detail);
|
|
console.log('获取到的detail参数:', this.detail);
|
|
|
this.purchaseInfo = this.detail.purchaseInfo || {};
|
|
this.purchaseInfo = this.detail.purchaseInfo || {};
|
|
|
this.qualityInfo = this.detail.qualityInfo || {};
|
|
this.qualityInfo = this.detail.qualityInfo || {};
|
|
|
|
|
+ if (this.qualityInfo.reportTemplateJson?.template) {
|
|
|
|
|
+ this.template = this.qualityInfo.reportTemplateJson.template;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ // let url = await getJmPrintViewUrl('qmsqualityinspectionprint');
|
|
|
|
|
+ // this.fileUrl = `${url}?token=${getToken()}&id=${this.qualityInfo.id}`;
|
|
|
|
|
+ // console.log('fileUrl~~~', this.fileUrl);
|
|
|
|
|
+ }
|
|
|
} catch (error) {
|
|
} catch (error) {
|
|
|
console.error('解析detail参数失败:', error);
|
|
console.error('解析detail参数失败:', error);
|
|
|
this.detail = {};
|
|
this.detail = {};
|
|
@@ -339,6 +363,29 @@ export default {
|
|
|
object-fit: cover;
|
|
object-fit: cover;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+.report-template-container {
|
|
|
|
|
+ overflow-x: auto;
|
|
|
|
|
+ white-space: nowrap;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.report-template-container::-webkit-scrollbar {
|
|
|
|
|
+ height: 8px;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.report-template-container::-webkit-scrollbar-track {
|
|
|
|
|
+ background: #f1f1f1;
|
|
|
|
|
+ border-radius: 4px;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.report-template-container::-webkit-scrollbar-thumb {
|
|
|
|
|
+ background: #c1c1c1;
|
|
|
|
|
+ border-radius: 4px;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.report-template-container::-webkit-scrollbar-thumb:hover {
|
|
|
|
|
+ background: #a8a8a8;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
.home-button {
|
|
.home-button {
|
|
|
position: fixed;
|
|
position: fixed;
|
|
|
bottom: 30px;
|
|
bottom: 30px;
|