Просмотр исходного кода

feat(仓库管理): 统一打印单据中显示公司名称并优化打印模板

liujt 7 месяцев назад
Родитель
Сommit
2052e0358b

+ 78 - 65
src/views/warehouseManagement/inventoryAllocation/components/print-template-bs-car.vue

@@ -1,6 +1,6 @@
 <template>
   <ele-modal
-    title="出库单"
+    title="送货单"
     :visible.sync="QRvisible"
     v-if="QRvisible"
     width="90%"
@@ -18,10 +18,10 @@
         style="
           position: relative;
           width: 100%;
-          height: 100px;
           display: flex;
           flex-direction: column;
           align-items: center;
+          margin-bottom: 20px;
         "
       >
         <!-- <img
@@ -32,22 +32,13 @@
         /> -->
         <div
           style="
-            font-size: 20px;
+            font-size: 18px;
             font-weight: 800;
             text-align: center;
             width: 100%;
           "
           >{{ groupName || '长沙宝盛汽车配件有限公司' }}送货单</div
         >
-        <!-- <div
-          style="
-            font-size: 18px;
-            font-weight: 800;
-            text-align: center;
-            width: 100%;
-          "
-          >送货单</div
-        > -->
       </div>
       <div
         style="
@@ -58,9 +49,9 @@
           margin-bottom: 10px;
         "
       >
-        <span style="width: 40%">客户名称:{{ formData.contactName }}</span>
+        <span style="width: 40%">客户名称:</span>
         <span style="width: 40%"
-          >发货单号:{{ formData.printNo || formData.docNo }}</span
+          >发货单号:{{ infoData.allotCode }}</span
         >
       </div>
       <div
@@ -72,13 +63,10 @@
           margin-bottom: 10px;
         "
       >
-        <span style="width: 40%">发货日期:{{ formData.createTime }}</span>
+        <span style="width: 40%">发货日期:{{ infoData.createTime }}</span>
         <span style="width: 40%"
-          >收货联系人:{{ formData.linkName }}
-
-          <!-- 联系电话:{{ formData.linkPhone }} -->
+          >收货联系人:
         </span>
-        <!-- <span> 车牌号:{{ formData.carNo }} </span> -->
       </div>
       <table
         cellspacing="0"
@@ -96,7 +84,8 @@
             <td style="padding: 5px; width: 35px"> 序号 </td>
             <td style="padding: 5px;"> 车型 </td>
             <td style="padding: 5px;"> 料号 </td>
-            <td style="padding: 5px; width: 50px"> 单位</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>
@@ -105,20 +94,37 @@
             <td style="padding: 5px"> 备注</td>
           </tr>
 
-          <tr align="center" v-for="(item, index) in formData.productList">
+          <tr align="center" v-for="(item, index) in detailList">
             <td style="padding: 5px"> {{ index + 1 }} </td>
-            <td style="padding: 5px"> </td>
-            <td style="padding: 5px"> {{ item.productName }} </td>
+            <td style="padding: 5px">  </td>
+            <td style="padding: 5px"> {{ item.categoryCode }} </td>
             <td style="padding: 5px">
-              {{ item.productCode }}
+              {{ item.categoryName }}
+            </td>
+            <td style="padding: 5px"> {{ item.measureUnit }} </td>
+            <td style="padding: 5px"> {{ item.quantity }}</td>
+            <td style="padding: 5px"> {{ item.quantity }}</td>
+            <td style="padding: 5px"> {{ item.saleOrderNo }}</td>
+            <td style="padding: 5px"> {{ item.weight }}</td>
+            <td style="padding: 5px">{{ item.produceRoutingName }} </td>
+            <td style="padding: 5px"> {{ item.remark }} </td>
+          </tr>
+          <tr style="height: 40px;">
+            <td style="border: 1px solid #000; padding: 8px; text-align: center;"></td>
+            <td colspan="2" style="border: 1px solid #000; padding: 8px; text-align: center;">合计</td>
+            <!-- <td style="border: 1px solid #000; padding: 8px; text-align: center;"></td> -->
+            <td style="border: 1px solid #000; padding: 8px; text-align: center;"></td>
+            <td style="border: 1px solid #000; padding: 8px; text-align: center;"></td>
+            <td style="border: 1px solid #000; padding: 8px; text-align: center;">{{ detailList.reduce((total, item) => total + Number(item.quantity || 0), 0) || ''}}</td>
+            <td style="border: 1px solid #000; padding: 8px; text-align: center;">{{ detailList.reduce((total, item) => total + Number(item.quantity || 0), 0) || ''}}</td>
+            <td style="border: 1px solid #000; padding: 8px; text-align: center;" colspan="4">
+              <div style="display: flex; align-items: center;">
+                <div style="flex: 1;">铁框:</div>
+                <div style="flex: 1;">托盘:</div>
+                <div style="flex: 1;">工装:</div>
+                <div style="flex: 1;">胶框:</div>
+              </div>
             </td>
