yusheng před 9 měsíci
rodič
revize
e1cb5a682b

+ 203 - 0
src/views/saleManage/saleOrder/invoice/components/print-template-ht.vue

@@ -0,0 +1,203 @@
+<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;
+          "
+          >{{ groupName }}货物签收单</div
+        >
+      </div>
+      <div
+        style="
+          width: 100%;
+          font-size: 12px;
+          display: flex;
+          justify-content: space-between;
+          margin-bottom: 10px;
+        "
+      >
+        <span style="width: 50%">客户:{{ formData.contactName }}</span>
+        <span style="width: 25%">单据日期:{{ formData.createTime }}</span>
+        <span style="width: 45%">单据编码:{{ formData.docNo }}</span>
+      </div>
+      <div
+        style="
+          width: 100%;
+          font-size: 12px;
+          display: flex;
+          justify-content: space-between;
+          margin-bottom: 10px;
+        "
+      >
+        <span>项目:</span>
+      </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"> 名称 </td>
+            <td style="padding: 5px"> 规格型号 </td>
+            <td style="padding: 5px; width: 60px"> 单位</td>
+            <td style="padding: 5px; width: 110px"> 数量</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.productName }} </td>
+            <td style="padding: 5px">
+              {{ item.specification }}
+            </td>
+            <td style="padding: 5px"> {{ item.measuringUnit }}</td>
+            <td style="padding: 5px"> {{ item.totalCount }}</td>
+            <td style="padding: 5px"> {{ item.colorKey }}</td>
+            <td style="padding: 5px"> {{ item.modelKey }}</td>
+            <td style="padding: 5px"> {{ item.remark }}</td>
+          </tr>
+          <tr align="center">
+            <td style="padding: 5px"> 合计 </td>
+            <td style="padding: 5px" colspan="2">  </td>
+            <td style="padding: 5px">{{ getTotalValue('totalCount', 2) }} </td>
+            <td style="padding: 5px"> </td>
+            <td style="padding: 5px"> </td>
+            <td style="padding: 5px"> </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>业务员:{{ formData.saleOrderList[0]?.partbLinkName }}</div>
+        </div>
+        <div style="flex: 1">
+          <div>制单人:{{ formData.createTime }}</div>
+        </div>
+        <div style="flex: 1"> 核对人: </div>
+        <div style="flex: 1"> 发货人: </div>
+      </div>
+      <div
+        style="
+          width: 100%;
+          font-size: 12px;
+          display: flex;
+          justify-content: space-between;
+          margin-top: 10px;
+        "
+      >
+        <div style="flex: 1">
+          <div>地址:{{ formData.partbAddress }}</div>
+        </div>
+        <div style="flex: 1">
+          <div>客户签字:</div>
+        </div>
+      </div>
+    </div>
+
+    <div slot="footer">
+      <el-button @click="print">打印预览</el-button>
+      <el-button @click="close">关闭</el-button>
+    </div>
+  </ele-modal>
+</template>
+
+<script>
+  import { getSendSaleOrderrecordDetailSplit } from '@/api/saleManage/saleordersendrecord';
+  import { mapGetters } from 'vuex';
+  export default {
+    name: 'print',
+    computed: {
+      ...mapGetters(['user'])
+    },
+    props: {
+      groupName: ''
+    },
+    data() {
+      return {
+        checked: '',
+        QRvisible: false,
+        isPrintPrice: false,
+        formData: {}
+      };
+    },
+
+    methods: {
+      async open(id) {
+        this.formData = await getSendSaleOrderrecordDetailSplit(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);
+
+        return (
+          (val &&
+            parseFloat(val)
+              .toFixed(num)
+              .replace(/\.?0+$/, '')) ||
+          0
+        );
+      },
+      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>

+ 30 - 3
src/views/saleManage/saleOrder/invoice/index.vue

@@ -73,6 +73,12 @@
                   @click.native="handlePrint('printTemplateBSRef')"
                   @click.native="handlePrint('printTemplateBSRef')"
                   >送货单模板</el-dropdown-item
                   >送货单模板</el-dropdown-item
                 >
                 >
+                <el-dropdown-item
+                  v-if="$hasPermission('eom:print-invoice6')"
+                  @click.native="handlePrint('printTemplateHtRef')"
+                  >货物签收单</el-dropdown-item
+                >
+
                 <!-- <el-dropdown-item
                 <!-- <el-dropdown-item
                   @click.native="handlePrint('printTemplateJrRef')"
                   @click.native="handlePrint('printTemplateJrRef')"
                   >发货单</el-dropdown-item
                   >发货单</el-dropdown-item
@@ -136,6 +142,15 @@
             >
             >
               提交
               提交
             </el-link>
             </el-link>
+            <el-link
+              type="primary"
+              :underline="false"
+              icon="el-icon-plus"
+              @click="exportFile(row)"
+              v-if="[2].includes(row.reviewStatus)"
+            >
+              导出
+            </el-link>
 
 
             <el-popconfirm
             <el-popconfirm
               class="ele-action"
               class="ele-action"
@@ -219,6 +234,11 @@
       ref="printTemplateBSRef"
       ref="printTemplateBSRef"
       :groupName="groupName"
       :groupName="groupName"
     ></printTemplateBs>
     ></printTemplateBs>
+    <printTemplateHt
+      ref="printTemplateHtRef"
+      :groupName="groupName"
+    ></printTemplateHt>
+
     <process-submit-dialog
     <process-submit-dialog
       :isNotNeedProcess="false"
       :isNotNeedProcess="false"
       :processSubmitDialogFlag.sync="processSubmitDialogFlag"
       :processSubmitDialogFlag.sync="processSubmitDialogFlag"
@@ -250,6 +270,7 @@
   import printTemplateWl from '@/views/saleManage/saleOrder/invoice/components/print-template-wl.vue';
   import printTemplateWl from '@/views/saleManage/saleOrder/invoice/components/print-template-wl.vue';
   import printTemplateBs from '@/views/saleManage/saleOrder/invoice/components/print-template-bs.vue';
   import printTemplateBs from '@/views/saleManage/saleOrder/invoice/components/print-template-bs.vue';
   import printTemplateJr from '@/views/saleManage/saleOrder/invoice/components/print-template-jr.vue';
   import printTemplateJr from '@/views/saleManage/saleOrder/invoice/components/print-template-jr.vue';
+  import printTemplateHt from '@/views/saleManage/saleOrder/invoice/components/print-template-ht.vue';
   import {
   import {
     deleteSendInformation,
     deleteSendInformation,
     getSendTableList,
     getSendTableList,
@@ -262,6 +283,8 @@
   import { getSendSaleOrderrecordDetailSplit } from '@/api/saleManage/saleordersendrecord';
   import { getSendSaleOrderrecordDetailSplit } from '@/api/saleManage/saleordersendrecord';
   import { getWarehouseListByIds } from '@/api/purchasingManage/returnGoods';
   import { getWarehouseListByIds } from '@/api/purchasingManage/returnGoods';
   import exportButton from '@/components/upload/exportButton.vue';
   import exportButton from '@/components/upload/exportButton.vue';
+  import { downLoadTemplate } from '@/api/system/file/index.js';
+
 
 
   export default {
   export default {
     mixins: [dictMixins, tabMixins],
     mixins: [dictMixins, tabMixins],
@@ -279,7 +302,9 @@
       printTemplateJsYp,
       printTemplateJsYp,
       printTemplateWl,
       printTemplateWl,
       printTemplateBs,
       printTemplateBs,
-      printTemplateJr,exportButton
+      printTemplateJr,
+      exportButton,
+      printTemplateHt
     },
     },
 
 
     //客户管理数据
     //客户管理数据
@@ -432,7 +457,7 @@
           {
           {
             columnKey: 'action',
             columnKey: 'action',
             label: '操作',
             label: '操作',
-            width: 230,
+            width: 280,
             align: 'center',
             align: 'center',
             resizable: false,
             resizable: false,
             slot: 'action',
             slot: 'action',
@@ -476,7 +501,9 @@
           ...where
           ...where
         });
         });
       },
       },
-
+      exportFile(row) {
+          downLoadTemplate(`/eom/saleordersendrecord/export/${row.id}`,'货物签收单')
+      },
       //创建退货单
       //创建退货单
       creatReturnGoods(type, row) {
       creatReturnGoods(type, row) {
         this.$refs.addReturnGoodsRef.open(type, {}, row.id);
         this.$refs.addReturnGoodsRef.open(type, {}, row.id);