Преглед изворни кода

聚仁发货单打印模板优化及创建人字段添加

yusheng пре 10 месеци
родитељ
комит
7b8f95328f

+ 7 - 0
src/views/purchasingManage/purchasePlanManage/index.vue

@@ -376,6 +376,13 @@
             showOverflowTooltip: true,
             minWidth: 180
           },
+          {
+            prop: 'createUserName',
+            label: '创建人',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 180
+          },
           {
             prop: 'status',
             label: '状态',

+ 0 - 4
src/views/saleManage/saleOrder/invoice/components/addInvoiceDialog.vue

@@ -196,12 +196,10 @@
 </template>
 
 <script>
-  import { treeClassifyCodeEnum } from '@/enum/dict';
   import fileUpload from '@/components/upload/fileUpload';
   import dictMixins from '@/mixins/dictMixins';
   import parentList from '@/views/saleManage/contact/components/parentList.vue';
   import {
-    getSaleOrderDetail,
     getSaleOrderDetails
   } from '@/api/saleManage/saleorder';
   import taskInfoTable from './taskInfoTable.vue';
@@ -209,10 +207,8 @@
     addSendInformation,
     UpdateSendInformation,
     getSendSaleOrderrecordDetailSplit,
-    submit
   } from '@/api/saleManage/saleordersendrecord';
   import { getPSaleEntrustedReceiveDetailAPI } from '@/api/saleManage/entrustedReceive';
-  import { getcontactlink } from '@/api/saleManage/businessFollow';
   import inventoryTable from './inventoryTable.vue';
   import replaceTable from './replaceTable.vue';
   import stowageTable from './stowageTable.vue';

+ 10 - 2
src/views/saleManage/saleOrder/invoice/components/inventoryTable.vue

@@ -201,7 +201,13 @@
       <template v-slot:warehouseId="scope">
         <el-form-item
           :prop="'datasource.' + scope.$index + '.warehouseId'"
-          :rules="[{ required: isWarehouseId==1?true:false, message: '请选择仓库', trigger: 'blur' }]"
+          :rules="[
+            {
+              required: isWarehouseId == 1 ? true : false,
+              message: '请选择仓库',
+              trigger: 'blur'
+            }
+          ]"
         >
           <el-select
             v-model="scope.row.warehouseId"
@@ -273,7 +279,9 @@
         <span class="is-required">{{ column.label }}</span>
       </template>
       <template v-slot:headerWarehouseId="{ column }">
-        <span :class="isWarehouseId==1?'is-required':''">{{ column.label }}</span>
+        <span :class="isWarehouseId == 1 ? 'is-required' : ''">{{
+          column.label
+        }}</span>
       </template>
       <template v-slot:headerTotalCount="{ column }">
         <span class="is-required">{{ column.label }}</span>

+ 1 - 23
src/views/saleManage/saleOrder/invoice/components/palletTable.vue

@@ -78,26 +78,7 @@
         </el-popconfirm>
       </template>
     </ele-pro-table>
-    <!--    <product-list-->
-    <!--      ref="productListRef"-->
-    <!--      :orderId="orderId"-->
-    <!--      type="purchase"-->
-    <!--      @changeParent="changeParent"-->
-    <!--    ></product-list>-->
-    <!--    &lt;!&ndash;入库详情&ndash;&gt;-->
-    <!--    <innertboundDetailsDialog-->
-    <!--      v-if="innerboundDetailsDialogFlag"-->
-    <!--      ref="innerboundDetailsDialogRef"-->
-    <!--      :innerboundDetailsDialogFlag.sync="innerboundDetailsDialogFlag"-->
-    <!--      @saveDate="saveInnerDate"-->
-    <!--    ></innertboundDetailsDialog>-->
-    <!--    &lt;!&ndash; 库存台账   &ndash;&gt;-->
-    <!--    <stock-ledger-dialog-->
-    <!--      v-if="stockLedgerDialogFlag"-->
-    <!--      :stock-ledger-dialog-flag.sync="stockLedgerDialogFlag"-->
-    <!--      ref="stockLedgerDialogRef"-->
-    <!--      @getStockLedger="getStockLedger"-->
-    <!--    ></stock-ledger-dialog>-->
+
     <select-stock-ledger-dialog
       ref="selectStockLedgerDialogRef"
       @changeParent="changeParent"
