Bladeren bron

feat: 采购收货打印是否打印金额

liujt 1 week geleden
bovenliggende
commit
3c7fa82076

+ 14 - 13
src/views/purchasingManage/purchaseOrder/invoice/components/print-template-ht.vue

@@ -86,13 +86,12 @@
             <td style="padding: 5px"> {{ item.productCode }} </td>
             <td style="padding: 5px"> {{ item.productName }} </td>
             <td style="padding: 5px">
-              {{ item.specification || ''
-              }}{{ item.modelType ? '/' + item.modelType : '' }}
+              {{ item.modelType }}
             </td>
             <td style="padding: 5px"> {{ item.measuringUnit }}</td>
             <td style="padding: 5px"> {{ item.receiveTotalCount }}</td>
-            <td style="padding: 5px"> </td>
-            <td style="padding: 5px"> </td>
+            <td style="padding: 5px"> {{ showPrice ? item.singlePrice : ''}} </td>
+            <td style="padding: 5px"> {{ showPrice ? item.totalPrice : ''}} </td>
             <td style="padding: 5px"> {{ item.batchNo }}</td>
             <td style="padding: 5px"> {{ item.remark }}</td>
           </tr>
@@ -104,13 +103,13 @@
                   >本页数量小计:{{ this.getAll('receiveTotalCount') }}</span
                 >
                 <span style="flex: 1"
-                  >本页金额小计:</span
+                  >本页金额小计:{{ showPrice ? this.getAll('totalPrice') : '' }}</span
                 >
                 <span style="flex: 1"
                   >汇总数量:{{ this.getAll('receiveTotalCount') }}</span
                 >
                 <span style="flex: 1"
-                  >汇总金额:</span
+                  >汇总金额:{{ showPrice ? this.getAll('totalPrice') : '' }}</span
                 >
               </div>
             </td>
@@ -159,6 +158,7 @@ export default {
   },
   data() {
     return {
+      showPrice: true,
       QRvisible: false,
       formData: {}
     };
@@ -209,7 +209,8 @@ export default {
 
     return result;
   },
-    async open(id) {
+    async open(id, status) {
+      this.showPrice = status;
       this.formData = await getReceiveSaleOrderrecordDetail(id);
       this.QRvisible = true;
     },
@@ -245,7 +246,7 @@ export default {
     exportExcel() {
       const list = this.formData?.productList || [];
       const totalCount = this.getAll('receiveTotalCount');
-      const totalPrice = '';
+      const totalPrice = showPrice ? this.getAll('totalPrice') : '';
 
       const border = 'border-top:1px solid #000;border-right:1px solid #000;border-bottom:1px solid #000;border-left:1px solid #000;';
       const cellBase = `${border}padding:4px;mso-number-format:"\\@";vertical-align:middle;text-align:center;mso-horizontal-align:center;`;
@@ -261,11 +262,11 @@ export default {
           <td align="center" valign="middle" style="${td}">${index + 1}</td>
           <td align="center" valign="middle" style="${td}">${item.productCode || ''}</td>
           <td align="center" valign="middle" style="${td}">${item.productName || ''}</td>
-          <td align="center" valign="middle" style="${td}">${item.specification || ''}${item.modelType ? '/' + item.modelType : ''}</td>
+          <td align="center" valign="middle" style="${td}">${item.modelType || ''}</td>
           <td align="center" valign="middle" style="${td}">${item.measuringUnit || ''}</td>
           <td align="center" valign="middle" style="${td}">${item.receiveTotalCount ?? ''}</td>
-          <td align="center" valign="middle" style="${td}"></td>
-          <td align="center" valign="middle" style="${td}"></td>
+          <td align="center" valign="middle" style="${td}">${showPrice ? item.singlePrice : ''}</td>
+          <td align="center" valign="middle" style="${td}">${showPrice ? item.totalPrice : ''}</td>
           <td align="center" valign="middle" style="${td}">${item.batchNo || ''}</td>
           <td align="center" valign="middle" style="${td}">${item.remark || ''}</td>
         </tr>`).join('');
@@ -303,9 +304,9 @@ export default {
             <td align="center" valign="middle" style="${td};font-weight:bold;">合计</td>
             <td colspan="9" align="left" valign="middle" style="${td};font-weight:bold;">
               <span>本页数量小计:${totalCount}</span>
-              <span style="margin-left:40px;">本页金额小计:</span>
+              <span style="margin-left:40px;">本页金额小计:${totalPrice}</span>
               <span style="margin-left:40px;">汇总数量:${totalCount}</span>
-              <span style="margin-left:40px;">汇总金额:</span>
+              <span style="margin-left:40px;">汇总金额:${totalPrice}</span>
             </td>
           </tr>
           <tr height="26" style="height:26pt;">

+ 14 - 0
src/views/purchasingManage/purchaseOrder/invoice/index.vue

@@ -480,6 +480,20 @@
         );
         if (!flag)
           return this.$message.warning('抱歉需要已审核的发货单才能打印,请检查');
+        if(ref == 'printTemplateHtRef') {
+          
+          this.$confirm('是否需要打印金额?', '提示', {
+            confirmButtonText: '是',
+            cancelButtonText: '否',
+            type: 'warning'
+          }) .then((res) => {
+            this.$refs[ref].open(this.selection[0].id, true);
+          })
+          .catch((err) => {
+            this.$refs[ref].open(this.selection[0].id, false);
+          });
+          return;
+        }
         this.$refs[ref].open(this.selection[0].id);
       },
       //删除弹框确定