Explorar el Código

Merge branch 'monthly_report_daily_0.0.1' of git.xiaojukeji.com:pu_qa_tool/thoth-frontend into monthly_report_daily_0.0.1

qinzhipeng_v@didiglobal.com hace 4 años
padre
commit
3a3f4485ef

+ 16 - 13
src/views/monthlyReport/childrenPage/editReport/index.vue

@@ -366,8 +366,9 @@ export default {
       })
     },
     // 月报更新
-    upDateReport(key = 'cb') {
+    upDateReport(key = 'cb', confirmReportBack) {
       this.$store.dispatch(`monthlyReportEdit/${this.pageType.search(/All/) > -1 ? 'upDateReport' : 'upDateSubReport'}`, () => {
+        confirmReportBack && confirmReportBack()
         if (key === 'cb') {
           this.$router.push({ path: '/monthlyReport/index' })
         }
@@ -375,12 +376,13 @@ export default {
     },
     // 月报确认
     confirmReport() {
-      this.upDateReport('nocb')
-      this.$store.dispatch('monthlyReportEdit/confirmReport', {
-        id: this.$route.query.subReportId,
-        callback: () => {
-          this.$router.push({ path: '/monthlyReport/index' })
-        }
+      this.upDateReport('nocb', () => {
+        this.$store.dispatch('monthlyReportEdit/confirmReport', {
+          id: this.$route.query.subReportId,
+          callback: () => {
+            this.$router.push({ path: '/monthlyReport/index' })
+          }
+        })
       })
     },
     deleteReport(key) {
@@ -420,12 +422,13 @@ export default {
         // this.$message('发送操作已取消!')
         return
       }
-      this.upDateReport('nocb')
-      this.$store.dispatch('monthlyReportEdit/sendReport', {
-        id: this.$route.query.reportId,
-        callback: () => {
-          this.$router.push({ path: '/monthlyReport/index' })
-        }
+      this.upDateReport('nocb', () => {
+        this.$store.dispatch('monthlyReportEdit/sendReport', {
+          id: this.$route.query.reportId,
+          callback: () => {
+            this.$router.push({ path: '/monthlyReport/index' })
+          }
+        })
       })
     },
     // 月报退回

+ 12 - 2
src/views/monthlyReport/index.vue

@@ -10,6 +10,7 @@
           </el-option>
         </el-select>
       </template>
+
       <template slot="content">
         <div v-if="reportData.roleCode !== 30">
           <el-button type="primary" size="small" @click="createReport">新建月报</el-button>
@@ -38,7 +39,14 @@
       </el-row>
     </div>
     <!-- 新建月报 -->
-    <normal-dialog :show-dialog="createReportDialog" :title="'新建月报'" :width="'40%'" @confirm="createReportDatas()" @cancel="createReportDialog=false">
+    <normal-dialog
+ref="normalDialog"
+:show-dialog="false"
+is-succes
+:title="'新建月报'"
+:width="'40%'"
+@succes="createReportDatas()"
+@cancel="$refs.normalDialog.visible = false">
       <el-form ref="setReportData" :rules="rules" label-position="left" :model="setReportData" label-width="120px" class="report-create-margin">
         <el-form-item label="名称" prop="reportName">
           <el-input v-model="setReportData.reportName" clearable placeholder="请输入内容" style="width: 100%;" />
@@ -132,7 +140,8 @@ export default {
       }
     },
     async createReport() {
-      this.createReportDialog = true
+      // this.createReportDialog = true
+      this.$refs.normalDialog.visible = true
       const res = await getReportBizInfo()
       if (res.code === 200) {
         const list = res.data.bizList.map(x => { return x.id })
@@ -152,6 +161,7 @@ export default {
           createMonthlyReport(data).then(res => {
             if (res.code === 200) {
               this.loading = false
+              this.$refs.normalDialog.visible = false
               this.$router.push({ path: '/monthlyReport/edit', query: { pageType: 'editAll', reportId: res.data.id, type: 'create' }})
               window.log({ c: 'report_home', d: 'report_home_create' })
             }