index.vue 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. <template>
  2. <div class="business-special-audit-container layout-pd">
  3. <!-- 搜索 -->
  4. <el-card shadow="never">
  5. <el-form :model="state.queryParams" ref="ruleFormRef" @submit.native.prevent class="mt15" label-width="100px">
  6. <el-row :gutter="10">
  7. <el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="8">
  8. <el-form-item label="关键词" prop="Keyword">
  9. <el-input v-model="state.queryParams.Keyword" placeholder="工单编码/标题" clearable @keyup.enter="queryList" />
  10. </el-form-item>
  11. </el-col>
  12. <el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="8">
  13. <el-form-item label=" ">
  14. <el-button type="primary" @click="queryList" :loading="state.loading"> <SvgIcon name="ele-Search" class="mr5" />查询 </el-button>
  15. <el-button @click="resetQuery(ruleFormRef)" v-waves class="default-button" :loading="state.loading">
  16. <SvgIcon name="ele-Refresh" class="mr5" />重置
  17. </el-button>
  18. </el-form-item>
  19. </el-col>
  20. </el-row>
  21. </el-form>
  22. </el-card>
  23. <el-card shadow="never">
  24. <!-- 表格 -->
  25. <el-table :data="state.tableData" v-loading="state.loading" row-key="id" ref="multipleTableRef" @selection-change="handleSelectionChange">
  26. <el-table-column type="selection" width="55" />
  27. <el-table-column prop="order.no" label="工单编码" show-overflow-tooltip width="150"></el-table-column>
  28. <el-table-column width="100" label="省/市工单" prop="isProvince">
  29. <template #default="{ row }">
  30. <span>{{ row.order?.isProvince ? '省工单' : '市工单' }}</span>
  31. </template>
  32. </el-table-column>
  33. <el-table-column label="工单标题" show-overflow-tooltip width="400">
  34. <template #default="{ row }">
  35. <span class="color-primary">{{ row.order?.title }}</span>
  36. </template>
  37. </el-table-column>
  38. <el-table-column prop="order.sourceChannel" label="来源方式" show-overflow-tooltip></el-table-column>
  39. <el-table-column prop="order.acceptType" label="受理类型" show-overflow-tooltip width="100"></el-table-column>
  40. <el-table-column prop="order.hotspotName" label="热点分类" show-overflow-tooltip width="100"></el-table-column>
  41. <el-table-column label="受理人" show-overflow-tooltip width="170">
  42. <template #default="{ row }">
  43. <span
  44. >{{ row.order?.acceptorName }} <span v-if="row.order?.acceptorStaffNo">[{{ row.order?.acceptorStaffNo }}]</span>
  45. </span>
  46. </template>
  47. </el-table-column>
  48. <el-table-column prop="order.orgLevelOneName" label="一级部门" show-overflow-tooltip width="170"></el-table-column>
  49. <el-table-column prop="stateText" label="特提审批状态" show-overflow-tooltip width="120"></el-table-column>
  50. <el-table-column prop="cause" label="特提原因" show-overflow-tooltip width="150"></el-table-column>
  51. <el-table-column prop="creatorName" label="申请人" show-overflow-tooltip></el-table-column>
  52. <el-table-column prop="creatorOrgName" label="申请部门" show-overflow-tooltip width="120"></el-table-column>
  53. <el-table-column prop="reason" label="申请理由" show-overflow-tooltip width="200"></el-table-column>
  54. <el-table-column label="操作" width="170" fixed="right" align="center">
  55. <template #default="{ row }">
  56. <el-button link type="primary" @click="onAudit(row)" title="审批特提" v-auth="'business:special:audit'" v-if="[0].includes(row.state)">
  57. 审批
  58. </el-button>
  59. <el-button link type="primary" @click="onAuditDetail(row)" title="查看审批详情" v-if="[1, 2].includes(row.state)"> 审批详情 </el-button>
  60. <order-detail :order="row.order" @updateList="queryList" />
  61. </template>
  62. </el-table-column>
  63. <template #empty>
  64. <Empty />
  65. </template>
  66. </el-table>
  67. <!-- 分页 -->
  68. <pagination
  69. :total="state.total"
  70. v-model:page="state.queryParams.PageIndex"
  71. v-model:limit="state.queryParams.PageSize"
  72. @pagination="queryList"
  73. />
  74. </el-card>
  75. <!-- 特提审批 -->
  76. <special-audit ref="specialAuditRef" @updateList="queryList" />
  77. <!-- 审批详情 -->
  78. <special-audit-detail ref="specialAuditDetailRef" />
  79. </div>
  80. </template>
  81. <script setup lang="ts" name="orderSpecialAudit">
  82. import { defineAsyncComponent, onMounted, reactive, ref } from 'vue';
  83. import { ElButton, ElMessage, FormInstance } from 'element-plus';
  84. import { auth } from '/@/utils/authFunction';
  85. import { throttle } from '/@/utils/tools';
  86. import { useRouter } from 'vue-router';
  87. import { specialList } from '/@/api/business/special';
  88. // 引入组件
  89. const SpecialAudit = defineAsyncComponent(() => import('/@/views/business/special/components/Special-audit.vue')); // 审批
  90. const SpecialAuditDetail = defineAsyncComponent(() => import('/@/views/business/special/components/Special-audit-detail.vue')); // 审批详情
  91. const OrderDetail = defineAsyncComponent(() => import('/@/components/OrderDetail/index.vue')); // 工单详情
  92. // 定义变量内容
  93. const ruleFormRef = ref<RefType>(); // 表单ref
  94. const router = useRouter(); // 路由
  95. const state = reactive(<any>{
  96. queryParams: {
  97. // 查询条件
  98. PageIndex: 1,
  99. PageSize: 10,
  100. Keyword: null, // 关键字
  101. },
  102. tableData: [], //表单
  103. loading: false, // 加载
  104. total: 0, // 总数
  105. });
  106. /** 获取列表 */
  107. const queryList = throttle(() => {
  108. if (!auth('business:specialAudit:query')) ElMessage.error('抱歉,您没有权限查看特提申请审批!');
  109. else {
  110. state.loading = true;
  111. specialList(state.queryParams)
  112. .then((res) => {
  113. state.tableData = res.result?.items ?? [];
  114. state.total = res.result?.total ?? 0;
  115. state.loading = false;
  116. })
  117. .catch((err) => {
  118. console.log(err);
  119. state.loading = false;
  120. });
  121. }
  122. }, 300);
  123. /** 重置按钮操作 */
  124. const resetQuery = throttle((formEl: FormInstance | undefined) => {
  125. if (!formEl) return;
  126. formEl.resetFields();
  127. queryList();
  128. }, 300);
  129. // 表格多选
  130. const multipleTableRef = ref<RefType>();
  131. const multipleSelection = ref<any>([]);
  132. const handleSelectionChange = (val: any[]) => {
  133. multipleSelection.value = val;
  134. };
  135. // 导出
  136. const onExport = () => {
  137. console.log('导出');
  138. };
  139. // 审批
  140. const specialAuditRef = ref<RefType>();
  141. const onAudit = (row: any) => {
  142. specialAuditRef.value.openDialog(row);
  143. };
  144. // 审批详情
  145. const specialAuditDetailRef = ref<RefType>();
  146. const onAuditDetail = (row: any) => {
  147. specialAuditDetailRef.value.openDialog(row);
  148. };
  149. onMounted(() => {
  150. queryList();
  151. });
  152. </script>