cz 1 год назад
Родитель
Сommit
7099c1a4ae
1 измененных файлов с 12 добавлено и 4 удалено
  1. 12 4
      src/views/process/processApproval/index.vue

+ 12 - 4
src/views/process/processApproval/index.vue

@@ -112,9 +112,7 @@
       <el-tabs v-model="activeName" class="demo-tabs">
         <el-tab-pane label="处理意见" name="first" v-if="isShowSubmitDom">
           <div style="overflow: auto; height: calc(100vh - 200px)">
-            <div style="padding-bottom:50px"
-                 v-if="(userInfo.roles.includes('ceo') || userInfo.roles.includes('salesDirector') ||
-                 userInfo.roles.includes('financeOfficer') || userInfo.roles.includes('approve_ accountant')) && (route.query.processType==10 || route.query.processType==30) ">
+            <div style="padding-bottom:50px" v-if="showChart">
               <div style="margin-bottom:10px;">
                 <TitleInfo :content="'利润预算波动'"></TitleInfo>
               </div>
@@ -728,7 +726,17 @@ const optionTwo = reactive({
     ],
   },
 });
+const showChart = ref(false);
 onMounted(async () => {
+  if (
+    (userInfo.roles.includes("ceo") ||
+      userInfo.roles.includes("salesDirector") ||
+      userInfo.roles.includes("financeOfficer") ||
+      userInfo.roles.includes("approve_ accountant")) &&
+    (route.query.processType == 10 || route.query.processType == 30)
+  ) {
+    showChart.value = true;
+  }
   // 路由进入
   if (route.query && route.query.flowKey) {
     //processType 10 为修改 20为查看 30回退发起
@@ -758,7 +766,7 @@ onMounted(async () => {
 
   $bus.on("getGrossData", (data) => {
     nextTick(() => {
-      if (data && data.length > 1) {
+      if (data && data.length > 1 && showChart.value) {
         myChart = echarts.init(chartDom.value);
         window.addEventListener("resize", () => {
           myChart.resize();