moveH.vue
2.66 KB
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
<template>
<div>
<el-dialog
title="移动户"
:visible.sync="isVisible"
width="50%"
@close="close"
:modal-append-to-body="false"
center>
<div>
<div class="bottom-radio">
<el-radio-group v-model="moveHdata.sxzylx">
<el-radio label="up">向上</el-radio>
<el-radio label="down">向下</el-radio>
<el-radio label="left">向左</el-radio>
<el-radio label="right">向右</el-radio>
</el-radio-group>
</div>
<div class="bottom-buttom">
<el-button type="primary" @click="save">确认</el-button>
<el-button type="primary" @click="cacel">取消</el-button>
</div>
</div>
</el-dialog>
</div>
</template>
<script>
import {moveH} from './../../api/lpb'
import {Message} from 'element-ui'
export default {
name: "moveH",
data() {
return {
isVisible: false,
moveHdata: {
hbsm: "",
sxzylx: "",
type: ""
}
}
},
props: {
moveHvisible: {
type: Boolean,
default: false
},
hbsm: {
type: String
},
type: {
type: String
}
},
methods: {
loading: function () {
this.$emit('loading')
},
save() {
this.moveHdata.hbsm = this.hbsm
this.moveHdata.type = this.type
moveH(this.moveHdata).then(res => {
console.log(res)
if (res.success) {
this.loading();
this.close();
Message.success("移动成功")
} else {
Message.error(res.message)
}
})
},
cacel() {
this.close()
},
close() {
this.$emit('close');
}
},
watch: {
moveHvisible(val) {
this.isVisible = val
}
}
}
</script>
<style scoped lang="less">
.bottom-radio{
text-align: center;
}
.el-radio{
padding: 20px;
}
.bottom-buttom {
margin-top: 20px;
text-align: center;
}
</style>