152 lines
9.5 KiB
XML
152 lines
9.5 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<odoo>
|
|
|
|
<!-- 定义页眉模板 -->
|
|
<template id="report_quality_header">
|
|
<div class="header">
|
|
<div class="pdf-viewer-toolbar" style="display:flex;justify-content:space-between;">
|
|
<img src="/sf_quality/static/img/logo.png" style="max-height: 70px;" alt="Logo"/>
|
|
|
|
<div class="text-center" >
|
|
<h2 style="line-height: 133px;">出厂检验报告</h2>
|
|
</div>
|
|
<div style="padding-top: 20px;">
|
|
<!-- 使用公开访问URL的二维码 -->
|
|
<img t-att-src="'/report/barcode/QR/%s?width=100&height=100' % o.get_report_url()" style="width:80px;height:80px"/>
|
|
<div style="font-size: 14px;">
|
|
<strong>报告编号: </strong><span t-field="o.name"/>
|
|
</div>
|
|
<!-- 添加扫码提示 -->
|
|
<div style="font-size: 12px;">
|
|
<strong>扫描二维码查看PDF报告</strong>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
|
|
<!-- 定义页脚模板 -->
|
|
<template id="report_quality_footer">
|
|
<div class="footer">
|
|
<div class="row">
|
|
<p style="float: left;width: 50%;margin-bottom: 10px;">售后服务: <span t-field="o.company_id.phone"/></p>
|
|
<p style="float: left;width: 50%;margin-bottom: 10px;">公司名称: <span t-field="o.company_id.name"/></p>
|
|
<p style="float: left;width: 50%;margin-bottom: 10px;">公司网址: <span t-field="o.company_id.website"/></p>
|
|
<p style="float: left;width: 50%;margin-bottom: 10px;">公司邮箱: <span t-field="o.company_id.email"/></p>
|
|
<p style="float: left;width: 50%;margin-bottom: 10px;">加工工厂: <span t-field="o.company_id.factory_name"/></p>
|
|
</div>
|
|
<!-- <div class="text-center">
|
|
<span>第<span class="page"/> 页/共 <span class="topage"/>页</span>
|
|
</div> -->
|
|
</div>
|
|
</template>
|
|
<template id="report_quality_inspection">
|
|
<t t-call="web.html_container">
|
|
<t t-foreach="docs" t-as="o">
|
|
<t t-call="web.basic_layout">
|
|
<!-- 调用自定义页眉 -->
|
|
<t t-call="sf_quality.report_quality_header"/>
|
|
|
|
|
|
<div class="page">
|
|
<!-- <div class="col-6">
|
|
<div t-if="o.company_id.favicon" class="float-right">
|
|
<img t-att-src="image_data_uri(o.company_id.favicon)" style="max-height: 45px;" alt="Logo"/>
|
|
</div>
|
|
</div> -->
|
|
<!-- </div> -->
|
|
|
|
<table class="table table-sm o_main_table mt-4" style="border: 1px solid black;">
|
|
<tr>
|
|
<td style="width: 15%; border: 1px solid black;"><strong>产品名称:</strong></td>
|
|
<td style="width: 35%; border: 1px solid black;"><span t-field="o.product_id.name"/></td>
|
|
<td style="width: 15%; border: 1px solid black;"><strong>材料:</strong></td>
|
|
<td style="width: 35%; border: 1px solid black;"><span t-field="o.material_name"/></td>
|
|
</tr>
|
|
<tr>
|
|
<td style="border: 1px solid black;"><strong>图号:</strong></td>
|
|
<td style="border: 1px solid black;"><span t-field="o.part_number"/></td>
|
|
<td style="border: 1px solid black;"><strong>日期:</strong></td>
|
|
<td style="border: 1px solid black;"><span t-field="o.write_date"/></td>
|
|
</tr>
|
|
<tr>
|
|
<td style="border: 1px solid black;"><strong>总数量:</strong></td>
|
|
<td style="border: 1px solid black;"><span t-field="o.total_qty"/></td>
|
|
<td style="border: 1px solid black;"><strong>检验数量:</strong></td>
|
|
<td style="border: 1px solid black;"><span t-field="o.check_qty"/></td>
|
|
</tr>
|
|
</table>
|
|
|
|
<h4 class="text-center mt-4">检验结果</h4>
|
|
<div class="" style="position: relative;">
|
|
<table class="table table-sm mt-2" style="border: 1px solid black;">
|
|
<thead>
|
|
<tr>
|
|
<th style="border: 1px solid black;" class="text-center" rowspan="2">检测项目<br/>(图示尺寸)</th>
|
|
<th style="border: 1px solid black;" t-att-colspan="o.column_nums" class="text-center">测量值</th>
|
|
<th style="border: 1px solid black; vertical-align: middle;" class="text-center" rowspan="2">判定</th>
|
|
<th style="border: 1px solid black; vertical-align: middle;" class="text-center" rowspan="2">备注</th>
|
|
</tr>
|
|
<tr>
|
|
<!-- <th style="border: 1px solid black;"></th> -->
|
|
<th style="border: 1px solid black;" t-if="o.column_nums >= 1" class="text-center">1</th>
|
|
<th style="border: 1px solid black;" t-if="o.column_nums >= 2" class="text-center">2</th>
|
|
<th style="border: 1px solid black;" t-if="o.column_nums >= 3" class="text-center">3</th>
|
|
<th style="border: 1px solid black;" t-if="o.column_nums >= 4" class="text-center">4</th>
|
|
<th style="border: 1px solid black;" t-if="o.column_nums >= 5" class="text-center">5</th>
|
|
<!-- <th style="border: 1px solid black;"></th>
|
|
<th style="border: 1px solid black;"></th> -->
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr t-foreach="o.measure_line_ids" t-as="line">
|
|
<td style="border: 1px solid black;" class="text-center"><span t-field="line.measure_item"/></td>
|
|
<td style="border: 1px solid black;" t-if="o.column_nums >= 1" class="text-center"><span t-field="line.measure_value1"/></td>
|
|
<td style="border: 1px solid black;" t-if="o.column_nums >= 2" class="text-center"><span t-field="line.measure_value2"/></td>
|
|
<td style="border: 1px solid black;" t-if="o.column_nums >= 3" class="text-center"><span t-field="line.measure_value3"/></td>
|
|
<td style="border: 1px solid black;" t-if="o.column_nums >= 4" class="text-center"><span t-field="line.measure_value4"/></td>
|
|
<td style="border: 1px solid black;" t-if="o.column_nums >= 5" class="text-center"><span t-field="line.measure_value5"/></td>
|
|
<td style="border: 1px solid black;" class="text-center"><span t-field="line.measure_result"/></td>
|
|
<td style="border: 1px solid black;" class="text-center"><span t-field="line.remark"/></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<img src="/sf_quality/static/img/pass.png" style="width: 150px; height: 150px;position: absolute; bottom: 20px; right: 23%;"/>
|
|
|
|
</div>
|
|
<div class="row mt-4">
|
|
<div class="col-12">
|
|
<h5>检验结论:
|
|
<span t-if="o.report_result == 'OK'" style="margin-left: 20px;">☑ 合格</span>
|
|
<span t-else="" style="margin-left: 20px;">□ 合格</span>
|
|
<span t-if="o.report_result == 'NG'" style="margin-left: 40px;">☑ 不合格</span>
|
|
<span t-else="" style="margin-left: 40px;">□ 不合格</span>
|
|
</h5>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row mt-4">
|
|
<div class="col-6">
|
|
<p><strong>操作员: </strong> <span t-field="o.measure_operator"/></p>
|
|
</div>
|
|
<div class="col-6">
|
|
<p><strong>质检员: </strong> <span t-field="o.quality_manager"/></p>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 添加合格标签 -->
|
|
|
|
<div class="row mt-5">
|
|
<div class="col-12 text-center">
|
|
<p></p>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 调用自定义页脚 -->
|
|
<t t-call="sf_quality.report_quality_footer"/>
|
|
</div>
|
|
</t>
|
|
</t>
|
|
</t>
|
|
</template>
|
|
</odoo> |