|
@@ -132,7 +132,7 @@ export default {
|
|
|
},
|
|
|
],
|
|
|
},
|
|
|
- tableData:[]
|
|
|
+ tableData:[],
|
|
|
};
|
|
|
},
|
|
|
watch: {
|
|
@@ -140,6 +140,10 @@ export default {
|
|
|
if(this.$route.path != '/administrator/editPaymentCode'){
|
|
|
return
|
|
|
}
|
|
|
+ if(this.form.id == this.id){
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
this.init()
|
|
|
},
|
|
|
},
|
|
@@ -163,7 +167,7 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
//查询数据并校验
|
|
|
- getById(){
|
|
|
+ async getById(){
|
|
|
if(!this.id){
|
|
|
this.$message.error('编辑缺少参数')
|
|
|
return
|
|
@@ -171,7 +175,7 @@ export default {
|
|
|
var params = {
|
|
|
ids: [this.id],
|
|
|
};
|
|
|
- this.$api.getPaymentCode(params).then(response=>{
|
|
|
+ await this.$api.getPaymentCode(params).then(response=>{
|
|
|
if(response.code == 200){
|
|
|
var data = response.data.records
|
|
|
if(data && data.length>0){
|
|
@@ -209,7 +213,7 @@ export default {
|
|
|
if (response.code === 200) {
|
|
|
this.btnLoading = false
|
|
|
this.$message.success( a + '成功');
|
|
|
- this.finish()
|
|
|
+ this.finish(response.data)
|
|
|
}
|
|
|
})
|
|
|
.catch(error => {
|
|
@@ -219,10 +223,16 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
- finish(){
|
|
|
+ finish(data){
|
|
|
if(this.model == 'add'){
|
|
|
- this.resetForm();
|
|
|
- this.init()
|
|
|
+ this.$alert('付费码:'+data, '添加成功', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ callback: action => {
|
|
|
+ this.resetForm();
|
|
|
+ this.init()
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
}else{
|
|
|
this.$store.commit('removeHistoryPath',this.$route.path);
|
|
|
this.$store.commit('removeHistory',this.$route.path);
|