|
@@ -53,30 +53,22 @@ export default {
|
53
|
53
|
this.init(1)
|
54
|
54
|
},
|
55
|
55
|
methods: {
|
56
|
|
- enableEvent (data, type) {//启用/禁用
|
57
|
|
- this.loading = true
|
58
|
|
- let params = {
|
59
|
|
- drama_id: data.drama_id,
|
60
|
|
- user_id: data.user_id,
|
61
|
|
- start_date: data.start_date,
|
62
|
|
- end_date: data.end_date,
|
63
|
|
- rela_id: data.id,
|
64
|
|
- enable: type
|
65
|
|
- }
|
66
|
|
- this.$axios.post(this.URL.BASEURL + this.URL.pitcher_relaEdit, params).then((res) => {
|
67
|
|
- var res = res.data
|
68
|
|
- this.loading = false
|
|
56
|
+ async enableEvent ({ drama_id, user_id, start_date, end_date, rela_id }, type) {//启用/禁用
|
|
57
|
+ try {
|
|
58
|
+ const params = { drama_id, user_id, start_date, end_date, rela_id, enable: type }
|
|
59
|
+ this.loading = true
|
|
60
|
+ const { data: res = {} } = await this.$axios.post(this.URL.BASEURL + this.URL.adqAccount_adqEditPitcher, params)
|
69
|
61
|
if (res && res.errno == 0) {
|
70
|
62
|
this.init(this.page)
|
|
63
|
+ this.$message.success('操作成功')
|
71
|
64
|
} else if (res.errno != 4002) {
|
72
|
|
- this.$message({
|
73
|
|
- message: res.err,
|
74
|
|
- type: "warning"
|
75
|
|
- })
|
|
65
|
+ this.$message.warning(res.err)
|
76
|
66
|
}
|
77
|
|
- }).catch((err) => {
|
|
67
|
+ } catch (error) {
|
|
68
|
+ console.log('error => ', error)
|
|
69
|
+ } finally {
|
78
|
70
|
this.loading = false
|
79
|
|
- });
|
|
71
|
+ }
|
80
|
72
|
},
|
81
|
73
|
editEvent (data) {
|
82
|
74
|
this.editPitcher = data;
|
|
@@ -88,31 +80,29 @@ export default {
|
88
|
80
|
this.init(this.page)
|
89
|
81
|
}
|
90
|
82
|
},
|
91
|
|
- init (page) {
|
92
|
|
- this.page = page ? page : this.page;
|
93
|
|
- this.loading = true
|
94
|
|
- this.$axios.get(this.URL.BASEURL + this.URL.adqAccount_adqPitcherIndex, {
|
95
|
|
- params: {
|
96
|
|
- account_id: this.gzhData.account_id,
|
97
|
|
- page: this.page,
|
98
|
|
- page_size: this.page_size
|
99
|
|
- }
|
100
|
|
- }).then((res) => {
|
101
|
|
- var res = res.data
|
102
|
|
- this.loading = false
|
|
83
|
+ async init(page) {
|
|
84
|
+ try {
|
|
85
|
+ this.page = page ? page : this.page;
|
|
86
|
+ this.loading = true
|
|
87
|
+ const { data: res = {} } = await this.$axios.get(this.URL.BASEURL + this.URL.adqAccount_adqPitcherIndex, {
|
|
88
|
+ params: {
|
|
89
|
+ account_id: this.gzhData.account_id,
|
|
90
|
+ page: this.page,
|
|
91
|
+ page_size: this.page_size
|
|
92
|
+ }
|
|
93
|
+ })
|
103
|
94
|
if (res && res.errno == 0) {
|
104
|
95
|
this.infoList = res.rst.data;
|
105
|
96
|
this.total = res.rst.pageInfo.total;
|
106
|
97
|
this.pages = res.rst.pageInfo.pages;
|
107
|
98
|
} else if (res.errno != 4002) {
|
108
|
|
- this.$message({
|
109
|
|
- message: res.err,
|
110
|
|
- type: "warning"
|
111
|
|
- })
|
|
99
|
+ this.$message.warning(res.err)
|
112
|
100
|
}
|
113
|
|
- }).catch((err) => {
|
|
101
|
+ } catch (error) {
|
|
102
|
+ console.log('error => ', error)
|
|
103
|
+ } finally {
|
114
|
104
|
this.loading = false
|
115
|
|
- });
|
|
105
|
+ }
|
116
|
106
|
},
|
117
|
107
|
handleCurrentChange (val) {
|
118
|
108
|
this.init(val)
|