record.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. <template>
  2. <div class="business-publish-container layout-padding">
  3. <div class="layout-padding-auto layout-padding-view pd20">
  4. <ProTable
  5. ref="proTableRef"
  6. :columns="columns"
  7. :data="state.tableData"
  8. @updateTable="queryList"
  9. :loading="state.loading"
  10. :total="state.total"
  11. v-model:page-index="state.queryParams.PageIndex"
  12. v-model:page-size="state.queryParams.PageSize"
  13. >
  14. <template #table-search>
  15. <el-form :model="state.queryParams" ref="ruleFormRef" @submit.native.prevent inline>
  16. <el-form-item label="工单编码" prop="Keyword">
  17. <el-input v-model="state.queryParams.Keyword" placeholder="工单编码" clearable @keyup.enter="handleQuery" class="keyword-input" />
  18. </el-form-item>
  19. <el-form-item>
  20. <el-button type="primary" @click="handleQuery" :loading="state.loading"> <SvgIcon name="ele-Search" class="mr5" />查询 </el-button>
  21. <el-button @click="resetQuery(ruleFormRef)" class="default-button" :loading="state.loading">
  22. <SvgIcon name="ele-Refresh" class="mr5" />重置
  23. </el-button>
  24. </el-form-item>
  25. </el-form>
  26. </template>
  27. <template #title="{ row }">
  28. <order-detail :order="row" @updateList="queryList">{{ row.title }}</order-detail>
  29. </template>
  30. <template #expiredStatusText="{ row }">
  31. <span :class="'overdue-status-' + row.expiredStatus" :title="row.expiredStatusText"></span>
  32. </template>
  33. <!-- 表格操作 -->
  34. <template #operation="{ row }">
  35. <el-button link type="primary" @click="onDetail(row)" title="查看修改明细">
  36. 查看明细
  37. </el-button>
  38. </template>
  39. </ProTable>
  40. </div>
  41. <edit-record ref="orderPublishEditRef" />
  42. </div>
  43. </template>
  44. <script setup lang="tsx" name="todoEditRecord">
  45. import { defineAsyncComponent, onMounted, reactive, ref } from 'vue';
  46. import { FormInstance } from 'element-plus';
  47. import { formatDate } from '@/utils/formatTime';
  48. import { publishedList } from '@/api/business/publish';
  49. import { getOrderModifyRecord } from '@/api/todo/center';
  50. // 引入组件
  51. const EditRecord = defineAsyncComponent(() => import('@/views/todo/edit/components/Edit-record.vue')); // 修改记录详情
  52. const OrderDetail = defineAsyncComponent(() => import('@/components/OrderDetail/index.vue')); // 工单详情
  53. // 定义变量内容
  54. const ruleFormRef = ref<RefType>(); // 表单ref
  55. const proTableRef = ref<RefType>(); // 表格ref
  56. // 表格配置项
  57. const columns = ref<any[]>([
  58. { prop: 'expiredStatusText', label: '超期状态', align: 'center', minWidth: 80 },
  59. { prop: 'statusText', label: '工单状态', minWidth: 100 },
  60. { prop: 'sourceChannel', label: '来源渠道', minWidth: 100 },
  61. { prop: 'currentStepName', label: '当前节点', minWidth: 100 },
  62. { prop: 'no', label: '工单编码', minWidth: 140 },
  63. { prop: 'title', label: '工单标题', minWidth: 200 },
  64. { prop: 'auditUserName', label: '修改人', minWidth: 90 },
  65. {
  66. prop: 'creationTime',
  67. label: '修改时间',
  68. minWidth: 160,
  69. render: (scope) => {
  70. return <span>{formatDate(scope.row.creationTime, 'YYYY-mm-dd HH:MM:SS')}</span>;
  71. },
  72. },
  73. { prop: 'operation', label: '操作', fixed: 'right', minWidth: 90, align: 'center' },
  74. ]);
  75. const state = reactive({
  76. queryParams: {
  77. // 查询条件
  78. PageIndex: 1,
  79. PageSize: 20,
  80. Keyword: null, // 关键词
  81. No: null,
  82. Resolve: null, // 处理结果
  83. },
  84. tableData: [], //表单
  85. loading: false, // 加载
  86. total: 0, // 总数
  87. });
  88. // 手动查询,将页码设置为1
  89. const handleQuery = () => {
  90. state.queryParams.PageIndex = 1;
  91. queryList();
  92. };
  93. /** 获取列表 */
  94. const queryList = () => {
  95. state.loading = true;
  96. getOrderModifyRecord(state.queryParams)
  97. .then((res: any) => {
  98. state.tableData = res.result?.items ?? [];
  99. state.total = res.result?.total ?? 0;
  100. state.loading = false;
  101. })
  102. .catch((err: any) => {
  103. state.loading = false;
  104. });
  105. };
  106. /** 重置按钮操作 */
  107. const resetQuery = (formEl: FormInstance | undefined) => {
  108. if (!formEl) return;
  109. formEl.resetFields();
  110. queryList();
  111. };
  112. // 查看明细
  113. const orderPublishEditRef = ref<RefType>();
  114. const onDetail = (row: any) => {
  115. orderPublishEditRef.value.openDrawer(row.copyId);
  116. };
  117. onMounted(() => {
  118. queryList();
  119. });
  120. </script>