Order-repeat-event.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. <template>
  2. <el-dialog v-model="state.dialogVisible" draggable title="重复性事件" ref="dialogRef" width="60%" append-to-body>
  3. <el-form :model="state.queryParams" ref="queryParamsRef" :inline="true" @submit.native.prevent>
  4. <el-form-item label="关键词" prop="Keyword">
  5. <el-input v-model="state.queryParams.Keyword" placeholder="事件标题/关键词" clearable @keyup.enter="handleQuery" />
  6. </el-form-item>
  7. <el-form-item label="创建时间" prop="exTime">
  8. <el-date-picker
  9. v-model="state.queryParams.exTime"
  10. type="datetimerange"
  11. unlink-panels
  12. range-separator="至"
  13. start-placeholder="开始时间"
  14. end-placeholder="结束时间"
  15. :shortcuts="shortcuts"
  16. @change="timeStartChangeCr"
  17. value-format="YYYY-MM-DD[T]HH:mm:ss"
  18. />
  19. </el-form-item>
  20. <el-form-item>
  21. <el-button type="primary" @click="handleQuery" :loading="state.loading"> <SvgIcon name="ele-Search" class="mr5" />查询 </el-button>
  22. <el-button @click="resetQuery(queryParamsRef)" :loading="state.loading" class="default-button">
  23. <SvgIcon name="ele-Refresh" class="mr5" />重置
  24. </el-button>
  25. </el-form-item>
  26. </el-form>
  27. <el-table :data="state.tableData" v-loading="state.loading" max-height="300">
  28. <el-table-column prop="phoneNo" label="标题" show-overflow-tooltip width="180">
  29. <template #default="{ row }">
  30. {{ row.title }}
  31. </template>
  32. </el-table-column>
  33. <el-table-column prop="hotspotName" label="关键词" show-overflow-tooltip> </el-table-column>
  34. <el-table-column prop="no" label="创建时间" show-overflow-tooltip width="170">
  35. <template #default="{ row }"> </template>
  36. </el-table-column>
  37. <el-table-column prop="currentStepName" label="创建人" show-overflow-tooltip></el-table-column>
  38. <el-table-column prop="statusText" label="事件工单数" width="100" fixed="right" align="center"></el-table-column>
  39. </el-table>
  40. <template #footer>
  41. <span class="dialog-footer">
  42. <el-button class="default-button" @click="state.dialogVisible = false">关 闭</el-button>
  43. </span>
  44. </template>
  45. </el-dialog>
  46. </template>
  47. <script setup lang="ts" name="orderRepeatEvent">
  48. import { reactive, ref } from 'vue';
  49. import type { FormInstance } from 'element-plus';
  50. import { shortcuts } from '/@/utils/constants';
  51. import { ElButton, ElMessage } from 'element-plus';
  52. import { throttle } from '/@/utils/tools';
  53. import { auth } from '/@/utils/authFunction';
  54. // 引入组件
  55. // 定义变量内容
  56. const state = reactive<any>({
  57. dialogVisible: false, // 弹窗显示隐藏
  58. queryParams: {
  59. PageIndex: 1, // 当前页
  60. PageSize: 10, // 每页条数
  61. Keyword: '', // 关键字
  62. },
  63. tableData: [], // 表格数据
  64. total: 0, // 总条数
  65. loading: false, // 加载状态
  66. ruleForm: {}, // 表单数据
  67. });
  68. const queryParamsRef = ref<RefType>(); // 查询参数
  69. const handleTimeChange = (val: string[], startKey: string, endKey: string) => {
  70. if (val) {
  71. state.queryParams[startKey] = val[0];
  72. state.queryParams[endKey] = val[1];
  73. } else {
  74. state.queryParams[startKey] = '';
  75. state.queryParams[endKey] = '';
  76. }
  77. };
  78. // 时间
  79. const timeStartChangeCr = (val: string[]) => {
  80. handleTimeChange(val, 'CreationTimeStart', 'CreationTimeEnd');
  81. };
  82. /** 搜索按钮操作 */
  83. const handleQuery = throttle(() => {
  84. state.queryParams.PageIndex = 1;
  85. queryList();
  86. }, 500);
  87. /** 重置按钮操作 */
  88. const resetQuery = throttle((formEl: FormInstance | undefined) => {
  89. if (!formEl) return;
  90. formEl.resetFields();
  91. handleQuery();
  92. }, 300);
  93. const queryList = () => {
  94. if (!auth('business:order:history')) ElMessage.error('抱歉,您没有权限查询历史工单!');
  95. else {
  96. }
  97. };
  98. // 打开弹窗
  99. const openDialog = (row: any) => {
  100. queryList();
  101. state.dialogVisible = true;
  102. };
  103. const dialogRef = ref<RefType>();
  104. // 关闭弹窗
  105. const closeDialog = () => {
  106. state.dialogVisible = false;
  107. };
  108. // 暴露变量
  109. defineExpose({
  110. openDialog,
  111. closeDialog,
  112. });
  113. </script>