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
138
139
140
141
142
143
| <template>
| <div>
| <vol-box
| :lazy="true"
| :model.sync="modelT"
| :title="123"
| :height="200"
| :width="400"
| :padding="15"
| >
| <div class="formContainer">
| <el-form
| :inline="true"
| size="mini"
| :rules="rules"
| ref="ruleForm"
| :model="ruleForm"
| >
| <el-form-item label="托盘号:" prop="trayCode" size="mini">
| <el-input
| size="mini"
| v-model="ruleForm.trayCode"
| placeholder="请输入托盘号"
| clearable
| ></el-input>
| </el-form-item>
| </el-form>
| </div>
| <div slot="footer">
| <Button type="info" @click="getData == true ? getDataFanc() : savechange('ruleForm')">{{btonCont}}</Button>
| <Button type="error" @click="modelT = false">关闭</Button>
| </div>
| </vol-box>
| </div>
| </template>
| <script defer = "true">
| import VolBox from '@/components/basic/VolBox.vue'
| export default {
| components: { 'vol-box': VolBox},
| methods: {},
| data () {
| return {
| ruleForm: {
| trayCode: ''
| },
| focu: false,
| modelT: false,
| btonCont:'',
| getData:'',
| parm:{
| barcodeUp:'',
| barcodeDown:'',
| line:'',
| },
|
| rules: {
| trayCode: [
| { required: true, message: '请扫描电池条码', trigger: 'blur' }
| ]
| }
| }
| },
| methods: {
| savechange (formName) {
| this.$refs[formName].validate((valid) => {
| if (valid) {
| let url = '/api/dt_boxing_head/UntieGroupBattery?traycode=' + this.ruleForm.trayCode
| this.http
| .post(url, {}, '解绑中...')
| .then((x) => {
| if (x.status) {
| this.$Notice.success({
| title: '解绑',
| desc: '解绑成功!',
| duration: 5
| })
| // 调用 windows中Location的reload方法,来实现 刷新的功能
| // window.location.reload()
| this.$emit('parentCall', $vue => {
| $vue.refresh()
| })
| this.ruleForm.trayCode = "";
| this.modelT = false
| } else {
| this.$Notice.error({
| title: '解绑',
| desc: '解绑失败' + x.message,
| duration: 5
| })
| }
| })
| } else {
| return false
| }
| })
| },
| getDataFanc(){
| let url = '/api/ToWCS/ZhuYeSaveBarcodeInfo?barcode=' + this.ruleForm.trayCode;
| this.http
| .post(url, this.parm, '正在获取数据...')
| .then((x) => {
| if (x.status) {
| this.$Notice.success({
| title: '获取数据',
| desc: '获取数据成功!',
| duration: 5
| })
| // 调用 windows中Location的reload方法,来实现 刷新的功能
| // window.location.reload()
| this.$emit('parentCall', $vue => {
| $vue.refresh()
| })
| this.ruleForm.trayCode = "";
| this.modelT = false
| } else {
| this.$Notice.error({
| title: '获取数据',
| desc: '获取数据失败' + x.message,
| duration: 5
| })
| }
| })
|
| }
|
| }
| }
| </script>
| <style>
| .formContainer{
| position: absolute;
| width: 100%;
| height: 100%;
| display: flex;
| justify-content: center;
| align-items: center;
| }
|
| .el-input {
| width: 220px;
| }
|
| </style>
|
|