소스 검색

【修改】打印单

莫绍宝 3 년 전
부모
커밋
215c7d39a9

+ 5 - 1
src/components/Common/print-foshan.vue

@@ -2,7 +2,7 @@
   <div class="detail-container">
     <div class="print-page" v-for="(item, index) in showData" :key="index">
       <div class="print-title">
-        <div class="title1">佛山盛世欣兴格力贸易有限公司</div>
+        <div class="title1">{{company}}</div>
         <div class="title2">
           <div></div>
           <div>销售发货单</div>
@@ -109,6 +109,10 @@ export default {
     detailData: {
       type: Object,
       default: null
+    },
+    company: {
+      type: String,
+      default: ''
     }
   },
 

+ 5 - 1
src/components/Common/print-guangzhou.vue

@@ -2,7 +2,7 @@
   <div class="detail-container">
     <div class="print-page" v-for="(item, index) in showData" :key="index">
       <div class="print-title">
-        <div class="title1">佛山盛世欣兴格力贸易有限公司</div>
+        <div class="title1">{{company}}</div>
         <div class="title2">
           <div></div>
           <div>销售发货单</div>
@@ -160,6 +160,10 @@ export default {
     detailData: {
       type: Object,
       default: null
+    },
+    company: {
+      type: String,
+      default: ''
     }
   },
 

+ 338 - 0
src/components/Common/print-shaoguan.vue

