daiqisheng пре 3 година
родитељ
комит
d824b5b6df

+ 13 - 6
src/pages/main/performance/components/dialog.vue

@@ -4,6 +4,7 @@
     :visible.sync="visible"
     :fullscreen="fullscreen"
     :key="reload"
+    :props="props"
     :before-close="handleCancel"
     :modal-append-to-body="false"
     :width="width"
@@ -14,8 +15,10 @@
     <div slot="footer">
       <slot name="footer">
         <el-button @click="handleCancel" size="small">取消</el-button>
-        <el-button @click="handleConfirm" type="primary" size="small">确定</el-button>
-        </slot>
+        <el-button @click="handleConfirm" type="primary" size="small"
+          >确定</el-button
+        >
+      </slot>
     </div>
   </el-dialog>
 </template>
@@ -31,6 +34,10 @@ export default {
       type: String,
       default: "",
     },
+    props: {
+      type: String,
+      default: "",
+    },
     reload: {
       type: Number,
       default: 0,
@@ -40,9 +47,9 @@ export default {
       default: "500px",
     },
     fullscreen: {
-        type: Boolean,
-        default: false
-    }
+      type: Boolean,
+      default: false,
+    },
   },
   mounted() {
     console.log("我被初始化了");
@@ -54,7 +61,7 @@ export default {
     },
     //   取消的回调
     handleCancel() {
-      this.$emit("cancel", false);
+      this.$emit("cancel", { visible: false,props: this.props});
     },
   },
 };

+ 0 - 1
src/pages/main/performance/components/table.vue

@@ -155,7 +155,6 @@ export default {
       let visible = true;
       if (params) {
         visible = false;
-        console.log(Object.keys(params));
         Object.keys(params).forEach((element) => {
           if (params[element].includes(data[element])) {
             visible = true;

+ 16 - 30
src/pages/main/performance/department.vue

@@ -27,25 +27,20 @@
       :visible="visible"
       :reload="reload"
       width="1200px"
+      props="visible"
       @cancel="beforeCancel"
     >
       <template>
         <!-- 按钮部分 -->
         <div class="flex-justify-between padding-right-20 padding-left-20">
           <div>
-            <el-button type="primary" size="small">转派</el-button>
-            <el-button type="primary" @click="handleApprove" size="small"
-              >审批</el-button
-            >
-            <el-button type="primary" @click="handleTrack" size="small"
-              >流程跟踪</el-button
-            >
+            <el-button type="primary">转派</el-button>
+            <el-button type="primary" @click="handleApprove">审批</el-button>
+            <el-button type="primary" @click="handleTrack">流程跟踪</el-button>
             <el-button type="primary" size="small">导出</el-button>
           </div>
           <div>
-            <el-button @click="handleCancel" type="primary" size="small"
-              >返回</el-button
-            >
+            <el-button @click="handleCancel('visible')" type="primary">返回</el-button>
           </div>
         </div>
         <!-- 主体部分 -->
@@ -55,10 +50,10 @@
     </simple-dialog>
     <simple-dialog
       title="审批"
-      fullscreen
       :visible="approve_visible"
       :reload="reload"
       width="500px"
+      props="approve_visible"
       @cancel="beforeCancel"
     >
       <el-form :model="approveForm" :rules="approverules" ref="approveForm"
@@ -71,20 +66,20 @@
       <template v-slot:footer
         ><div>
           <div v-if="type === '1'">
-            <el-button @click="handleCancel">结束</el-button>
+            <el-button @click="handleCancel('approve_visible')">结束</el-button>
             <el-button @click="handleTurn(type)" type="primary"
               >转副总审批</el-button
             >
           </div>
           <div v-else-if="type === '2'">
-            <el-button @click="handleCancel">结束</el-button>
-            <el-button @click="handleCancel">打回</el-button>
+            <el-button @click="handleCancel('approve_visible')">结束</el-button>
+            <el-button @click="handleCancel('approve_visible')">打回</el-button>
             <el-button @click="handleTurn(type)" type="primary"
               >转总经理审批</el-button
             >
           </div>
           <div v-else>
-            <el-button @click="handleCancel">打回</el-button>
+            <el-button @click="handleCancel('approve_visible')">打回</el-button>
             <el-button @click="handleTurn(type)" type="primary">同意</el-button>
           </div>
         </div>
@@ -92,10 +87,10 @@
     </simple-dialog>
     <simple-dialog
       title="流程跟踪"
-      fullscreen
       :visible="track_visible"
       :reload="reload"
       width="600px"
+      props="track_visible"
       @confirm="handleConfirm"
       @cancel="beforeCancel"
     >
@@ -327,33 +322,24 @@ export default {
     // dialog事件
     //权限管理事件
     handleApprove() {
-      this.reload++;
-      this.visible = false;
       this.approve_visible = true;
     },
     handleTrack() {
-      this.reload++;
-      this.visible = false;
       this.track_visible = true;
     },
-    beforeCancel(data) {
-      this.visible = data;
-      this.approve_visible = data;
-      this.track_visible = data;
+    beforeCancel({visible,props}) {
+      this[props] = visible;
     },
     handleTurn(type) {
       console.log(type);
     },
     handleConfirm(visible) {
-      this.reload++;
+      console.log(visible);
       this.track_visible = visible;
     },
     // 关闭方法
-    handleCancel() {
-      this.reload++;
-      this.visible = false;
-      this.approve_visible = false;
-      this.track_visible = false;
+    handleCancel(data) {
+      this[data] = false;
     },
   },
 };

+ 2 - 0
src/pages/main/performance/mould.vue

@@ -23,12 +23,14 @@
         </div>
         <simple-dialog
             title="查看模板"
+            fullscreen
             width="1200px"
             @cancel="handleVisible('template')"
             @confirm="handleVisible('template')"
             :visible="template_visible"
         >
             <analysis />
+            <template v-slot:footer><div></div></template>
         </simple-dialog>
         <simple-dialog
             title="下发"