zouyu
2023-11-17 d8ac6057eaad648687699e25a575f3b7b8c1b102
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
<template>
  <el-dialog
    width="40%"
    title="强制打印密码校验"
    top="15vh"
    :visible.sync="innerVisible"
    append-to-body
    @close="$emit('update:currshowlist', false)"
    :show="currshowlist"
    :close-on-click-modal="false"
    class="part-dialog"
  >
    <div style="margin-bottom:10px;">
      <span style="color:red;"
        >异常提示:“ {{ hintMsg == null ? '' : hintMsg }} ”</span
      >
    </div>
    <div style="display:flex;">
      <div style="width:50px;line-height:32px;"><span>密码:</span></div>
      <div>
        <el-input
          v-model="password"
          placeholder="请输入密码"
          show-password
        ></el-input>
      </div>
    </div>
    <div slot="footer" class="dialog-footer">
      <el-button @click="innerVisible = false">取 消</el-button>
      <el-button type="primary" @click="confirmData">确定</el-button>
    </div>
  </el-dialog>
</template>
<script>
import { checkSubmitPassword } from '@/api/huawei/code19gross'
export default {
  props: {
    currshowlist: {
      type: Boolean,
      default: false
    },
    tackingList: {
      type: Object,
      default: () => {
        return {}
      }
    },
    hintMsg: {
      type: String
    },
    grossweightcodeobj: {
      type: Object,
      default: () => {
        return {}
      }
    }
  },
  data() {
    return {
      innerVisible: false,
      password: null
    }
  },
  watch: {
    currshowlist() {
      this.innerVisible = this.currshowlist
      this.password = null
      if (this.currshowlist) {
        this.$nextTick(() => {})
      }
    }
  },
  methods: {
    confirmData() {
      if (this.password != null) {
        checkSubmitPassword(this.password, this.grossweightcodeobj.id).then(
          (response) => {
            const resData = response.data
            console.log(resData)
            if (resData.code === 0) {
              this.$emit('confirmSecret', this.tackingList)
              this.innerVisible = false
            }
          }
        )
      } else {
        this.$message.error('请输入密码')
      }
    }
  }
}
</script>
<style scoped></style>