@@ -0,0 +1,338 @@
+<template>
+  <div class="detail-container">
+    <div class="print-page" v-for="(item, index) in showData" :key="index">
+      <div class="print-title">
+        <div class="title1">{{company}}</div>
+        <div class="title2">
+          <div></div>
+          <div>销售发货单</div>
+          <div>{{ item.pickOrderWater }}</div>
+        </div>
+      </div>
+      <div class="print-form-2">
+        <el-row :gutter="0">
+          <el-col :span="16" class="item">
+            <div class="label">客户名称</div>
+            <div class="value">
+              <el-input v-model="item.customerName" readonly></el-input>
+            </div>
+          </el-col>
+          <el-col :span="8" class="item">
+            <div class="label">发货日期</div>
+            <div class="value">
+              <el-input v-model="nowDate" readonly></el-input>
+            </div>
+          </el-col>
+          <el-col :span="16" class="item">
+            <div class="label">发货单号</div>
+            <div class="value">
+              <el-input v-model="item.id" readonly></el-input>
+            </div>
+          </el-col>
+          <el-col :span="8" class="item">
+            <div class="label">订单号</div>
+            <div class="value">
+              <el-input v-model="item.aaa" readonly></el-input>
+            </div>
+          </el-col>
+          <el-col :span="16" class="item">
+            <div class="label">使用单位</div>
+            <div class="value">
+              <el-input v-model="item.aaa" readonly></el-input>
+            </div>
+          </el-col>
+          <el-col :span="8" class="item">
+            <div class="label">合同号</div>
+            <div class="value">
+              <el-input v-model="item.aaa" readonly></el-input>
+            </div>
+          </el-col>
+          <el-col :span="24" class="item">
+            <div class="label">提货人资料</div>
+            <div class="value">
+              <el-input v-model="item.takerName" readonly></el-input>
+            </div>
+          </el-col>
+          <el-col :span="24" class="item">
+            <div class="label">备注</div>
+            <div class="value">
+              <el-input v-model="item.remark" readonly></el-input>
+            </div>
+          </el-col>
+        </el-row>
+      </div>
+
+      <div class="print-table-1">
+        <div class="head">
+          <el-row :gutter="20">
+            <el-col :span="3">仓库名称</el-col>
+            <el-col :span="3">销售类型</el-col>
+            <el-col :span="4">存货名称</el-col>
+            <el-col :span="8">规格型号</el-col>
+            <el-col :span="2">数量</el-col>
+            <el-col :span="4">说明</el-col>
+          </el-row>
+        </div>
+        <div class="body">
+          <div v-for="(item, index) in item.invoicePickBeans" :key="index">
+            <el-row :gutter="20">
+              <el-col :span="3">{{ item.correspondName }}</el-col>
+              <el-col :span="3">{{ item.saleTypeName }}</el-col>
+              <el-col :span="4">{{ item.materialName }}</el-col>
+              <el-col :span="8">{{ item.specification }}</el-col>
+              <el-col :span="2">{{ item.refundableQty }}</el-col>
+              <el-col :span="4">{{ item.remark }}</el-col>
+            </el-row>
+          </div>
+        </div>
+        <div class="foot">
+          <el-row :gutter="20">
+            <el-col :span="3">合计</el-col>
+            <el-col :span="3"></el-col>
+            <el-col :span="4"></el-col>
+            <el-col :span="8"></el-col>
+            <el-col :span="2">{{ item.total_num }}</el-col>
+            <el-col :span="4"></el-col>
+          </el-row>
+        </div>
+      </div>
+
+      <div class="print-form-2">
+        <el-row :gutter="30">
+          <el-col :span="5" class="item">
+            <div class="label">制表</div>
+            <div class="value">
+              <el-input v-model="item.createBy" readonly></el-input>
+            </div>
+          </el-col>
+          <el-col :span="5" class="item">
+            <div class="label">审核</div>
+            <div class="value">
+              <el-input v-model="item.createBy" readonly></el-input>
+            </div>
+          </el-col>
+          <el-col :span="5" class="item">
+            <div class="label">珠海格力办</div>
+            <div class="value">
+              <el-input value="赵玲玲" readonly></el-input>
+            </div>
+          </el-col>
+          <el-col :span="5" class="item">
+            <div class="label">仓库签章</div>
+            <div class="value">
+              <el-input v-model="item.userName" readonly></el-input>
+            </div>
+          </el-col>
+        </el-row>
+      </div>
+
+      <div class="print-text">
+        <div>仓租费:自开单日起5天内免费,逾期15天内收取0.3%/天,超过15天及以上按0.4%/天。</div>
+        <div>
+          <span style="width: 58px"></span>
+          <span>此单过期</span>
+          <el-input readonly></el-input>
+          <span>天,在后期费用中扣除</span>
+          <el-input readonly></el-input>
+          <span>元。</span>
+        </div>
+      </div>
+
+    </div>
+
+  </div>
+</template>
+
+<script>
+
+export default {
+  name: 'PrintFoshan',
+  props: {
+    detailData: {
+      type: Object,
+      default: null
+    },
+    company: {
+      type: String,
+      default: ''
+    }
+  },
+
+  computed: {
+    showData() {
+      var showData = [];
+      if(this.detailData && this.detailData.invoicePickBeans) {
+        for(var i=0; i<this.detailData.invoicePickBeans.length; i+=5){
+          let obj = JSON.parse(JSON.stringify(this.detailData));
+          obj.userName = JSON.parse(localStorage.getItem("supply_user")).nickName;
+          obj.invoicePickBeans = this.detailData.invoicePickBeans.slice(i, i+5);
+          obj.total_num = 0;
+          obj.total_price = 0;
+          obj.total_amount = 0;
+          obj.total_discount = 0;
+          obj.invoicePickBeans.forEach(item => {
+            obj.total_num = obj.total_num + item.refundableQty;
+          });
+          for(var j=0; j<5; j++){
+            if(!obj.invoicePickBeans[j]) {
+              obj.invoicePickBeans[j] = {};
+            }
+          }
+          showData.push(obj);
+        }
+      }
+      console.log(showData);
+      return showData;
+    },
+    
+    nowDate() {
+      var date = new Date();
+      var seperator1 = "-";
+      var year = date.getFullYear();
+      var month = date.getMonth() + 1;
+      var strDate = date.getDate();
+      if (month >= 1 && month <= 9) {
+          month = "0" + month;
+      }
+      if (strDate >= 0 && strDate <= 9) {
+          strDate = "0" + strDate;
+      }
+      var currentdate = year + seperator1 + month + seperator1 + strDate;
+      return currentdate;
+    },
+  },
+
+  methods: {
+
+  }
+}
+</script>
+
+<style scoped lang="scss">
+  .detail-container {
+    width: 100%;
+    height: 100%;
+  }
+  .print-page {
+    margin-bottom: 50px;
+    // min-height: 1020px;
+    page-break-after: always;
+  }
+  .print-title {
+    text-align: center;
+    .title1 {
+      font-size: 24px;
+      margin-bottom: 18px;
+    }
+    .title2 {
+      font-size: 18px;
+      margin-bottom: 24px;
+      display: flex;
+      justify-content: space-between;
+      align-items: center;
+      div {
+        width: 33.333%;
+      }
+    }
+  }
+  .print-table-1 {
+    font-size: 14px;
+    margin-top: 10px;
+    margin-bottom: 10px;
+    .el-row {
+      margin-left: 0 !important;
+      margin-right: 0 !important;
+      border: 1px solid #EBEEF5;
+      border-right: none;
+    }
+    .el-col {
+      padding-top: 14px;
+      padding-bottom: 14px;
+      border-right: 1px solid #EBEEF5;
+    }
+    .head {
+      color: #909399;
+      font-weight: bold;
+      .el-col {
+        padding: 0;
+        display: flex;
+        height: 40px;
+        align-items: center;
+      }
+    }
+    .body {
+      color: #333333;
+      .el-row {
+        border-top: none;
+      }
+      .el-col {
+        padding: 0;
+        display: flex;
+        height: 40px;
+        align-items: center;
+        word-break: break-all;
+      }
+    }
+    .foot {
+      color: #333333;
+      .el-row {
+        border-top: none;
+      }
+      .el-col {
+        padding: 0;
+        display: flex;
+        height: 40px;
+        align-items: center;
+        word-break: break-all;
+      }
+    }
+  }
+
+  .print-form-2 {
+    .item {
+      display: flex;
+      padding-right: 10px;
+      .label {
+        height: 32px;
+        display: flex;
+        align-items: center;
+        box-sizing: border-box;
+        font-size: 14px;
+        color: #333333;
+        flex-shrink: 0;
+      }
+      .value {
+        flex: 1;
+        height: 32px;
+        display: flex;
+        align-items: center;
+        box-sizing: border-box;
+        font-size: 14px;
+        color: #333333;
+        ::v-deep .el-input input {
+          height: 30px;
+          border: none;
+          border-bottom: 1px solid #EBEEF5;
+          padding: 0 10px;
+        }
+      }
+    }
+  }
+
+  .print-text {
+    font-size: 14px;
+    &>div {
+      display: flex;
+      margin-top: 10px;
+    }
+    ::v-deep .el-input {
+      width: 50px;
+      input {
+        height: 30px;
+        border: none;
+        padding: 0 10px;
+      }
+    } 
+  }
+
+</style>

