index.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. <template>
  2. <div class="business-special-container layout-pd">
  3. <!-- 搜索 -->
  4. <el-card shadow="never">
  5. <el-form :model="state.queryParams" ref="ruleFormRef" @submit.native.prevent inline>
  6. <el-form-item label="工单编码" prop="No">
  7. <el-input v-model="state.queryParams.No" placeholder="工单编码" clearable @keyup.enter="handleQuery" class="keyword-input" />
  8. </el-form-item>
  9. <el-form-item label="审核状态" prop="State">
  10. <el-select v-model="state.queryParams.State" placeholder="请选择审核状态" @change="handleQuery">
  11. <el-option v-for="item in stateOptions" :value="item.value" :key="item.value" :label="item.label" />
  12. </el-select>
  13. </el-form-item>
  14. <el-form-item label="申请时间" prop="crTime">
  15. <el-date-picker
  16. v-model="state.queryParams.crTime"
  17. type="datetimerange"
  18. unlink-panels
  19. range-separator="至"
  20. start-placeholder="开始时间"
  21. end-placeholder="结束时间"
  22. :shortcuts="shortcuts"
  23. @change="timeStartChangeCr"
  24. value-format="YYYY-MM-DD[T]HH:mm:ss"
  25. />
  26. </el-form-item>
  27. <el-form-item>
  28. <el-button type="primary" @click="handleQuery" :loading="state.loading"> <SvgIcon name="ele-Search" class="mr5" />查询 </el-button>
  29. <el-button @click="resetQuery(ruleFormRef)" v-waves class="default-button" :loading="state.loading">
  30. <SvgIcon name="ele-Refresh" class="mr5" />重置
  31. </el-button>
  32. </el-form-item>
  33. </el-form>
  34. </el-card>
  35. <el-card shadow="never">
  36. <ProTable
  37. ref="proTableRef"
  38. :columns="columns"
  39. :data="state.tableData"
  40. @updateTable="queryList"
  41. :loading="state.loading"
  42. :total="state.total"
  43. v-model:page-index="state.queryParams.PageIndex"
  44. v-model:page-size="state.queryParams.PageSize"
  45. >
  46. <template #expiredStatus="{ row }">
  47. <span :class="'overdue-status-' + row.expiredStatus" :title="row.expiredStatusText"></span>
  48. </template>
  49. <template #title="{ row }">
  50. <order-detail :order="row.id ? row : { ...row, id: row.orderId }" @updateList="queryList">{{ row.title }}</order-detail>
  51. </template>
  52. <template #state="{ row }">
  53. <span>{{ stateOptions.find((item) => item.value === row.state).label }}</span>
  54. </template>
  55. <!-- 表格操作 -->
  56. <template #operation="{ row }">
  57. <el-button link type="primary" @click="onprogressDetail(row)" title="查看审批明细"> 审批明细 </el-button>
  58. <order-detail :order="row.id ? row : { ...row, id: row.orderId }" @updateList="queryList" />
  59. </template>
  60. </ProTable>
  61. </el-card>
  62. <!-- 审批详情 -->
  63. <special-audit-detail ref="specialAuditDetailRef" />
  64. </div>
  65. </template>
  66. <script setup lang="tsx" name="orderSpecial">
  67. import { defineAsyncComponent, onMounted, reactive, ref } from 'vue';
  68. import { ElButton, FormInstance } from 'element-plus';
  69. import { throttle } from '@/utils/tools';
  70. import { formatDate } from '@/utils/formatTime';
  71. import { useRouter } from 'vue-router';
  72. import { specialListAll } from '@/api/business/special';
  73. import { shortcuts } from '@/utils/constants';
  74. // 引入组件
  75. const OrderDetail = defineAsyncComponent(() => import('@/components/OrderDetail/index.vue')); // 工单详情
  76. const SpecialAuditDetail = defineAsyncComponent(() => import('@/views/business/special/components/Special-audit-detail.vue')); // 审批详情
  77. // 定义变量内容
  78. const ruleFormRef = ref<RefType>(); // 表单ref
  79. const router = useRouter(); // 路由
  80. const proTableRef = ref<RefType>(); // 表格ref
  81. // 表格配置项
  82. const columns = ref<any[]>([
  83. { prop: 'expiredStatus', label: '超期状态', align: 'center',fixed: 'left' },
  84. { prop: 'no', label: '工单编码', width: 150 },
  85. { prop: 'statusText', label: '工单状态', width: 100 },
  86. { prop: 'state', label: '审批状态', width: 100 },
  87. { prop: 'stepName', label: '申请节点', width: 150 },
  88. { prop: 'nextStepName', label: '特提节点', width: 150 },
  89. { prop: 'title', label: '标题', width: 300 },
  90. { prop: 'creatorOrgName', label: '申请部门', width: 170 },
  91. { prop: 'creatorName', label: '申请人', width: 170 },
  92. {
  93. prop: 'creationTime',
  94. label: '申请时间',
  95. width: 170,
  96. render: (scope) => {
  97. return <span>{formatDate(scope.row.creationTime, 'YYYY-mm-dd HH:MM:SS')}</span>;
  98. },
  99. },
  100. { prop: 'acceptType', label: '受理类型', width: 150 },
  101. { prop: 'hotspotName', label: '热点分类', width: 200 },
  102. { prop: 'operation', label: '操作', fixed: 'right', width: 170, align: 'center' },
  103. ]);
  104. const state = reactive({
  105. queryParams: {
  106. // 查询条件
  107. PageIndex: 1,
  108. PageSize: 10,
  109. No: null, // 工单编号
  110. State: null, // 审核状态
  111. crTime: [], // 申请时间
  112. },
  113. tableData: [], //表单
  114. loading: false, // 加载
  115. total: 0, // 总数
  116. });
  117. // 受理时间
  118. const timeStartChangeCr = (val: string[]) => {
  119. state.queryParams['StartTime'] = val[0];
  120. state.queryParams['EndTime'] = val[1];
  121. handleQuery();
  122. };
  123. const stateOptions = [
  124. // 审核状态
  125. { value: 0, label: '待审核' },
  126. { value: 1, label: '审核通过' },
  127. { value: 2, label: '审核不通过' },
  128. ];
  129. // 手动查询,将页码设置为1
  130. const handleQuery = () => {
  131. state.queryParams.PageIndex = 1;
  132. queryList();
  133. };
  134. /** 获取列表 */
  135. const queryList = () => {
  136. state.loading = true;
  137. specialListAll(state.queryParams)
  138. .then((res) => {
  139. state.tableData = res.result?.items ?? [];
  140. state.total = res.result?.total ?? 0;
  141. state.loading = false;
  142. })
  143. .catch((err) => {
  144. console.log(err);
  145. state.loading = false;
  146. });
  147. };
  148. /** 重置按钮操作 */
  149. const resetQuery = (formEl: FormInstance | undefined) => {
  150. if (!formEl) return;
  151. state.queryParams['StartTime'] = null;
  152. state.queryParams['EndTime'] = null;
  153. formEl.resetFields();
  154. queryList();
  155. };
  156. // 特提审批详情
  157. const specialAuditDetailRef = ref<RefType>();
  158. const onprogressDetail = (row: any) => {
  159. specialAuditDetailRef.value.openDialog(row.specialId ?? '');
  160. };
  161. onMounted(() => {
  162. queryList();
  163. });
  164. </script>