1
lzhe
2025-07-08 72ced2b9b16581d57071c8b27069729a1fef7e74
src/views/flowmgr/timeoutQuery.vue
@@ -1,5 +1,6 @@
<template>
  <basic-container>
    <avue-form v-model="searchForm" :option="serachOption" @submit="searchSubmit"></avue-form>
    <avue-crud
      :addBtn="false"
      :option="option"
@@ -16,16 +17,50 @@
      @on-load="onLoad"
    >
      <template #menu-left>
        <el-button type="primary" size="default" icon="el-icon-circle-plus" plain @click="handleEdit">导出</el-button>
        <el-button type="primary" size="default" icon="el-icon-circle-plus" plain @click="handleExport">导出</el-button>
      </template>
    </avue-crud>
  </basic-container>
</template>
<script>
import { exportBlob } from '@/api/common';
import { getToken } from '@/utils/auth';
import NProgress from 'nprogress';
import { downloadXls } from '@/utils/util';
import 'nprogress/nprogress.css';
export default {
  data() {
    return {
      searchForm: {},
      serachOption: {
        labelWidth: 90,
        menuSpan: 6,
        submitText: "查询",
        emptyBtn: false,
        column: [
          {
            label: "任务时间",
            prop: "daterange",
            type: "daterange",
            format: 'YYYY-MM-DD',
            valueFormat: 'YYYY-MM-DD',
            startPlaceholder: '日期开始范围自定义',
            endPlaceholder: '日期结束范围自定义',
            span: 6
          },
          {
            label: '执行人员',
            prop: 'assigneeName',
            span: 6
          },
          {
            label: '关键字',
            prop: 'keyword',
            span: 6
          }
        ]
      },
      search: {
        keyword: "",
        machineGroupCode: ""
@@ -46,38 +81,28 @@
        menu: false,
        column: [
          {
            label: '任务时间',
            type: 'input',
            prop: '',
            search: true,
            hide: true
          },
          {
            label: '执行人员',
            type: 'input',
            prop: '',
            search: true
            prop: 'assigneeName',
          },
          {
            label: '任务名称',
            prop: '',
            prop: 'taskName',
          },
          {
            label: '任务节点',
            prop: '',
            prop: 'assignee',
          },
          {
            label: '任务到达时间',
            prop: '',
            prop: 'createTime',
          },
          {
            label: '要求完成时间',
            prop: '',
            prop: 'claimTime',
          },
          {
            label: '详情',
            prop: '',
            search: true,
            label: '关键字',
            prop: 'keyword',
            hide: true
          }
        ],
@@ -86,8 +111,24 @@
    };
  },
  methods: {
    handleEdit(row,index) {
    searchSubmit(params,done) {
      this.onLoad(params);
      done();
    },
    handleExport() {
      this.$confirm('是否导出?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning',
      }).then(() => {
        NProgress.start();
        exportBlob(
          `/blade-mdm/flow/mgr/overtime-export?${this.website.tokenHeader}=${getToken()}`
        ).then(res => {
          downloadXls(res.data, `超时导出${this.$dayjs().format('YYYY-MM-DD HH:mm:ss')}.xlsx`);
          NProgress.done();
        });
      });
    },
    searchReset() {
      //this.onLoad(this.mypage);
@@ -106,18 +147,21 @@
    refreshChange() {
      
    },
    onLoad() {
      this.loading = true;
      var obj = {
        keyword: this.search.keyword,
        machineGroupCode: this.search.machineGroupCode,
        current: this.mypage.current,
        size: this.mypage.size,
    onLoad(params) {
      if(this.searchForm.daterange == undefined) {
        this.searchForm.createTimeBegin = "";
        this.searchForm.createTimeEnd = "";
      }else if(this.searchForm.daterange.length == 1) {
        this.searchForm.createTimeBegin = this.searchForm.daterange[0];
      }else if(this.searchForm.daterange.length == 2) {
        this.searchForm.createTimeBegin = this.searchForm.daterange[0];
        this.searchForm.createTimeEnd = this.searchForm.daterange[1];
      }
      this.loading = true;
      axios({
        url: '/blade-mdm/machine/page',
        url: '/blade-mdm/flow/mgr/overtime-list',
        method: 'get',
        date: obj,
        params: this.searchForm,
      }).then(
        res => {
          const data = res.data.data;