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

feat(purchaseReturn): 1. 新增原单价、退货单价、仓库名称表格列
2. 为退货单价输入框添加校验规则
3. 新增到货退厂单打印模板组件

liujt 1 месяц назад
Родитель
Сommit
13449d23d6

+ 15 - 1
src/views/purchasingManage/purchaseOrder/returnGoods/components/detailDialog.vue

@@ -388,10 +388,24 @@
             },
             align: 'center'
           },
+          {
+            width: 160,
+            prop: 'deliverysinglePrice',
+            label: '原单价',
+
+            align: 'center'
+          },
           {
             width: 160,
             prop: 'singlePrice',
-            label: '单价',
+            label: '退货单价',
+
+            align: 'center'
+          },
+          {
+            width: 160,
+            prop: 'warehouseName',
+            label: '仓库名称',
 
             align: 'center'
           },

+ 25 - 16
src/views/purchasingManage/purchaseOrder/returnGoods/components/inventoryTable.vue

@@ -54,20 +54,23 @@
           />
         </el-form-item>
       </template>
-      <!--      <template v-slot:singlePrice="{ row, $index }">-->
-      <!--        <el-form-item-->
-      <!--          style="margin-bottom: 20px"-->
-      <!--          :prop="'datasource.' + $index + '.singlePrice'"-->
-      <!--        >-->
-      <!--          <el-input-->
-      <!--            type="number"-->
-      <!--            clearable-->
-      <!--            v-model="row.singlePrice"-->
-      <!--            @input="(val) => changeNumSinglePrice(val, $index)"-->
-      <!--            placeholder="请输入"-->
-      <!--          />-->
-      <!--        </el-form-item>-->
-      <!--      </template>-->
+           <template v-slot:singlePrice="{ row, $index }">
+             <el-form-item
+               style="margin-bottom: 20px"
+               :prop="'datasource.' + $index + '.singlePrice'"
+               :rules="[
+                  { required: true, message: '请输入', trigger: 'blur' },
+                ]"
+             >
+               <el-input
+                 type="number"
+                 clearable
+                 v-model="row.singlePrice"
+                 @input="(val) => changeNumSinglePrice(val, $index)"
+                 placeholder="请输入"
+               />
+             </el-form-item>
+           </template>
 
       <template v-slot:totalPrice="{ row, $index }">
         <el-form-item
@@ -316,7 +319,7 @@
             align: 'center'
           },
           {
-            width: 120,
+            width: 140,
             prop: 'productCode',
             label: '编码',
             slot: 'productCode',
@@ -501,10 +504,16 @@
           {
             width: 160,
             prop: 'singlePrice',
-            label: '单价',
+            label: '退货单价',
             slot: 'singlePrice',
             align: 'center'
           },
+          {
+            width: 160,
+            prop: 'warehouseName',
+            label: '仓库名称',
+            align: 'center'
+          },
           {
             width: 120,
             prop: 'taxRate',

+ 161 - 0
src/views/purchasingManage/purchaseOrder/returnGoods/components/print-template-ht.vue

@@ -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>