|
|
@@ -0,0 +1,161 @@
|
|
|
+<template>
|
|
|
+ <ele-modal
|
|
|
+ title="送货单"
|
|
|
+ :visible.sync="QRvisible"
|
|
|
+ v-if="QRvisible"
|
|
|
+ width="90%"
|
|
|
+ >
|
|
|
+ <div
|
|
|
+ id="printSection"
|
|
|
+ style="
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ flex-direction: column;
|
|
|
+ "
|
|
|
+ >
|
|
|
+ <div>
|
|
|
+ <div
|
|
|
+ style="
|
|
|
+ font-size: 20px;
|
|
|
+ font-weight: 800;
|
|
|
+ padding-right: 20px;
|
|
|
+ width: 400px;
|
|
|
+ margin: 0 auto;
|
|
|
+ "
|
|
|
+ >{{ companyInfo?.name }}到货退厂单</div
|
|
|
+ >
|
|
|
+ </div>
|
|
|
+ <!-- 表头信息 -->
|
|
|
+ <div style="width: 100%; margin-bottom: 10px; margin-top: 20px;">
|
|
|
+ <table cellspacing="0" style="width: 100%; font-size: 12px;">
|
|
|
+ <tbody>
|
|
|
+ <tr>
|
|
|
+ <td style="text-align: right; padding: 3px;">供应商:</td>
|
|
|
+ <td style="padding: 3px; width: 150px;">{{ formData.supplierName || '' }}</td>
|
|
|
+ <td style="text-align: right; padding: 3px;">单据日期:</td>
|
|
|
+ <td style="padding: 3px; width: 150px;">{{ formData.createTime || '' }}</td>
|
|
|
+ <td style="text-align: right; padding: 3px;">单据编号:</td>
|
|
|
+ <td style="padding: 3px;">{{ formData.returnNo }}</td>
|
|
|
+ </tr>
|
|
|
+ </tbody>
|
|
|
+ </table>
|
|
|
+ </div>
|
|
|
+ <table
|
|
|
+ cellspacing="0"
|
|
|
+ border
|
|
|
+ style="
|
|
|
+ width: 100%;
|
|
|
+ table-layout: fixed;
|
|
|
+ word-break: break-all;
|
|
|
+ word-wrap: break-word;
|
|
|
+ font-size: 12px;
|
|
|
+ "
|
|
|
+ >
|
|
|
+ <tbody>
|
|
|
+ <tr align="center">
|
|
|
+ <td style="padding: 5px; width: 100px"> 物料编码 </td>
|
|
|
+ <td style="padding: 5px"> 物料名称 </td>
|
|
|
+ <td style="padding: 5px"> 厂家批号/灭菌批号 </td>
|
|
|
+ <td style="padding: 5px;"> 物料批号 </td>
|
|
|
+ <td style="padding: 5px;"> 规格型号 </td>
|
|
|
+ <td style="padding: 5px;"> 单位 </td>
|
|
|
+ <td style="padding: 5px;"> 数量 </td>
|
|
|
+ </tr>
|
|
|
+
|
|
|
+ <tr align="center" v-for="(item, index) in formData.productList">
|
|
|
+ <td style="padding: 5px"> {{ item.productCode || '' }} </td>
|
|
|
+ <td style="padding: 5px"> {{ item.productName }} </td>
|
|
|
+ <td style="padding: 5px"> </td>
|
|
|
+ <td style="padding: 5px"> {{ item.batchNo || '' }}</td>
|
|
|
+ <td style="padding: 5px"> {{ item.specification }}/{{ item.modelType }}</td>
|
|
|
+ <td style="padding: 5px"> {{ item.measuringUnit }}</td>
|
|
|
+ <td style="padding: 5px"> {{ item.totalCount }} </td>
|
|
|
+ </tr>
|
|
|
+ </tbody>
|
|
|
+ </table>
|
|
|
+ <!-- 联系信息 -->
|
|
|
+ <div style="width: 100%; margin-top: 10px; font-size: 12px; display: flex; align-items: center;">
|
|
|
+ <div style="width: 33%;">制单:{{ formData.makerName }}</div>
|
|
|
+ <div style="width: 33%;">审核人:{{ formData.reviewerName }}</div>
|
|
|
+ <div style="width: 33%;">收货人:{{ formData.linkName }}</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div slot="footer">
|
|
|
+ <el-button @click="print">打印预览</el-button>
|
|
|
+ <el-button @click="close">关闭</el-button>
|
|
|
+ </div>
|
|
|
+ </ele-modal>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+ import { getReturnSaleOrderrecordDetail } from '@/api/purchasingManage/returnGoods';
|
|
|
+ import { mapGetters } from 'vuex';
|
|
|
+ import { convertToChinese as numToChinese } from '@/utils/util';
|
|
|
+ export default {
|
|
|
+ name: 'print',
|
|
|
+ computed: {
|
|
|
+ ...mapGetters(['user'])
|
|
|
+ },
|
|
|
+ props: {
|
|
|
+ groupName: '',
|
|
|
+ companyInfo: {}
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ checked: '',
|
|
|
+ QRvisible: false,
|
|
|
+ formData: {}
|
|
|
+ };
|
|
|
+ },
|
|
|
+
|
|
|
+ methods: {
|
|
|
+ async open(id) {
|
|
|
+ console.log('this.companyInfo',this.companyInfo)
|
|
|
+ this.formData = await getReturnSaleOrderrecordDetail(id);
|
|
|
+ this.QRvisible = true;
|
|
|
+ //包装维度
|
|
|
+ },
|
|
|
+ close() {
|
|
|
+ this.QRvisible = false;
|
|
|
+ },
|
|
|
+ getTotalValue(key, num) {
|
|
|
+ let val = this.formData?.productList?.reduce((total, item) => {
|
|
|
+ return (total += Number(item[key] || 0));
|
|
|
+ }, 0);
|
|
|
+
|
|
|
+ return (
|
|
|
+ (val &&
|
|
|
+ parseFloat(val)
|
|
|
+ .toFixed(num)
|
|
|
+ .replace(/\.?0+$/, '')) ||
|
|
|
+ 0
|
|
|
+ );
|
|
|
+ },
|
|
|
+ // 将导入的函数添加到methods中,使其在模板中可用
|
|
|
+ convertToChinese(num) {
|
|
|
+ return numToChinese(num);
|
|
|
+ },
|
|
|
+ print() {
|
|
|
+ const printSection = document.getElementById('printSection');
|
|
|
+ // 创建打印任务
|
|
|
+ const printWindow = window.open('', '_blank');
|
|
|
+ printWindow.document.open();
|
|
|
+ printWindow.document.write('<html><head><title>打印预览</title>');
|
|
|
+ printWindow.document.write(
|
|
|
+ '<link rel="stylesheet" href="your-stylesheet-url.css" type="text/css" />'
|
|
|
+ );
|
|
|
+ printWindow.document.write('</head><body>');
|
|
|
+ printWindow.document.write(printSection.innerHTML);
|
|
|
+ printWindow.document.write('</body></html>');
|
|
|
+ printWindow.document.close();
|
|
|
+ printWindow.onload = function () {
|
|
|
+ printWindow.print();
|
|
|
+ };
|
|
|
+ }
|
|
|
+ }
|
|
|
+ };
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss"></style>
|