小小儁爺
2 天以前 bf27b7dfd289079378b965160005581948ccd5ba
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
<template>
  <div>
 
    <div id="printMe" class="main">
      <div style="text-align: center">
        <h1 style="font-size: 40px">成品入库标识卡</h1>
      </div>
      <div class="container">
        <div class="block">日期</div>
        <div class="block">  <el-input v-model="form.value1" /></div>
        <div class="block">生产单号</div>
        <div class="block"> <el-input v-model="form.value2" /></div>
 
        <div class="block">型号</div>
        <div class="block"> <el-input v-model="form.value3" /></div>
        <div class="block">线别</div>
        <div class="block"> <el-input v-model="form.value4" /></div>
 
        <div class="block">颜色</div>
        <div class="block"> <el-input v-model="form.value5" /></div>
        <div class="block" style="border-right: none">台数/托数:</div>
        <div class="block" style="border-left: none"> <el-input v-model="form.value6" /></div>
      </div>
    </div>
 
    <div style="display: flex;margin:100px  805px;">
      <el-button type="info" @click="reset">清 空</el-button>
      <el-button v-print="printObj" type="primary">打 印</el-button>
    </div>
 
  </div>
</template>
 
<script>
export default {
  name: 'WarehouseEntryIdCard',
  data() {
    return {
 
      form: {
        value1: '',
        value2: '',
        value3: '',
        value4: '',
        value5: '',
        value6: ''
      },
 
      printObj: {
        id: 'printMe',
        popTitle: '打印模板',
        preview: false,
        extraHead: '<meta http-equiv="Content-Language" content="zh-cn"/>',
        closeCallback(vue) { // 关闭打印的回调事件(无法确定点击的是确认还是取消)
          console.log('11212', vue)
          // vue.dialogVisible = false
          // vue.dialogVisibleApprove = false
        },
        beforeOpenCallback(vue) {
          // vue.printLoading = true
          console.log('打开之前')
          console.log()
        },
        openCallback(vue) {
          // vue.printLoading = false
          console.log('执行了打印')
        }
      }
    }
  },
  mounted() {
  },
  methods: {
    reset() {
      this.form.value1 = ''
      this.form.value2 = ''
      this.form.value3 = ''
      this.form.value4 = ''
      this.form.value5 = ''
      this.form.value6 = ''
    }
  }
}
</script>
 
<style scoped>
.main {
  display: flex;
  flex-direction: column;
  width: 800px;
  height: 600px;
  padding: 20px 20px;
}
 
.container {
  width: 100%;
  height: 100%;
  border: 1px solid #000;
  display: flex;
  flex-wrap: wrap;
}
 
.block {
  width: 25%;
  height: 33.3%;
  border: 1px solid #000;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 24px;
}
 
.block:nth-child(odd) {
  width: 20%;
}
 
.block:nth-child(even) {
  width: 30%;
}
 
::v-deep .el-input__inner{
  border: none;
  font-weight: 700;
  font-size: 24px;
}
</style>
<style media="print">
/*@media print {*/
@page {
  size: auto;
  margin: 1mm;
}
 
</style>