apply.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. <template>
  2. <div class="business-special-apply-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)" v-waves 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. <!-- 表格操作 -->
  31. <template #operation="{ row }">
  32. <el-button link type="primary" @click="onSpecialApply(row)" title="特提申请" v-if="row.workflowId" v-auth="'business:special:apply'">
  33. 特提申请
  34. </el-button>
  35. </template>
  36. </ProTable>
  37. </div>
  38. <!-- 特提申请 -->
  39. <special-apply ref="specialApplyRef" @updateList="queryList" />
  40. </div>
  41. </template>
  42. <script setup lang="tsx" name="orderSpecial">
  43. import { defineAsyncComponent, onMounted, reactive, ref } from 'vue';
  44. import { ElMessage, FormInstance } from 'element-plus';
  45. import { formatDate } from '@/utils/formatTime';
  46. import { useRouter } from 'vue-router';
  47. import { orderListSpecial } from '@/api/business/special';
  48. // 引入组件
  49. const SpecialApply = defineAsyncComponent(() => import('@/views/business/special/components/Special-apply.vue')); // 忒提申请
  50. const OrderDetail = defineAsyncComponent(() => import('@/components/OrderDetail/index.vue')); // 工单详情
  51. // 定义变量内容
  52. const ruleFormRef = ref<RefType>(); // 表单ref
  53. const router = useRouter(); // 路由
  54. const proTableRef = ref<RefType>(); // 表格ref
  55. // 表格配置项
  56. const columns = ref<any[]>([
  57. { type: 'selection',minWidth: 40,align: 'center' },
  58. { prop: 'no', label: '工单编码', minWidth: 140 },
  59. { prop: 'isProvinceText', label: '省/市工单', minWidth: 90 },
  60. { prop: 'currentStepName', label: '当前节点', minWidth: 120 },
  61. { prop: 'statusText', label: '工单状态', minWidth: 100 },
  62. { prop: 'title', label: '标题', minWidth: 200 },
  63. {
  64. prop: 'startTime',
  65. label: '受理时间',
  66. minWidth: 160,
  67. render: (scope) => {
  68. return <span>{formatDate(scope.row.startTime, 'YYYY-mm-dd HH:MM:SS')}</span>;
  69. },
  70. },
  71. {
  72. prop: 'expiredTime',
  73. label: '工单期满时间',
  74. minWidth: 160,
  75. render: (scope) => {
  76. return <span>{formatDate(scope.row.expiredTime, 'YYYY-mm-dd HH:MM:SS')}</span>;
  77. },
  78. },
  79. {
  80. prop: 'filedTime',
  81. label: '办结时间',
  82. minWidth: 160,
  83. render: (scope) => {
  84. return <span>{formatDate(scope.row.filedTime, 'YYYY-mm-dd HH:MM:SS')}</span>;
  85. },
  86. },
  87. { prop: 'orgLevelOneName', label: '一级部门', minWidth: 140 },
  88. { prop: 'actualHandleOrgName', label: '接办部门', minWidth: 140 },
  89. { prop: 'acceptType', label: '受理类型', minWidth: 100 },
  90. { prop: 'counterSignTypeText', label: '是否会签', minWidth: 90 },
  91. { prop: 'hotspotName', label: '热点分类', minWidth: 150 },
  92. { prop: 'tagNames', label: '工单标签', minWidth: 150 },
  93. { prop: 'acceptorName', label: '受理人', minWidth: 120 },
  94. { prop: 'operation', label: '操作', fixed: 'right', minWidth: 90, align: 'center' },
  95. ]);
  96. const state = reactive({
  97. queryParams: {
  98. // 查询条件
  99. PageIndex: 1,
  100. PageSize: 20,
  101. Keyword: null, // 关键字
  102. },
  103. tableData: [], //表单
  104. loading: false, // 加载
  105. total: 0, // 总数
  106. });
  107. // 手动查询,将页码设置为1
  108. const handleQuery = () => {
  109. state.queryParams.PageIndex = 1;
  110. queryList();
  111. };
  112. /** 获取列表 */
  113. const queryList = () => {
  114. state.loading = true;
  115. orderListSpecial(state.queryParams)
  116. .then((res) => {
  117. state.tableData = res.result?.items ?? [];
  118. state.total = res.result?.total ?? 0;
  119. state.loading = false;
  120. })
  121. .catch((err) => {
  122. console.log(err);
  123. state.loading = false;
  124. });
  125. }
  126. /** 重置按钮操作 */
  127. const resetQuery = (formEl: FormInstance | undefined) => {
  128. if (!formEl) return;
  129. formEl.resetFields();
  130. queryList();
  131. }
  132. // 导出
  133. const onExport = () => {
  134. console.log('导出');
  135. };
  136. // 特提申请
  137. const specialApplyRef = ref<RefType>();
  138. const onSpecialApply = (row: any) => {
  139. if (row.status == 200) {
  140. // 会签工单无法进行特提
  141. ElMessage.warning('工单会签中,请先结束会签!');
  142. return;
  143. }
  144. specialApplyRef.value.openDialog(row); // 需要审核
  145. };
  146. onMounted(() => {
  147. queryList();
  148. });
  149. </script>