|
@@ -122,12 +122,11 @@ export default {
|
|
|
{ required: true, message: '请选择绑定内容', trigger: 'change' }
|
|
|
]
|
|
|
},
|
|
|
- vipInfo: {},
|
|
|
- values: []
|
|
|
+ edit: false
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
- ...mapState(['vipList', 'Total', 'dict', 'intactList', 'contentList', 'tabList', 'typeList'])
|
|
|
+ ...mapState(['vipList', 'Total', 'dict', 'intactList', 'contentList', 'tabList', 'typeList', 'powerList'])
|
|
|
},
|
|
|
async mounted() {
|
|
|
await this.tabQuery();
|
|
@@ -135,7 +134,7 @@ export default {
|
|
|
await this.filterQuery();
|
|
|
},
|
|
|
methods: {
|
|
|
- ...mapActions(['vipQuery', 'vipCreate', 'vipUpdate', 'vipDelete', 'statusQuery', 'tabQuery', 'contentsQuery', 'intactQuery', 'typeQuery', 'powerCreate', 'powerupdate']),
|
|
|
+ ...mapActions(['vipQuery', 'vipCreate', 'vipUpdate', 'vipDelete', 'statusQuery', 'tabQuery', 'contentsQuery', 'intactQuery', 'typeQuery', 'powerCreate', 'powerupdate', 'powerquery']),
|
|
|
// 导出
|
|
|
async exportvip() {
|
|
|
console.log('导出');
|
|
@@ -158,6 +157,10 @@ export default {
|
|
|
this.list = this.contentList;
|
|
|
}
|
|
|
const label = e == 0 ? '绑定期刊' : '绑定文章';
|
|
|
+ if (this.edit) {
|
|
|
+ await this.powerquery({ openid: this.formdata.openid, type: e });
|
|
|
+ this.$refs.formData.setForm('list', this.powerList.list);
|
|
|
+ }
|
|
|
this.formfiled = this.formfiled.filter(e => e.name !== 'list');
|
|
|
this.formfiled.push({ name: 'list', label, formater: 'slot' });
|
|
|
},
|
|
@@ -166,14 +169,15 @@ export default {
|
|
|
this.formdata = {};
|
|
|
this.title = '添加vip';
|
|
|
this.visibleSync = true;
|
|
|
+ this.edit = false;
|
|
|
},
|
|
|
// 修改
|
|
|
- filtereEdit (e) {
|
|
|
+ async filtereEdit (e) {
|
|
|
this.formdata = e;
|
|
|
- // console.log(e);
|
|
|
this.tabChange(e.vipTab);
|
|
|
this.title = '修改vip';
|
|
|
this.visibleSync = true;
|
|
|
+ this.edit = true;
|
|
|
},
|
|
|
// 删除
|
|
|
async filterDelete (e) {
|
|
@@ -187,7 +191,6 @@ export default {
|
|
|
},
|
|
|
// 表单保存
|
|
|
async formSave (e) {
|
|
|
- console.log(e);
|
|
|
if (e.isRevise && e?.isRevise == false) {
|
|
|
this.$message.warning('未作修改');
|
|
|
return;
|
|
@@ -197,15 +200,21 @@ export default {
|
|
|
// 修改
|
|
|
if (e._id) {
|
|
|
res = await this.vipUpdate(e);
|
|
|
- if (e.vipTab == 'vip') await this.powerupdate(e);
|
|
|
msg = 'vip修改成功';
|
|
|
} else {
|
|
|
res = await this.vipCreate(e);
|
|
|
- if (e.vipTab == 'vip') await this.powerCreate(e);
|
|
|
msg = 'vip添加成功';
|
|
|
}
|
|
|
+ if (e.vipTab == 'vip') {
|
|
|
+ if (this.powerList.length < 1) {
|
|
|
+ await this.powerCreate(e);
|
|
|
+ } else {
|
|
|
+ await this.powerupdate({ ...e, id: this.powerList._id });
|
|
|
+ }
|
|
|
+ }
|
|
|
this.$resChange(res, msg);
|
|
|
this.filterQuery();
|
|
|
+ await this.powerquery({ openid: this.formdata.openid, type: e.type });
|
|
|
this.visibleSync = false;
|
|
|
this.formfiled = this.formfiled.filter(e => e.name !== 'list' && e.name !== 'type');
|
|
|
},
|