@@ -112,12 +93,9 @@
     getWarehouseList,
     getWarehouseOutStock
   } from '@/api/saleManage/saleorder';
-
-  import { copyObj } from '@/utils/util';
   import { getFile } from '@/api/system/file';
   import innertboundDetailsDialog from '@/BIZComponents/innerboundDetailsDialog.vue';
   import stockLedgerDialog from './stockLedger/stockLedgerDialog.vue';
-  import { fieldModelAPI } from '@/api/main';
   import getDynamicsColumns from '@/mixins/getDynamicsColumns';
   import SelectStockLedgerDialog from '@/BIZComponents/selectStockLedger/selectStockLedgerDialog.vue';
   export default {

+ 10 - 6
src/views/saleManage/saleOrder/invoice/components/print-template-by.vue

@@ -128,11 +128,7 @@
           <tr align="center">
             <td colspan="4" style="padding: 1px"> 合计 </td>
             <td colspan="1" style="padding: 1px">
-              {{
-                codeList.reduce((total, item) => {
-                  return (total += item.totalCount);
-                }, 0)
-              }}
+              {{ getTotalValue('totalCount', 4) }}
             </td>
             <td style="padding: 1px"></td>
             <td colspan="2" style="padding: 1px"></td>
@@ -149,7 +145,9 @@
             <td colspan="3" style="padding: 1px">
               注意事项:遗失托盘赔偿260/个
             </td>
-            <td colspan="2" style="padding: 1px"> 装车托盘数:</td>
+            <td colspan="2" style="padding: 1px">
+              装车托盘数:{{ formData.trayNum }}</td
+            >
             <td style="padding: 1px"></td>
             <td style="padding: 1px"> 带回托盘数: </td>
             <td :colspan="isPrintPrice ? 3 : 1" style="padding: 1px"></td>
@@ -284,6 +282,12 @@
       close() {
         this.QRvisible = false;
       },
+      getTotalValue(key, num) {
+        let val = this.codeList.reduce((total, item) => {
+          return (total += item[key]);
+        }, 0);
+        return val.toFixed(4).replace(/\.?0+$/, '');
+      },
       //获取当前日期函数
       getNowFormatDate() {
         let date = new Date(),

+ 156 - 126
src/views/saleManage/saleOrder/invoice/components/print-template-jr.vue

@@ -1,137 +1,146 @@
 <template>
   <ele-modal title="出库单" :visible.sync="QRvisible" width="90%">
-    <div
-      id="printSection"
-      style="
-        display: flex;
-        align-items: center;
-        justify-content: center;
-        flex-direction: column;
-        width: 1134px;
-        height: 415px;
-      "
-    >
-      <div style="height: 20px; width: 800px"> </div>
+    <div id="printSection">
       <div
-        style="width: 100%; font-size: 12px; display: flex; margin-bottom: 10px"
-      >
-        <span style="width: 48%">
-          <span style="width: 60px; display: inline-block">购货单位:</span>
-          {{ formData.contactName }}
-        </span>
-        <span>
-          <span style="width: 60px; display: inline-block">单据编码:</span>
-          {{ formData.docNo }}
-        </span>
-      </div>
-      <div
-        style="width: 100%; font-size: 12px; display: flex; margin-bottom: 10px"
-      >
-        <span style="width: 48%">
-          <span style="width: 170px; display: inline-block"
-            >生产厂家/上市许可持有人:</span
-          >
-          湖南聚仁中药饮片有限公司
-        </span>
-        <span style="width: 17%">
-          <span style="width: 60px; display: inline-block">发货仓库</span>
-          {{ formData.docNo }}
-        </span>
-        <span style="width: 17%">
-          <span style="width: 60px; display: inline-block">发货日期</span>
-          {{ formData.createTime }}
-        </span>
-        <span style="width: 17%">
-          <span style="width: 60px; display: inline-block">总计金额</span>
-          ¥{{ formData.totalPrice }}
-        </span>
-      </div>
-      <table
-        cellspacing="0"
-        border
+        class="print"
         style="
-          width: 100%;
-          height: 190px;
-          table-layout: fixed;
-          word-break: break-all;
-          word-wrap: break-word;
-          font-size: 12px;
-        "
-      >
-        <tbody>
-          <tr align="center" style="height: 30px">
-            <td style="width: 70px"> 商品编号 </td>
-            <td style="width: 70px"> 品名 </td>
-            <td style="width: 70px"> 规格 </td>
-            <td style="width: 70px"> 产地</td>
-            <td style="width: 40px"> 单位</td>
-            <td style="width: 60px"> 数量</td>
-            <td style="width: 60px"> 单价</td>
-            <td style="width: 75px"> 金额</td>
-            <td style="width: 90px"> 批号</td>
-            <td style="width: 85px"> 生产日期</td>
-            <td style="width: 85px"> 保质期至</td>
-            <td> 贮藏</td>
-            <td> 备注</td>
-          </tr>
-          <tr
-            align="center"
-            style="height: 22px"
-            v-for="(item, index) in [{}, {}, {}, {}, {}, {}]"
-          >
-            <td> {{ item.productCode }} </td>
-            <td> {{ item.productName }} </td>
-            <td> {{ item.totalWeight }}</td>
-            <td> {{ item.totalCount }}</td>
-            <td> {{ item.remark }}</td>
-            <td> {{ item.remark }}</td>
-            <td> {{ item.remark }}</td>
-            <td> {{ item.remark }}</td>
-            <td> {{ item.remark }}</td>
-            <td> {{ item.remark }}</td>
-            <td> {{ item.remark }}</td>
-            <td> {{ item.remark }}</td>
-            <td> {{ item.remark }}</td>
-          </tr>
-          <tr align="center" style="height: 30px">
-            <td :colspan="5">
-              <div style="margin-left: 35px"></div>
-            </td>
-            <td :colspan="3">
-              <div style="margin-left: 65px"></div>
-            </td>
-            <td :colspan="5">
-              <div style="margin-left: 65px"></div>
-            </td>
-          </tr>
-        </tbody>
-      </table>
-      <div
-        style="
-          width: 100%;
-          font-size: 12px;
           display: flex;
-          justify-content: space-between;
-          margin-top: 10px;
+          align-items: center;
+          justify-content: center;
+          flex-direction: column;
         "
       >
-        <div style="flex: 1">
-          <div>开票员:</div>
-        </div>
-        <div style="flex: 1">
-          <div>业务员:</div>
+        <div
+          style="
+            width: 100%;
+            font-size: 12px;
+            display: flex;
+            margin-bottom: 10px;
+          "
+        >
+          <span style="width: 48%">
+            <span style="width: 60px; display: inline-block">购货单位:</span>
+            {{ formData.contactName }}
+          </span>
+          <span>
+            <span style="width: 60px; display: inline-block">单据编码:</span>
+            {{ formData.docNo }}
+          </span>
         </div>
-         <div style="flex: 1">
-          <div>发货员:</div>
+        <div
+          style="
+            width: 100%;
+            font-size: 12px;
+            display: flex;
+            margin-bottom: 10px;
+          "
+        >
+          <span style="width: 48%">
+            <span style="width: 170px; display: inline-block"
+              >生产厂家/上市许可持有人:</span
+            >
+            湖南聚仁中药饮片有限公司
+          </span>
+          <span style="width: 17%">
+            <span style="width: 60px; display: inline-block">发货仓库</span>
+            成品仓
+          </span>
+          <span style="width: 17%">
+            <span style="width: 60px; display: inline-block">发货日期</span>
+            2025-01-01  
+          </span>
+          <span style="width: 17%">
+            <span style="width: 60px; display: inline-block">总计金额</span>
+            ¥{{ formData.totalPrice }}
+          </span>
         </div>
+        <table
+          cellspacing="0"
+          border
+          style="
+            width: 100%;
+            height: 190px;
+            table-layout: fixed;
+            word-break: break-all;
+            word-wrap: break-word;
+            font-size: 12px;
+          "
+        >
+          <tbody>
+            <tr align="center" style="height: 30px">
+              <td style="width: 6%"> 商品编号 </td>
+              <td style="width: 6%"> 品名 </td>
+              <td style="width: 6%"> 规格 </td>
+              <td style="width: 6%"> 产地</td>
+              <td style="width: 3%"> 单位</td>
+              <td style="width: 6%"> 数量</td>
+              <td style="width: 7%"> 单价</td>
+              <td style="width: 7%"> 金额</td>
+              <td style="width: 8%"> 批号</td>
+              <td style="width: 8%"> 生产日期</td>
+              <td style="width: 8%"> 保质期至</td>
+              <td> 贮藏</td>
+              <td> 备注</td>
+            </tr>
+            <tr
+              align="center"
+              style="height: 22px"
+              v-for="(item, index) in [{}, {}, {}, {}, {}, {}]"
+            >
+              <td> {{ item.productCode }} </td>
+              <td> {{ item.productName }} </td>
+              <td> {{ item.totalWeight }}</td>
+              <td> {{ item.totalCount }}</td>
+              <td> {{ item.remark }}</td>
+              <td> {{ item.remark }}</td>
+              <td> {{ item.remark }}</td>
+              <td> {{ item.remark }}</td>
+              <td> {{ item.remark }}</td>
+              <td> {{ item.remark }}</td>
+              <td> {{ item.remark }}</td>
+              <td> {{ item.remark }}</td>
+              <td> {{ item.remark }}</td>
+            </tr>
+            <tr align="center" style="height: 30px">
+              <td :colspan="5">
+                <div style="margin-left: 35px"></div>
+              </td>
+              <td :colspan="3">
+                <div style="margin-left: 65px"></div>
+              </td>
+              <td :colspan="5">
+                <div style="margin-left: 65px"></div>
+              </td>
+            </tr>
+          </tbody>
+        </table>
+        <div
+          style="
+            width: 100%;
+            font-size: 12px;
+            display: flex;
+            justify-content: space-between;
+            margin-top: 10px;
+          "
+        >
           <div style="flex: 1">
-          <div>收货方:</div>
-        </div>
+            <div>开票员:</div>
+          </div>
           <div style="flex: 1">
-          <div>质量状况:</div>
-        </div>
+            <div>业务员:</div>
+          </div>
+          <div style="flex: 1">
+            <div>发货员:</div>
+          </div>
+          <div style="flex: 1">
+            <div>收货方:</div>
+          </div>
+          <div style="flex: 1">
+            <div>质量状况:</div>
+          </div>
           <div style="flex: 1">
-          <div>提货方式:</div>
+            <div>提货方式:</div>
+          </div>
         </div>
       </div>
     </div>
@@ -202,9 +211,19 @@
         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(`<style>
+    @media print {
+      .print{
+        page-break-before: always !important;
+        page-break-inside: avoid !important;
+      };
+       @page {
+      size: 200cm 11cm;
+        }
+       }
+  
+  </style>`);
+
         printWindow.document.write('</head><body>');
         printWindow.document.write(printSection.innerHTML);
         printWindow.document.write('</body></html>');
@@ -217,4 +236,15 @@
   };
 </script>
 
-<style lang="scss"></style>
+<style>
+  @media print {
+    .print {
+      page-break-before: always !important;
+      page-break-inside: avoid !important;
+    }
+    @page {
+      size: 30cm 11cm;
+      margin: 0;
+    }
+  }
+</style>