Commit 55090f06 authored by 耿迪迪's avatar 耿迪迪

详情按钮问题修改

parent c7ab9608
<template> <template>
<div style="display: inline-block;width: 50px"> <div style="display: inline-block;width: 50px">
<el-button type="text" @click="open=true" size="mini">{{getOperatorName()}}</el-button> <el-button type="text" @click="openPurchaseDialog" size="mini">{{getOperatorName()}}</el-button>
<el-dialog :title="getOperatorName()" :visible.sync="open" width="800px" append-to-body :close-on-click-modal="false" destroy-on-close> <el-dialog :title="getOperatorName()" :visible.sync="open" width="800px" append-to-body :close-on-click-modal="false" destroy-on-close>
<component :is="currentTabComponent" :purchaseData="purchaseData" ref="currentCom" v-if="open"></component> <component :is="currentTabComponent" :purchaseData="purchaseData" ref="currentCom" v-if="open"></component>
<div slot="footer" class="dialog-footer" style="text-align: center" v-if="operatorName != 'purchaseDetail'"> <div slot="footer" class="dialog-footer" style="text-align: center" v-if="operatorName != 'purchaseDetail'">
...@@ -34,13 +34,6 @@ ...@@ -34,13 +34,6 @@
created(){ created(){
this.currentTabComponent = this.operatorName; this.currentTabComponent = this.operatorName;
}, },
watch: {
open(newVal,oldVal){
if(newVal){
this.getPurchaseInfo();
}
}
},
data(){ data(){
return{ return{
open: false, open: false,
...@@ -61,10 +54,11 @@ ...@@ -61,10 +54,11 @@
return ""; return "";
} }
}, },
getPurchaseInfo(){ openPurchaseDialog(){
getPurchase(this.purchaseInfo.purchaseId).then(res =>{ getPurchase(this.purchaseInfo.purchaseId).then(res =>{
if(res.code == 200){ if(res.code == 200){
this.purchaseData = res.data; this.purchaseData = res.data;
this.open = true;
} }
}) })
}, },
......
<template> <template>
<div style="display: inline-block;width: 50px"> <div style="display: inline-block;width: 50px">
<el-button type="text" @click="open=true" size="mini">{{getOperatorName()}}</el-button> <el-button type="text" @click="openDialog" size="mini">{{getOperatorName()}}</el-button>
<el-dialog :title="getOperatorName()" :visible.sync="open" width="800px" append-to-body :close-on-click-modal="false" destroy-on-close> <el-dialog :title="getOperatorName()" :visible.sync="open" width="800px" append-to-body :close-on-click-modal="false" destroy-on-close>
<component :is="currentTabComponent" :tradeData="tradeData" ref="currentCom" v-if="open"></component> <component :is="currentTabComponent" :tradeData="tradeData" ref="currentCom" v-if="open"></component>
<div slot="footer" class="dialog-footer" style="text-align: center" v-if="operatorName != 'tradeDetail'"> <div slot="footer" class="dialog-footer" style="text-align: center" v-if="operatorName != 'tradeDetail'">
...@@ -36,13 +36,6 @@ ...@@ -36,13 +36,6 @@
created(){ created(){
this.currentTabComponent = this.operatorName; this.currentTabComponent = this.operatorName;
}, },
watch: {
open(newVal,oldVal){
if(newVal){
this.getTradeInfo();
}
}
},
data(){ data(){
return{ return{
open: false, open: false,
...@@ -65,10 +58,11 @@ ...@@ -65,10 +58,11 @@
return ""; return "";
} }
}, },
getTradeInfo(){ openDialog(){
getProject(this.tradeInfo.tradeId).then(res =>{ getProject(this.tradeInfo.tradeId).then(res =>{
if(res.code == 200){ if(res.code == 200){
this.tradeData = res.data; this.tradeData = res.data;
this.open = true;
} }
}) })
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment