无人机管理后台前端(已迁走)
张含笑
2025-11-14 f360e29223b8ec255d30a7a96e941c7b860a9bf7
feat:导出工单报表
2 files modified
35 ■■■■■ changed files
src/api/tickets/ticket.js 9 ●●●●● patch | view | raw | blame | history
src/views/tickets/ticket.vue 26 ●●●●● patch | view | raw | blame | history
src/api/tickets/ticket.js
@@ -103,4 +103,13 @@
    url: `/drone-device-core/wayline/waylineJobInfo/createEventJob/${id}`,
    method: 'post',
  })
}
// 导出工单
export const exportTheTicket = params => {
    return request({
        url: `/drone-device-core/jobEvent/downloadEvent`,
        method: 'get',
        responseType: 'blob',
        params,
    })
}
src/views/tickets/ticket.vue
@@ -206,6 +206,7 @@
                @click="openReviewDialog"
                >批量审核
              </el-button>
              <el-button
                v-if="permissionList.exportBtn"
                type="success"
@@ -232,7 +233,12 @@
                  >详情
                </el-button>
              </template>
              <template  v-if="row.status === 4 && activeTab === 'completed'">
                <el-button type="text" icon="el-icon-download"  @click="exportTheTick(row)"
                  >导出
                </el-button>
              </template>
              <template v-if="permission.tickets_repeat_review">
                <el-button
                  v-if="row.status === 4 && row.isReview !== 1"
@@ -1010,6 +1016,7 @@
  getStepInfo,
  getReviewById,
  getCreateEventJob,
  exportTheTicket
} from '@/api/tickets/ticket';
import { getSFDictionaryTree } from '@/api/job/task';
import { export_json_to_excel } from '@/utils/exportExcel';
@@ -3188,6 +3195,23 @@
          });
      }
    },
    // 导出工单报表
    exportTheTick(row){
      const params = {
        num:row.orderNumber
      }
      exportTheTicket(params).then(res=>{
      const elink = document.createElement('a')
      elink.download = row.orderName + '.docx'
      elink.style.display = 'none'
      const blob = new Blob([res.data])
      elink.href = URL.createObjectURL(blob)
      document.body.appendChild(elink)
      elink.click()
      document.body.removeChild(elink)
      })
       this.$message.success('数据导出成功');
    }
  },
  activated() {
    this.handleReset();