doum
9 天以前 0201c32312f6478b2bde706607c8c6338e9e1d06
admin/src/views/business/ywelectricalactions.vue
@@ -59,6 +59,17 @@
            <el-button type="text" :disabled="!row.responseBody" @click="openJson('响应报文', row.responseBody)">查看</el-button>
          </template>
        </el-table-column>
        <el-table-column label="操作" min-width="120" align="center" fixed="right">
          <template slot-scope="{ row }">
            <el-button
              v-if="row.status === 0 && row.oprId"
              type="text"
              :loading="queryLoadingId === row.id"
              v-permissions="['business:ywelectricalactions:queryResult']"
              @click="handleQueryResult(row)"
            >手动查询结果</el-button>
          </template>
        </el-table-column>
      </el-table>
      <pagination
        @size-change="handleSizeChange"
@@ -101,7 +112,8 @@
      actionTypeOptions: Object.keys(ACTION_TYPE_MAP).map(key => ({
        value: Number(key),
        label: ACTION_TYPE_MAP[key]
      }))
      })),
      queryLoadingId: null
    }
  },
  created () {
@@ -164,6 +176,16 @@
    openJson (title, content) {
      if (!content) return
      this.$refs.jsonWindow.open(title, { content })
    },
    handleQueryResult (row) {
      this.queryLoadingId = row.id
      actionsApi.queryResult(row.id)
        .then(msg => {
          this.$tip.success(msg || '查询完成')
          this.handlePageChange(this.tableData.pagination.pageIndex)
        })
        .catch(e => this.$tip.apiFailed(e))
        .finally(() => { this.queryLoadingId = null })
    }
  }
}