Commit 1d8d3a5e authored by 高宇's avatar 高宇

第二种打印方式

parent 314a0aef
...@@ -14,13 +14,13 @@ ...@@ -14,13 +14,13 @@
"svgo": "svgo -f src/icons/svg --config=src/icons/svgo.yml" "svgo": "svgo -f src/icons/svg --config=src/icons/svgo.yml"
}, },
"dependencies": { "dependencies": {
"crypto-js": "4.1.1",
"compression-webpack-plugin": "^1.1.12",
"dsbridge": "^3.1.4",
"@riophae/vue-treeselect": "^0.4.0", "@riophae/vue-treeselect": "^0.4.0",
"axios": "0.18.1", "axios": "0.18.1",
"bpmn-js": "^6.1.1", "bpmn-js": "^6.1.1",
"bpmn-js-properties-panel": "^0.33.1", "bpmn-js-properties-panel": "^0.33.1",
"compression-webpack-plugin": "^1.1.12",
"crypto-js": "4.1.1",
"dsbridge": "^3.1.4",
"echarts": "^5.3.2", "echarts": "^5.3.2",
"element-resize-detector": "^1.2.4", "element-resize-detector": "^1.2.4",
"element-ui": "2.13.0", "element-ui": "2.13.0",
...@@ -42,6 +42,7 @@ ...@@ -42,6 +42,7 @@
"vue": "^2.7.14", "vue": "^2.7.14",
"vue-cropper": "^0.5.4", "vue-cropper": "^0.5.4",
"vue-pdf": "^4.1.0", "vue-pdf": "^4.1.0",
"vue-print-nb": "^1.7.5",
"vue-router": "3.0.6", "vue-router": "3.0.6",
"vuedraggable": "^2.23.2", "vuedraggable": "^2.23.2",
"vuex": "3.1.0" "vuex": "3.1.0"
......
import Vue from 'vue' import Vue from 'vue'
import 'normalize.css/normalize.css' // A modern alternative to CSS resets import 'normalize.css/normalize.css' // A modern alternative to CSS resets
import moment from 'moment' import moment from 'moment'
// 引用打印组件
import Print from 'vue-print-nb'
// import ElementUI from 'element-ui' // import ElementUI from 'element-ui'
// import './styles/element-variables.scss' // import './styles/element-variables.scss'
// import locale from 'element-ui/lib/locale/lang/en' // lang i18n // import locale from 'element-ui/lib/locale/lang/en' // lang i18n
...@@ -94,6 +96,9 @@ Vue.component('Pagination', Pagination) ...@@ -94,6 +96,9 @@ Vue.component('Pagination', Pagination)
Vue.use(permission) Vue.use(permission)
// 使用打印组件
Vue.use(Print);
new Vue({ new Vue({
el: '#app', el: '#app',
router, router,
......
<template> <template>
<div class="CheckBobyList"> <div class="CheckBobyList" id="nbprint">
<!-- 检查表主体--> <!-- 检查表主体-->
<div class="checkList"> <div class="checkList">
<!-- 检查表第一部分 --> <!-- 检查表第一部分 -->
...@@ -59,6 +59,7 @@ ...@@ -59,6 +59,7 @@
<div class="right"> <div class="right">
<el-form-item> <el-form-item>
<el-button class="scanCodeTop" type="primary" @click="scanCodes">扫码</el-button> <el-button class="scanCodeTop" type="primary" @click="scanCodes">扫码</el-button>
<el-button class="printCodeTop" type="primary" v-print="printOption">打印</el-button>
</el-form-item> </el-form-item>
<el-form-item label="rank:" prop="jcRank"> <el-form-item label="rank:" prop="jcRank">
<el-input <el-input
...@@ -2314,6 +2315,10 @@ export default { ...@@ -2314,6 +2315,10 @@ export default {
components: { TextToolTip }, components: { TextToolTip },
data() { data() {
return { return {
printOption: {
id: 'nbprint', // 打印元素的id 不需要携带#号
popTitle: '检查表'
},
submitLoadIng: false, submitLoadIng: false,
presentLoading: false, presentLoading: false,
approveLoading: false, approveLoading: false,
...@@ -2687,21 +2692,6 @@ export default { ...@@ -2687,21 +2692,6 @@ export default {
this.handleCyPn() this.handleCyPn()
}, },
methods: { methods: {
// 测试json
handleChagnge() {
const obj = {
jcLot: 1,
jcPn: 2,
jcRank: 3,
jcNum: 4
}
console.log('文本', JSON.stringify(obj))
const test = '{"jcLot":1,"jcPn":2,"jcRank":3,"jcNum":4}'
console.log('对象', JSON.parse(test))
// 测试空文本
const text2 = '{}'
console.log('测试空文本', JSON.parse(text2).jcLot)
},
handelTab(i, e) { handelTab(i, e) {
const that = this const that = this
if (!that.$refs['input' + i]) { if (!that.$refs['input' + i]) {
...@@ -4186,6 +4176,11 @@ export default { ...@@ -4186,6 +4176,11 @@ export default {
background: #0057ff; background: #0057ff;
border-radius: 4px; border-radius: 4px;
} }
.printCodeTop{
width: 20%;
border-radius: 4px;
float: inline-end;
}
::v-deep .el-form-item__label { ::v-deep .el-form-item__label {
width: 100px; width: 100px;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment