index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310
  1. <template>
  2. <div class="business-countersign-container layout-pd">
  3. <!-- 搜索 -->
  4. <el-card shadow="never">
  5. <div class="flex-center-align mb20">
  6. <span style="color: var(--el-text-color-regular); display: inline-block; text-align: right; padding-right: 12px">快捷查询</span>
  7. <el-radio-group v-model="fastSearch" @change="fastSearchChange">
  8. <el-radio-button label="InitiatedCountersignature">发起的会签</el-radio-button>
  9. <el-radio-button label="HandleCountersignature">已办会签</el-radio-button>
  10. </el-radio-group>
  11. </div>
  12. <el-form :model="state.queryParams" ref="ruleFormRef" @submit.native.prevent label-width="100px">
  13. <el-row :gutter="10">
  14. <el-col :xs="24" :sm="12" :md="12" :lg="6" :xl="6">
  15. <el-form-item label="工单标题" prop="Keyword">
  16. <el-input v-model="state.queryParams.Keyword" placeholder="工单标题" clearable @keyup.enter="handleQuery" />
  17. </el-form-item>
  18. </el-col>
  19. <el-col :xs="24" :sm="12" :md="12" :lg="6" :xl="6">
  20. <el-form-item label="工单编码" prop="No">
  21. <el-input v-model="state.queryParams.No" placeholder="工单编码" clearable @keyup.enter="handleQuery" />
  22. </el-form-item>
  23. </el-col>
  24. <el-col :xs="24" :sm="12" :md="12" :lg="6" :xl="6">
  25. <el-form-item label="受理类型" prop="AcceptTypes">
  26. <el-select
  27. v-model="state.queryParams.AcceptTypes"
  28. placeholder="请选择受理类型"
  29. multiple
  30. clearable
  31. class="w100"
  32. collapse-tags
  33. collapse-tags-tooltip
  34. :max-collapse-tags="2"
  35. >
  36. <el-option v-for="item in state.acceptTypeOptions" :value="item.dicDataValue" :key="item.dicDataValue" :label="item.dicDataName" />
  37. </el-select>
  38. </el-form-item>
  39. </el-col>
  40. <transition name="el-zoom-in-top">
  41. <el-col :xs="24" :sm="12" :md="12" :lg="6" :xl="6" v-show="!searchCol">
  42. <el-form-item label="来源渠道" prop="Channels">
  43. <el-select
  44. v-model="state.queryParams.Channels"
  45. placeholder="请选择来源渠道"
  46. multiple
  47. clearable
  48. class="w100"
  49. collapse-tags
  50. collapse-tags-tooltip
  51. :max-collapse-tags="2"
  52. >
  53. <el-option v-for="item in state.channelOptions" :value="item.dicDataValue" :key="item.dicDataValue" :label="item.dicDataName" />
  54. </el-select>
  55. </el-form-item>
  56. </el-col>
  57. </transition>
  58. <transition name="el-zoom-in-top">
  59. <el-col :xs="24" :sm="12" :md="12" :lg="6" :xl="6" v-show="!searchCol">
  60. <el-form-item label="会签类型" prop="CounterSignType">
  61. <el-select v-model="state.queryParams.CounterSignType" placeholder="会签类型" class="w100" @change="handleQuery" clearable>
  62. <el-option v-for="item in state.counterSignTypeOptions" :value="item.key" :key="item.key" :label="item.value" />
  63. </el-select>
  64. </el-form-item>
  65. </el-col>
  66. </transition>
  67. <transition name="el-zoom-in-top">
  68. <el-col :xs="24" :sm="12" :md="12" :lg="6" :xl="6" v-show="!searchCol">
  69. <el-form-item label="接办部门" prop="ActualHandleStepName">
  70. <el-input v-model="state.queryParams.ActualHandleStepName" placeholder="接办部门名称" clearable @keyup.enter="handleQuery" />
  71. </el-form-item>
  72. </el-col>
  73. </transition>
  74. <transition name="el-zoom-in-top">
  75. <el-col :xs="24" :sm="12" :md="12" :lg="6" :xl="6" v-show="!searchCol">
  76. <el-form-item label="热点分类" prop="HotspotIds">
  77. <hot-spot-select
  78. v-model="state.queryParams.HotspotIds"
  79. class="w100"
  80. :hotspotExternal="state.hotspotExternal"
  81. show-checkbox
  82. ref="hotSpotRef"
  83. @confirm="handleQuery"
  84. />
  85. </el-form-item>
  86. </el-col>
  87. </transition>
  88. <el-col :xs="24" :sm="12" :md="12" :lg="6" :xl="6">
  89. <el-form-item label=" ">
  90. <div class="flex-end w100">
  91. <el-button type="primary" @click="handleQuery" :loading="state.loading"> <SvgIcon name="ele-Search" class="mr5" />查询 </el-button>
  92. <el-button @click="resetQuery(ruleFormRef)" class="default-button" :loading="state.loading">
  93. <SvgIcon name="ele-Refresh" class="mr5" />重置
  94. </el-button>
  95. <el-button link type="primary" @click="closeSearch" :loading="state.loading">
  96. {{ searchCol ? '展开' : '收起' }}
  97. <SvgIcon :class="{ 'is-reverse': searchCol }" name="ele-ArrowUp" class="mr5 arrow" size="18px" />
  98. </el-button>
  99. </div>
  100. </el-form-item>
  101. </el-col>
  102. </el-row>
  103. </el-form>
  104. </el-card>
  105. <el-card shadow="never">
  106. <ProTable
  107. ref="proTableRef"
  108. :columns="columns"
  109. :data="state.tableData"
  110. @updateTable="queryList"
  111. :loading="state.loading"
  112. :total="state.total"
  113. v-model:page-index="state.queryParams.PageIndex"
  114. v-model:page-size="state.queryParams.PageSize"
  115. >
  116. <template #expiredStatus="{ row }">
  117. <span :class="'overdue-status-' + row.order?.expiredStatus" :title="row.order?.expiredStatusText"></span>
  118. </template>
  119. <template #isProvince="{ row }">
  120. <span>{{ row.order?.isProvince ? '省工单' : '市工单' }}</span>
  121. </template>
  122. <template #title="{ row }">
  123. <order-detail :order="row.order" @updateList="queryList">{{ row.order?.title }}</order-detail>
  124. </template>
  125. <!-- 表格操作 -->
  126. <template #operation="{ row }">
  127. <div class="flex-center-center">
  128. <order-detail :order="row.order" @updateList="queryList" />
  129. <el-button type="primary" link @click="onRecord(row)" class="ml10">流程明细</el-button>
  130. </div>
  131. </template>
  132. </ProTable>
  133. </el-card>
  134. <!-- 流转记录 -->
  135. <audit-record ref="auditRecordRef"></audit-record>
  136. </div>
  137. </template>
  138. <script setup lang="tsx" name="businessCountersign">
  139. import { defineAsyncComponent, onMounted, reactive, ref } from 'vue';
  140. import { ElButton, FormInstance } from 'element-plus';
  141. import { formatDate } from '@/utils/formatTime';
  142. import { useRouter } from 'vue-router';
  143. import { countersignBase, countersignData } from "@/api/query/countersign";
  144. import { storeToRefs } from 'pinia';
  145. import { useUserInfo } from '@/stores/userInfo';
  146. // 引入组件
  147. const OrderDetail = defineAsyncComponent(() => import('@/components/OrderDetail/index.vue')); // 工单详情
  148. const AuditRecord = defineAsyncComponent(() => import('@/components/AuditRecord/index.vue')); // 流程明细
  149. const HotSpotSelect = defineAsyncComponent(() => import('@/components/Hotspot/index.vue')); // 选择热点
  150. const proTableRef = ref<RefType>(); // 表格ref
  151. // 表格配置项
  152. const columns = ref<any[]>([
  153. { prop: 'order.expiredStatus', label: '超期状态', align: 'center',fixed: 'left',width: 80 },
  154. { prop: 'stateText', label: '会签状态', width: 120 },
  155. { prop: 'order.counterSignTypeText', label: '会签类型', width: 120 },
  156. { prop: 'order.no', label: '工单编码', width: 150 },
  157. { prop: 'order.sourceChannel', label: '来源方式', width: 100 },
  158. { prop: 'order.actualHandleStepName', label: '办理节点', width: 120 },
  159. {
  160. prop: 'order.startTime',
  161. label: '受理时间',
  162. width: 170,
  163. render: (scope) => {
  164. return <span>{formatDate(scope.row.order?.startTime, 'YYYY-mm-dd HH:MM:SS')}</span>;
  165. },
  166. },
  167. { prop: 'order.title', label: '工单标题', width: 300 },
  168. { prop: 'order.fromPhone', label: '来电号码', width: 150 },
  169. { prop: 'order.actualHandleOrgName', label: '接办部门', width: 150 },
  170. {
  171. prop: 'order.actualHandleTime',
  172. label: '接办时间',
  173. width: 170,
  174. render: (scope) => {
  175. return <span>{formatDate(scope.row.order?.actualHandleTime, 'YYYY-mm-dd HH:MM:SS')}</span>;
  176. },
  177. },
  178. { prop: 'order.hotspotName', label: '热点分类', width: 150 },
  179. { prop: 'starterOrgName', label: '会签发起部门', width: 150 },
  180. { prop: 'starterName', label: '会签发起人', width: 120 },
  181. {
  182. prop: 'creationTime',
  183. label: '会签发起时间',
  184. width: 170,
  185. render: (scope) => {
  186. return <span>{formatDate(scope.row.creationTime, 'YYYY-mm-dd HH:MM:SS')}</span>;
  187. },
  188. },
  189. {
  190. prop: 'order.expiredTime',
  191. label: '工单期满时间',
  192. width: 170,
  193. render: (scope: any) => {
  194. return <span>{formatDate(scope.row.order?.expiredTime, 'YYYY-mm-dd HH:MM:SS')}</span>;
  195. },
  196. },
  197. { prop: 'order.acceptType', label: '受理类型', width: 150 },
  198. { prop: 'order.hotspotName', label: '热点分类', width: 150 },
  199. { prop: 'operation', label: '操作', fixed: 'right', width: 180, align: 'center' },
  200. ]);
  201. // 定义变量内容
  202. const ruleFormRef = ref<RefType>(); // 表单ref
  203. const router = useRouter(); // 路由
  204. const state = reactive<any>({
  205. queryParams: {
  206. // 查询条件
  207. PageIndex: 1,
  208. PageSize: 10,
  209. Keyword: null, // 关键字
  210. IsOnlyStarter: false, // 是否中心
  211. HandleCountersignature: null, // 已办会签
  212. InitiatedCountersignature: true, // 是否发起会签
  213. },
  214. tableData: [], //表单
  215. loading: false, // 加载
  216. total: 0, // 总数
  217. acceptTypeOptions:[],// 受理类型
  218. channelOptions:[],// 来源方式
  219. counterSignTypeOptions:[],// 会签类型
  220. });
  221. const fastSearch = ref('InitiatedCountersignature');
  222. const fastSearchChange = (val: any) => {
  223. fastSearch.value = val;
  224. state.queryParams.HandleCountersignature = null;
  225. state.queryParams.InitiatedCountersignature = null;
  226. switch (val) {
  227. case 'InitiatedCountersignature':
  228. state.queryParams.InitiatedCountersignature = true;
  229. break;
  230. case 'HandleCountersignature':
  231. state.queryParams.HandleCountersignature = true;
  232. break;
  233. }
  234. handleQuery();
  235. };
  236. const storesUserInfo = useUserInfo();
  237. const { userInfos } = storeToRefs(storesUserInfo); // 用户信息
  238. const searchCol = ref(true); // 展开/收起
  239. // 展开/收起
  240. const closeSearch = () => {
  241. searchCol.value = !searchCol.value;
  242. };
  243. // 手动查询,将页码设置为1
  244. const handleQuery = () => {
  245. state.queryParams.PageIndex = 1;
  246. queryList();
  247. };
  248. /** 获取列表 */
  249. const queryList = () => {
  250. state.loading = true;
  251. state.queryParams.IsOnlyStarter = userInfos.value.isCenter;
  252. countersignData(state.queryParams)
  253. .then((res) => {
  254. state.tableData = res.result?.items ?? [];
  255. state.total = res.result?.total ?? 0;
  256. })
  257. .catch(() => {})
  258. .finally(() => {
  259. state.loading = false;
  260. });
  261. };
  262. /** 重置按钮操作 */
  263. const hotSpotRef = ref<RefType>();
  264. const resetQuery = (formEl: FormInstance | undefined) => {
  265. if (!formEl) return;
  266. formEl.resetFields();
  267. fastSearch.value = 'InitiatedCountersignature';
  268. state.queryParams.HandleCountersignature = null;
  269. state.queryParams.InitiatedCountersignature = true;
  270. hotSpotRef.value?.reset();
  271. queryList();
  272. };
  273. // 流转记录
  274. const auditRecordRef = ref<RefType>(); // 流转记录
  275. const onRecord = (row) => {
  276. const params = {
  277. dialogTitle: '流转记录',
  278. ...row.order,
  279. };
  280. auditRecordRef.value.openDialog(params);
  281. };
  282. // 查询基础信息
  283. const baseInfo = async () => {
  284. try {
  285. const {result} = await countersignBase();
  286. state.acceptTypeOptions = result.acceptTypeOptions;
  287. state.channelOptions = result.channelOptions;
  288. state.counterSignTypeOptions = result.counterSignType;
  289. }catch (e){
  290. console.log(e)
  291. }
  292. }
  293. onMounted(() => {
  294. baseInfo();
  295. queryList();
  296. });
  297. </script>
  298. <style scoped lang="scss">
  299. .business-countersign-container {
  300. .arrow {
  301. transition: transform var(--el-transition-duration);
  302. cursor: pointer;
  303. }
  304. .arrow.is-reverse {
  305. transform: rotateZ(-180deg);
  306. }
  307. }
  308. </style>