+ 14 - 2
src/views/supply/pickup/components/pickup_print.vue

@@ -8,8 +8,9 @@
 
     <div id="printMe">
       
-      <PrintFoshan :detailData="detailData" v-if="currentType === 1" />
-      <PrintGuangzhou :detailData="detailData" v-if="currentType === 2" />
+      <PrintFoshan :detailData="detailData" :company="company" v-if="currentType === 1" />
+      <PrintGuangzhou :detailData="detailData" :company="company" v-if="currentType === 2" />
+      <PrintShaoguan :detailData="detailData" :company="company" v-if="currentType === 3" />
 
     </div>
     
@@ -26,8 +27,10 @@
 <script>
 import print from 'vue-print-nb'
 import { getDetail, addPrint } from "@/api/supply/pickup";
+import { getCompanyList } from "@/api/user";
 import PrintFoshan from "@/components/Common/print-foshan";
 import PrintGuangzhou from "@/components/Common/print-guangzhou";
+import PrintShaoguan from "@/components/Common/print-shaoguan";
 
 export default {
   name: 'ReturnDetail',
@@ -36,6 +39,7 @@ export default {
   components: {
     PrintFoshan,
     PrintGuangzhou,
+    PrintShaoguan,
   },
   directives: {
     print
@@ -55,11 +59,13 @@ export default {
         }
       },
       detailData: {},
+      company: '',
     }
   },
 
   created() {
     this.getDetail();
+    this.getCompanyList();
   },
 
   methods: {
@@ -79,6 +85,12 @@ export default {
       })
     },
 
+    getCompanyList() {
+      getCompanyList().then(res => {
+        this.company = res.data ? res.data[0].companyName : '';
+      })
+    },
+
     // 添加次数
     addPrint() {
       let ids = this.listItem.map(item => {

+ 1 - 1
src/views/supply/purchase/enter_list.vue

@@ -3,7 +3,7 @@
     <div v-show="!isShowDetail">
       <!-- 筛选条件 -->
       <div class="screen-container">
-        <el-form ref="screenForm" :model="screenForm" label-width="90px" size="small" label-position="left">
+        <el-form ref="screenForm" :model="screenForm" label-width="70px" size="small" label-position="left">
           <el-row :gutter="20">
             <el-col :xs="24" :sm="12" :lg="6">
               <el-form-item label="入库单号" prop="orderNum">