ShiftRuleDialog.vue
1.58 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
<template>
<ht-dialog
:single="single"
:data="data"
:table-columns="tableColumns"
:pagination="pagination"
search-placeholder="名称或编码"
dialog-title="轮班对话框"
quick-search-props="name,key"
:destroy-on-close="destroyOnClose"
@load="handleLoad"
@onConfirm="onConfirm"
ref="htDialog"
:append-to-body='true'
/>
</template>
<script>
import uc from "@/api/uc.js";
export default {
name: "shift-rule-dialog",
props: {
value: Array,
name: String,
single: Boolean,
destroyOnClose:{
type: Boolean,
default: false
}
},
data() {
return {
data: [],
tableColumns: [
{ prop: "name", label: "名称" },
{ prop: "key", label: "编码" },
{ prop: "desc", label: "描述" }
],
pagination: {
page: 1,
pageSize: 50,
total: 0
}
};
},
methods: {
showDialog() {
this.$refs.htDialog.showDialog();
},
handleLoad(param, cb) {
uc.ruleList(param)
.then(data => {
this.data = data.rows;
this.pagination.page = data.page;
this.pagination.pageSize = data.pageSize;
this.pagination.total = data.total;
cb();
})
.catch(err => {
cb();
});
},
onConfirm(selection) {
this.$emit("onConfirm", selection,this.name);
this.$emit("input", selection);
}
}
}
</script>
<style scoped>
</style>