Fixiaobai
2023-10-13 e8308ddac0ba4a1f406e8f63d7e6b6f2541cb770
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
135
136
137
<template>
  <el-dialog
    width="30%"
    title="打印密码"
    :visible.sync="innerVisible"
    append-to-body
    @close="$emit('update:currshowlist', false)"
    :show="currshowlist"
    :close-on-click-modal="false"
    :before-close="handleClose"
    class="print-secrest-form-dialog"
  >
    <div
      style="width: 100%;box-sizing: border-box;display:flex;margin-bottom:10px;"
    >
      <el-row
        ><el-col :span="6">密码:</el-col
        ><el-col :span="16"><el-input v-model="password"></el-input></el-col
      ></el-row>
    </div>
    <div slot="footer" class="dialog-footer">
      <el-button @click="cancel">取 消</el-button>
      <el-button type="primary" v-thinclick="`dataFormSubmit`">确 定</el-button>
    </div>
  </el-dialog>
</template>
<style>
.print-secrest-form-dialog .el-dialog__body {
  padding-bottom: 0px;
}
 
.print-secrest-form-dialog .el-dialog__body:after {
  content: '';
  clear: both;
  overflow: hidden;
  display: block;
  visibility: hidden;
}
 
.print-secrest-form-dialog .el-dialog__body .el-table__header th {
  padding-top: 0px;
}
 
.print-secrest-form-dialog .el-dialog__body .el-table__body-wrapper {
  height: 260px;
  overflow-y: auto;
}
 
.print-secrest-form-dialog .el-dialog__body .el-table::before {
  height: 0px;
}
 
/*
  字符串过长时,隐藏显示省略号
   */
.inline-el-hidden {
  display: block;
  width: 93%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin: 0 auto;
}
</style>
<script>
import { checkLabelPrintPassword } from '@/api/product/personboard'
import { mapGetters } from 'vuex'
export default {
  components: {},
  props: {
    currshowlist: {
      type: Boolean,
      default: false
    },
    outputs: {
      type: Array,
      default: () => {
        return []
      }
    },
    statusCheck: {
      type: Boolean,
      default: false
    }
  },
  data() {
    return {
      innerVisible: false,
      password: null
    }
  },
  computed: {
    ...mapGetters(['permissions', 'userInfo'])
  },
  methods: {
    dataFormSubmit() {
      if (this.password != null && this.password != '') {
        const ids = []
        this.outputs.forEach((item) => {
          ids.push(item.outputId)
        })
        checkLabelPrintPassword({
          password: this.password,
          ids: ids,
          isSubmit: !this.statusCheck
        }).then((response) => {
          const resData = response.data
          if (resData.code == 0) {
            this.$emit('goOnPrint', true)
          } else {
            this.$emit('goOnPrint', false)
          }
          this.innerVisible = false
        })
      } else {
        this.$message.error('请输入密码')
      }
    },
    handleClose() {
      this.$emit('cancelClose')
    },
    cancel() {
      this.innerVisible = false
      this.$emit('cancelCloseCancel')
    }
  },
  watch: {
    currshowlist() {
      this.innerVisible = this.currshowlist
      if (this.currshowlist) {
        this.password = null
        this.$nextTick(() => {})
      }
    }
  }
}
</script>