-            <td style="padding: 5px"> {{ item.productName }} </td>
-            <td style="padding: 5px"> {{ item.measuringUnit }}</td>
-            <td style="padding: 5px"> {{ item.totalCount }}</td>
-            <td style="padding: 5px"> {{ item.totalCount }}</td>
-            <td style="padding: 5px"> </td>
-            <td style="padding: 5px">{{ item.orderNo }} </td>
-            <td style="padding: 5px"> </td>
           </tr>
         </tbody>
       </table>
@@ -132,13 +138,13 @@
         "
       >
         <div style="flex: 1">
-          <div>发货人:</div>
+          <div>发货人:{{ infoData.allotName }}</div>
         </div>
         <div style="flex: 1">
-          <div>送货人:</div>
+          <div>承运人:</div>
         </div>
         <div style="flex: 1"> 收货人: </div>
-        <div style="flex: 1"> 托盘:{{   formData.trayNum }} </div>
+        <!-- <div style="flex: 1"> 托盘:{{   infoData.trayNum }} </div> -->
       
       </div>
     </div>
@@ -151,7 +157,7 @@
 </template>
 
 <script>
-  // import { getSendSaleOrderrecordDetailSplit } from '@/api/saleManage/saleordersendrecord';
+  import storageApi from '@/api/warehouseManagement/index.js';
   import { mapGetters } from 'vuex';
   export default {
     name: 'print',
@@ -159,48 +165,55 @@
       ...mapGetters(['user'])
     },
     props: {
-      groupName: ''
+      groupName: {
+        type: String,
+        default: ''
+      }
     },
     data() {
       return {
         checked: '',
         QRvisible: false,
         isPrintPrice: false,
-        formData: {},
-        outBound: {}
+        infoData: {},
+        outBound: {},
+        detailList: []
       };
     },
 
     methods: {
-      async open(id) {
-        // this.formData = await getSendSaleOrderrecordDetailSplit(id);
+      async open(row) {
+        this.row = row;
+        this.getData();
         this.QRvisible = true;
-        // let dataArray = await getInfoBySourceBizNoAll(this.formData.docNo);
-        // this.outBound = JSON.parse(JSON.stringify(dataArray[0]));
-        // this.outBound['outInDetailRecordRequestList'] = [];
-
-        // dataArray.forEach((item) => {
-        //   item.outInDetailList.forEach((val) => {
-        //     val['orderNo'] = item.orderNo;
-        //     if (val.outInDetailRecordRequestList.length) {
-        //       val.outInDetailRecordRequestList.forEach((j) => {
-        //         j['categoryName'] = val.categoryName;
-        //         j['categoryModel'] = val.categoryModel;
-        //         j['specification'] = val.specification;
-        //         j['categoryCode'] = val.categoryCode;
-        //         j['orderNo'] = item.orderNo;
-
-        //       });
-        //       this.outBound['outInDetailRecordRequestList'].push(
-        //         ...val.outInDetailRecordRequestList
-        //       );
-        //     } else {
-        //       this.outBound['outInDetailRecordRequestList'].push(val);
-        //     }
-        //   });
-        // });
-        //包装维度
       },
+      async getData() {
+      const res = await storageApi.getAllotDetailList({
+          applyId: this.row.id
+        });
+        const data = await storageApi.getAllotDetail(this.row.id);
+        this.infoData = data;
+        if (this.infoData.type == 1) {
+          // 库内调拨
+          /* this.infoData.auditStatus = 2; */
+          this.infoData.auditStatus = data.status;
+        } else {
+          // 库外调拨
+          this.infoData.auditStatus = data.status;
+        }
+        this.detailList = res.map((item) => {
+          return {
+            ...item,
+            categoryCode: this.infoData.categoryCode,
+            categoryName: this.infoData.categoryName,
+            brandNum: this.infoData.brandNum,
+            categoryModel: this.infoData.model,
+            specification: this.infoData.specification
+          };
+        });
+        console.log('infoData', this.infoData)
+        console.log('detailList', this.detailList)
+    },
       close() {
         this.QRvisible = false;
       },

+ 22 - 16
src/views/warehouseManagement/inventoryAllocation/components/print-template-bs.vue

@@ -1,6 +1,6 @@
 <template>
   <el-dialog
-    title="送货单详情"
+    title="送货单"
     :visible.sync="visible"
     center
     append-to-body
@@ -11,20 +11,20 @@
 
     <div id="printSection">
       <div style="text-align: center; padding-bottom: 20px;">
-        <h3 style="margin: 0; font-size: 20px; font-weight: 800;">送货单</h3>
+        <h3 style="margin: 0; font-size: 18px; font-weight: 800;">{{ groupName }}送货单</h3>
       </div>
 
       <div style="margin-bottom: 15px; width: 100%;">
         <div style="display: flex; margin-bottom: 8px; width: 100%;">
-          <div style="flex: 1; text-align: left;">客户名称:{{ infoData.customerName || '' }}</div>
-          <div style="flex: 1; text-align: left;">发货单号:{{ infoData.deliveryNumber || '' }}</div>
+          <div style="flex: 1; text-align: left;">客户名称:</div>
+          <div style="flex: 1; text-align: left;">发货单号:{{ infoData.allotCode || '' }}</div>
         </div>
         <div style="display: flex; margin-bottom: 8px;">
-          <div style="flex: 1; text-align: left;">发货日期:{{ infoData.deliveryDate || '' }}</div>
-          <div style="flex: 1; text-align: left;">联系人:{{ infoData.contactPerson || '' }}</div>
+          <div style="flex: 1; text-align: left;">发货日期:{{ infoData.createTime || '' }}</div>
+          <div style="flex: 1; text-align: left;">联系人:</div>
         </div>
         <div style="display: flex;">
-          <div style="flex: 1; text-align: left;">联系电话:{{ infoData.contactPhone || '' }}</div>
+          <div style="flex: 1; text-align: left;">联系电话:</div>
         </div>
       </div>
 
@@ -48,19 +48,19 @@
             <td style="border: 1px solid #000; padding: 8px; text-align: center;">{{ item.categoryModel || '' }}</td>
             <td style="border: 1px solid #000; padding: 8px; text-align: center;">{{ item.categoryName || '' }}</td>
             <td style="border: 1px solid #000; padding: 8px; text-align: center;">{{ item.measureUnit || '' }}</td>
-            <td style="border: 1px solid #000; padding: 8px; text-align: center;">{{ item.measureQuantity || '' }}</td>
-            <td style="border: 1px solid #000; padding: 8px; text-align: center;">{{ item.measureQuantity || '' }}</td>
+            <td style="border: 1px solid #000; padding: 8px; text-align: center;">{{ item.quantity || '' }}</td>
+            <td style="border: 1px solid #000; padding: 8px; text-align: center;">{{ item.quantity || '' }}</td>
             <td style="border: 1px solid #000; padding: 8px; text-align: center;">{{ item.remark || '' }}</td>
-            <td style="border: 1px solid #000; padding: 8px; text-align: center;">{{ item.orderNumber || '' }}</td>
-            <td style="border: 1px solid #000; padding: 8px; text-align: center;">{{ item.processingTechnology || '' }}</td>
+            <td style="border: 1px solid #000; padding: 8px; text-align: center;">{{ item.saleOrderNo || '' }}</td>
+            <td style="border: 1px solid #000; padding: 8px; text-align: center;">{{ item.produceRoutingName || '' }}</td>
           </tr>
           <tr style="height: 40px;">
             <td style="border: 1px solid #000; padding: 8px; text-align: center;"></td>
             <td colspan="2" style="border: 1px solid #000; padding: 8px; text-align: center;">合计</td>
             <!-- <td style="border: 1px solid #000; padding: 8px; text-align: center;"></td> -->
             <td style="border: 1px solid #000; padding: 8px; text-align: center;"></td>
-            <td style="border: 1px solid #000; padding: 8px; text-align: center;">{{ detailList.reduce((total, item) => total + Number(item.measureQuantity || 0), 0) || ''}}</td>
-            <td style="border: 1px solid #000; padding: 8px; text-align: center;">{{ detailList.reduce((total, item) => total + Number(item.measureQuantity || 0), 0) || ''}}</td>
+            <td style="border: 1px solid #000; padding: 8px; text-align: center;">{{ detailList.reduce((total, item) => total + Number(item.quantity || 0), 0) || ''}}</td>
+            <td style="border: 1px solid #000; padding: 8px; text-align: center;">{{ detailList.reduce((total, item) => total + Number(item.quantity || 0), 0) || ''}}</td>
             <td style="border: 1px solid #000; padding: 8px; text-align: center;"></td>
             <td style="border: 1px solid #000; padding: 8px; text-align: center;"></td>
             <td style="border: 1px solid #000; padding: 8px; text-align: center;"></td>
@@ -69,9 +69,9 @@
       </table>
 
       <div style="display: flex; margin-top: 20px; width: 100%;">
-        <div style="flex: 1;">发货人:{{ infoData.deliverer || '' }}</div>
-        <div style="flex: 1;">送货人:{{ infoData.carrier || '' }}</div>
-        <div style="flex: 1;">收货人:{{ infoData.receiver || '' }}</div>
+        <div style="flex: 1;">发货人:{{ infoData.allotName || '' }}</div>
+        <div style="flex: 1;">送货人:</div>
+        <div style="flex: 1;">收货人:</div>
       </div>
     </div>
 
@@ -88,6 +88,12 @@
 <script>
 import storageApi from '@/api/warehouseManagement/index.js';
 export default {
+  props: {
+    groupName: {
+      type: String,
+      default: ''
+    }
+  },
   data () {
     return {
       visible: false,

+ 5 - 5
src/views/warehouseManagement/inventoryAllocation/details.vue

@@ -390,11 +390,11 @@
         this.detailList = res.map((item) => {
           return {
             ...item,
-            categoryCode: this.infoData.categoryCode,
-            categoryName: this.infoData.categoryName,
-            brandNum: this.infoData.brandNum,
-            categoryModel: this.infoData.model,
-            specification: this.infoData.specification
+            // categoryCode: this.infoData.categoryCode,
+            // categoryName: this.infoData.categoryName,
+            // brandNum: this.infoData.brandNum,
+            // categoryModel: this.infoData.model,
+            // specification: this.infoData.specification
           };
         });
         // if (res?.success) {

+ 21 - 8
src/views/warehouseManagement/inventoryAllocation/index.vue

@@ -16,14 +16,12 @@
           <el-button icon="el-icon-plus" type="primary" @click="add"
             >新建</el-button
           >
-          <!-- <el-button :disabled="selection.length > 1" icon="el-icon-download" type="primary"  @click="printExl"
+          <el-button v-if="$hasPermission('wms:inventoryAllocation:print1')" :disabled="selection.length > 1" icon="el-icon-download" type="primary"  @click="printExl"
             >打印送货单</el-button
-          > -->
-          <!-- v-if="$hasPermission('wms:inventoryAllocation:print1')" -->
-          <!-- <el-button :disabled="selection.length > 1" icon="el-icon-download" type="primary"  @click="printExl2"
+          >
+          <el-button v-if="$hasPermission('wms:inventoryAllocation:print2')" :disabled="selection.length > 1" icon="el-icon-download" type="primary"  @click="printExl2"
             >打印送货单</el-button
-          > -->
-          <!-- v-if="$hasPermission('wms:inventoryAllocation:print2')" -->
+          >
         </template>
         <!-- 单号链接 -->
         <template v-slot:allotCode="{ row }">
@@ -71,8 +69,8 @@
       </ele-pro-table>
     </el-card>
     <!-- 打印弹窗 -->
-    <printTemplateBs ref="printTemplateBsRef"></printTemplateBs>
-    <printTemplateBsCar ref="printTemplateBsCarRef"></printTemplateBsCar>
+    <printTemplateBs :groupName="groupName" ref="printTemplateBsRef"></printTemplateBs>
+    <printTemplateBsCar :groupName="groupName" ref="printTemplateBsCarRef"></printTemplateBsCar>
   </div>
 </template>
 
@@ -84,6 +82,7 @@
   import printTemplateBsCar from './components/print-template-bs-car.vue';
   import warehouseDefinition from '@/api/warehouseManagement/warehouseDefinition';
   import { pageRoles } from '@/api/system/role';
+import { enterprisePage } from '@/api/bpm/index.js';
   export default {
     components: {
       InventorySearch,
@@ -93,6 +92,7 @@
     data() {
       return {
         allocationType,
+        groupName: '',
         stutusOptions: {
           0: '未提交',
           1: '审核中',
@@ -210,7 +210,20 @@
       };
     },
     computed: {},
+    created() {
+      this.getCompanyInfo();
+    },
     methods: {
+      getCompanyInfo() {
+        enterprisePage({
+          pageNum: 1,
+          size: 200
+        }).then((res) => {
+          if (res.list?.length > 0) {
+            this.groupName = res.list[0].name;
+          }
+        });
+      },
       printExl() {
         console.log('selection', this.selection)
         if (this.selection.length == 0) {

+ 1 - 1
src/views/warehouseManagement/stockManagement/components/print-template-tr.vue

@@ -15,7 +15,7 @@
     >
       <!-- 入库单标题 -->
       <div style="text-align: center; margin-bottom: 20px;">
-        <h2 style="margin: 0; font-size: 24px; font-weight: bold;">采购入库(退厂)单</h2>
+        <h2 style="margin: 0; font-size: 24px; font-weight: bold;">{{ groupName }}采购入库(退厂)单</h2>
       </div>
       
       <!-- 供应商信息 -->

+ 7 - 5
src/views/warehouseManagement/stockManagement/components/printStockEnter.vue

@@ -15,7 +15,7 @@
     >
       <!-- 入库单标题 -->
       <div style="text-align: center; margin-bottom: 20px;">
-        <h2 style="margin: 0; font-size: 24px; font-weight: bold;">入库单</h2>
+        <h2 style="margin: 0; font-size: 24px; font-weight: bold;">{{ groupName }}入库单</h2>
       </div>
       
       <!-- 供应商信息 -->
@@ -134,7 +134,12 @@
         }, 0);
       }
     },
-    props: {},
+    props: {
+      groupName: {
+        type: String,
+        default: ''
+      }
+    },
     data() {
       return {
         QRvisible: false,
@@ -181,9 +186,6 @@
 </script>
 
 <style scoped lang="scss">
-  #printSection {
-    
-  }
   table {
     border-collapse: collapse;
   }

+ 1 - 2
src/views/warehouseManagement/stockManagement/index.vue

@@ -280,7 +280,7 @@
     </el-card>
 
     <printQRCode ref="printQRCodeRef"></printQRCode>
-    <printStockEnter ref="printStockEnterRef"></printStockEnter>
+    <printStockEnter ref="printStockEnterRef" :groupName="groupName"></printStockEnter>
     <printTemplateTr ref="printTemplateTrRef" :groupName="groupName"></printTemplateTr>
 
     <!--  <priceMaintenanceDialog ref="priceMaintenanceDialogRef" /> -->
@@ -480,7 +480,6 @@
     },
     created() {
       //仓库出入库是否显示金额(0:不显示 1:显示)
-      console.log('authorities~~~', this.$store.state.user?.authorities)
       parameterGetByCode({
         code: 'wms_price'
       }).then((res) => {