123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314 |
- <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}}{{ item.type === 2 ? '销售退货单':'销售发货单' }}</div>
- </div>
- <div class="print-form-1">
- <el-row :gutter="0">
- <el-col :span="12" class="item">
- <div class="label">经销商编码:</div>
- <div class="value">{{ item.customerNumber }}</div>
- </el-col>
- <el-col :span="12" class="item">
- <div class="label">打印日期:</div>
- <div class="value">{{nowDate}}</div>
- </el-col>
- <el-col :span="12" class="item">
- <div class="label">经销商:</div>
- <div class="value">{{ item.customerName }}</div>
- </el-col>
- <el-col :span="12" class="item">
- <div class="label">仓库:</div>
- <div class="value">{{ item.correspondName }}</div>
- </el-col>
- </el-row>
- </div>
- <div class="print-table-1">
- <div class="head">
- <el-row :gutter="20">
- <el-col :span="2">出库单号</el-col>
- <el-col :span="2">发货单号</el-col>
- <el-col :span="2">发货日期</el-col>
- <el-col :span="3">订单号</el-col>
- <!-- <el-col :span="2">工程编号</el-col> -->
- <el-col :span="3">存货名称</el-col>
- <el-col :span="6">规格型号</el-col>
- <el-col :span="2">数量</el-col>
- <el-col :span="2">备注说明</el-col>
- </el-row>
- </div>
- <div class="body">
- <div v-for="(it, idx) in item.invoicePickBeans" :key="idx">
- <el-row :gutter="20">
- <el-col :span="2">{{ it.salesId }}</el-col>
- <el-col :span="2">{{ it.invoiceId }}</el-col>
- <el-col :span="2">{{ it.id ? dateToDayFilter(item.createTime) : '' }}</el-col>
- <el-col :span="3">{{ it.enginOrderType =='HOME' || it.enginOrderType =='TRADE'? it.enginOrderNo :it.mainOrderId }}</el-col>
- <!-- <el-col :span="2">{{ it.refEnginRecordNo }}</el-col> -->
- <el-col :span="3">{{ it.materialName }}</el-col>
- <el-col :span="6">{{ it.specification }}</el-col>
- <el-col :span="2">{{ it.refundableQty }}</el-col>
- <el-col :span="2">{{ it.pjxh1Text }}</el-col>
- </el-row>
- </div>
- </div>
- <div class="foot">
- <el-row :gutter="20">
- <el-col :span="18"></el-col>
- <el-col :span="6">{{ item.total_num }}</el-col>
- </el-row>
- </div>
- </div>
- <div class="print-form-2">
- <el-row :gutter="30">
- <el-col :span="8" class="item">
- <div class="label">{{ item.type === 2 ? '退货人':'提货人' }}</div>
- <div class="value">
- <el-input value=""></el-input>
- </div>
- </el-col>
- <el-col :span="8" class="item">
- <div class="label">联系方式</div>
- <div class="value">
- <el-input value=""></el-input>
- </div>
- </el-col>
- <el-col :span="8" class="item">
- <div class="label">车辆</div>
- <div class="value">
- <el-input value=""></el-input>
- </div>
- </el-col>
- <el-col :span="8" class="item">
- <div class="label">打单</div>
- <div class="value">
- <el-input v-model="item.createBy"></el-input>
- </div>
- </el-col>
- <el-col :span="8" class="item">
- <div class="label">提单</div>
- <div class="value">
- <el-input value=""></el-input>
- </div>
- </el-col>
- <el-col :span="8" class="item">
- <div class="label">仓库</div>
- <div class="value">
- <el-input value=""></el-input>
- </div>
- </el-col>
- </el-row>
- </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: {
- dateToDayFilter(date) {
- if(!date) {return ''}
- return date.slice(0, 10)
- }
- }
- }
- </script>
- <style scoped lang="scss">
- .detail-container {
- width: 100%;
- height: 100%;
- }
- .print-page {
- margin: 20px 0;
- // min-height: 1020px;
- page-break-after: always;
- }
- .print-title {
- text-align: center;
- .title1 {
- font-size: 22px;
- margin-bottom: 15px;
- }
- }
- .print-form-1 {
- padding-left: 10px;
- .item {
- display: flex;
- padding-right: 10px;
- .label {
- height: 32px;
- display: flex;
- align-items: center;
- box-sizing: border-box;
- font-size: 13px;
- color: #333333;
- flex-shrink: 0;
- }
- .value {
- flex: 1;
- height: 32px;
- display: flex;
- align-items: center;
- box-sizing: border-box;
- font-size: 13px;
- color: #333333;
- input {
- border: none;
- padding: 0;
- }
- }
- }
- }
- .print-table-1 {
- font-size: 12px;
- margin-top: 10px;
- margin-bottom: 10px;
- border-right: 1px solid #EBEEF5;
- .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-right: 0 !important;
- display: flex;
- height: 32px;
- align-items: center;
- }
- }
- .body {
- color: #333333;
- .el-row {
- border-top: none;
- }
- .el-col {
- padding-right: 0 !important;
- display: flex;
- height: 32px;
- align-items: center;
- word-break: break-all;
- }
- }
- .foot {
- color: #333333;
- .el-row {
- border-top: none;
- }
- .el-col {
- padding: 0;
- display: flex;
- height: 32px;
- align-items: center;
- word-break: break-all;
- }
- }
- }
- .print-form-2 {
- padding-left: 10px;
- .item {
- display: flex;
- padding-right: 10px;
- .label {
- height: 32px;
- display: flex;
- align-items: center;
- box-sizing: border-box;
- font-size: 13px;
- color: #333333;
- flex-shrink: 0;
- }
- .value {
- flex: 1;
- height: 32px;
- display: flex;
- align-items: center;
- box-sizing: border-box;
- font-size: 13px;
- color: #333333;
- ::v-deep .el-input input {
- height: 30px;
- border: none;
- border-bottom: 1px solid #EBEEF5;
- padding: 0 10px;
- font-size: 13px;
- }
- }
- }
- }
- </style>
|