fqsqDialog.vue
1.29 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
<template>
<dialogBox title="查询权利信息" width="85%" :isButton="false" @closeDialog="closeDialog" v-model="myValue">
<component :is="editItem" />
</dialogBox>
</template>
<script>
export default {
props: {
value: { type: Boolean, default: true },
bsmSqyw: { type: String, default: '' },
djywbm: { type: String, default: '' },
},
data () {
return {
editItem: '',
myValue: this.value,
};
},
watch: {
value (val) {
this.myValue = val
this.fetchData()
},
djywbm (val) {
let itemObj = { 'A03100': 'scdj', default: 'scdj' }
this.editItem = this.loadView(itemObj[val])
},
},
methods: {
loadView (view) {
return r => require.ensure([], () => r(require(`../${view}/${view}.vue`)))
},
fetchData () {
if (this.value) {
selectBdcdy({ ...this.queryForm, ...this.pageData })
.then((res) => {
if (res.code === 200) {
let { total, records } = res.result;
this.tableData.total = total;
this.tableData.data = records;
}
})
}
},
closeDialog () {
this.$emit("input", false);
}
},
};
</script>
<style scoped lang="scss">
@import "~@/styles/mixin.scss";
@import "~@/styles/public.scss";
</style>