ledao-print-vue2
v0.1.1
Published
``` <template> <div id="app"> <button @click="test">测试</button> </div> </template>
Downloads
2
Readme
ledao-print-vue2
<template>
<div id="app">
<button @click="test">测试</button>
</div>
</template>
<script>
import Print from '../dist/index.min.js'
export default {
name: 'App',
components: {},
mounted() {},
methods: {
test() {
const template = {
orient: 3,
name: 'ces',
pageSize: {
height: 297,
id: 1,
name: 'A4 (240mm * 297mm)',
width: 240
},
componentOptions: [
{
type: 'LdTable',
isEdit: false,
title: '出库商品明细',
name: 'details',
value: '{details}',
width: 769,
height: 110,
style: { FontSize: 12, AutoHeight: true },
defaultValue: [
{
productName: '苹果ipone11pro',
skuName: 'iphone11pro256g',
specModel: '165L',
quantity: 3,
snCode: '[SPP1Y79G1]',
price: '12.00'
},
{
productName: '苹果ipone11pro',
skuName: 'iphone11pro124g',
specModel: '165L',
quantity: 3,
snCode: '[SPP1Y79G1] ',
price: '12.00'
}
],
tabelHtml: '',
columnsAttr: [
{ title: '产品名称', value: '{产品名称}', name: 'productName' },
{
title: 'sku名称',
value: '{sku名称}',
name: 'skuName',
checked: true
},
{
title: '规格型号',
value: '{规格型号}',
name: 'specModel',
checked: true
},
{
title: '数量',
value: '{数量}',
name: 'quantity',
checked: true
},
{ title: '单价', value: '{单价}', name: 'price' },
{
title: '产品序列号',
value: '产品序列号明细:<br>{产品序列号}',
name: 'snCode',
trSet: { title: '产品序列号明细:', col: 5, margin: '50px' }
}
],
uuid: '9463f04e-75c1-40eb-9bd8-02e8908bb982',
dragable: true,
resizable: true,
left: 80,
top: 69
},
{
type: 'ddedit',
isEdit: false,
title: '公司名称',
value: '{公司名称}',
defaultValue: '某某公司',
name: 'companyName',
uuid: '7c00c106-8bbf-467f-82be-3f01cd057480',
edit: false,
dragable: true,
resizable: true,
width: 908,
height: 45,
left: 0,
top: 11,
style: { FontSize: 14, Bold: true, Alignment: 'center' }
},
{
type: 'ddedit',
isEdit: false,
title: '出库仓库',
value: '{出库仓库}',
defaultValue: '北京仓库',
name: 'warehouseName',
uuid: '9d709ea2-f8e9-4b7f-86fd-c6dc05f70fdf',
dragable: true,
resizable: true,
width: 100,
height: 45,
left: 723,
top: 188,
style: { FontSize: 9 }
},
{
type: 'ddedit',
isEdit: true,
title: '自定义文本',
value: '仓库地址:',
defaultValue: '我是自定义文本',
name: '',
uuid: 'd473d6e0-3eda-4d3c-a7db-f6d69376466a',
dragable: true,
resizable: true,
edit: true,
width: 100,
height: 45,
left: 653,
top: 189,
style: { FontSize: 9, Bold: true, Alignment: 'left' }
}
]
}
const data = {
companyName: '四川某某公司',
stockoutCode: 'CK-12345678910231',
unitName: '北京代理商',
handlerName: '刘某某',
stockoutType: '销售出库',
warehouseName: '京东北京仓',
businessDate: '2020-08-27 12:00:00',
createUserName: '胡某某',
created: '2020-08-27 12:00:00',
remark: '备注一下',
totalPrice: '129.00',
receivePerson: '易某某',
receivePhone: '18982068701',
address: '四川省成都市武侯区 天府软件园',
details: [
{
productName: '苹果ipone11pro',
skuName: 'iphone11pro256g',
specModel: '165L',
quantity: 17,
snCode: '[SPP1Y79G1]',
price: '8999.00'
},
{
productName: '苹果ipone11pro',
skuName: 'iphone11pro256g',
specModel: '165L',
quantity: 17,
snCode: '[SPP1Y79G1]',
price: '8999.00'
},
{
productName: '苹果ipone11pro',
skuName: 'iphone11pro256g',
specModel: '165L',
quantity: 17,
snCode: '[SPP1Y79G1]',
price: '8999.00'
},
{
productName: '苹果ipone11pro',
skuName: 'iphone11pro256g',
specModel: '165L',
quantity: 17,
snCode: '[SPP1Y79G1]',
price: '8999.00'
},
{
productName: '苹果ipone11pro',
skuName: 'iphone11pro256g',
specModel: '165L',
quantity: 17,
snCode: '[SPP1Y79G1]',
price: '8999.00'
},
{
productName: '苹果ipone11pro',
skuName: 'iphone11pro256g',
specModel: '165L',
quantity: 17,
snCode: '[SPP1Y79G1]',
price: '8999.00'
},
{
productName: '苹果ipone11pro',
skuName: 'iphone11pro256g',
specModel: '165L',
quantity: 17,
snCode: '[SPP1Y79G1]',
price: '8999.00'
},
{
productName: '苹果ipone11pro',
skuName: 'iphone11pro256g',
specModel: '165L',
quantity: 17,
snCode: '[SPP1Y79G1]',
price: '8999.00'
},
{
productName: '苹果ipone11pro',
skuName: 'iphone11pro256g',
specModel: '165L',
quantity: 17,
snCode: '[SPP1Y79G1]',
price: '8999.00'
},
{
productName: '苹果ipone11pro',
skuName: 'iphone11pro256g',
specModel: '165L',
quantity: 17,
snCode: '[SPP1Y79G1]',
price: '8999.00'
},
{
productName: '苹果ipone11pro',
skuName: 'iphone11pro256g',
specModel: '165L',
quantity: 17,
snCode: '[SPP1Y79G1]',
price: '8999.00'
},
{
productName: '苹果ipone11pro',
skuName: 'iphone11pro256g',
specModel: '165L',
quantity: 17,
snCode: '[SPP1Y79G1]',
price: '8999.00'
},
{
productName: '苹果ipone11pro',
skuName: 'iphone11pro256g',
specModel: '165L',
quantity: 17,
snCode: '[SPP1Y79G1]',
price: '8999.00'
},
{
productName: '苹果ipone11pro',
skuName: 'iphone11pro256g',
specModel: '165L',
quantity: 17,
snCode: '[SPP1Y79G1]',
price: '8999.00'
},
{
productName: '苹果ipone11pro',
skuName: 'iphone11pro256g',
specModel: '165L',
quantity: 17,
snCode: '[SPP1Y79G1]',
price: '8999.00'
},
{
productName: '苹果ipone11pro',
skuName: 'iphone11pro256g',
specModel: '165L',
quantity: 17,
snCode: '[SPP1Y79G1]',
price: '8999.00'
},
{
productName: '苹果ipone11pro',
skuName: 'iphone11pro256g',
specModel: '165L',
quantity: 17,
snCode: '[SPP1Y79G1]',
price: '8999.00'
},
{
productName: '苹果ipone11pro',
skuName: 'iphone11pro256g',
specModel: '165L',
quantity: 17,
snCode: '[SPP1Y79G1]',
price: '8999.00'
},
{
productName: '苹果ipone11pro',
skuName: 'iphone11pro256g',
specModel: '165L',
quantity: 17,
snCode: '[SPP1Y79G1]',
price: '8999.00'
},
{
productName: '苹果ipone11pro',
skuName: 'iphone11pro256g',
specModel: '165L',
quantity: 17,
snCode: '[SPP1Y79G1]',
price: '8999.00'
},
{
productName: '苹果ipone11pro',
skuName: 'iphone11pro256g',
specModel: '165L',
quantity: 17,
snCode: '[SPP1Y79G1]',
price: '8999.00'
},
{
productName: '苹果ipone11pro',
skuName: 'iphone11pro256g',
specModel: '165L',
quantity: 17,
snCode: '[SPP1Y79G1]',
price: '8999.00'
},
{
productName: '苹果ipone11pro',
skuName: 'iphone11pro256g',
specModel: '165L',
quantity: 17,
snCode: '[SPP1Y79G1]',
price: '8999.00'
},
{
productName: '苹果手机壳123',
skuName: 'iphone11pro256g',
specModel: '165L',
quantity: 9,
snCode: '[SPP1Y79G1]',
price: '23.00'
},
{
productName: '苹果ipone11pro',
skuName: 'iphone11pro124g',
specModel: '165L',
quantity: 13,
snCode: '[SPP1Y79G1]',
price: '7099.00'
}
]
}
Print.previewTemp(template, data)
}
}
}
</script>