index.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674
  1. <template>
  2. <SmartTable
  3. ref="SmartTableRef"
  4. v-model:columns="columns"
  5. v-model:pageNo="pageNo"
  6. v-model:pageSize="pageSize"
  7. v-model:formData="searchFormData"
  8. :total="total"
  9. :data="dataList"
  10. :loading="loading"
  11. :buttons="tableButtons"
  12. @on-page-no-change="() => getOrderList()"
  13. @on-page-size-change="() => getOrderList()"
  14. @on-reset="() => {
  15. isClaim = '100'
  16. handleQuery()
  17. }"
  18. @on-search="() => getOrderList()"
  19. @refresh="() => getOrderList()"
  20. >
  21. <template #toolbarRowExtra>
  22. <el-radio-group v-model="isClaim" @change="handleQuery">
  23. <el-radio-button label="全部" value="all" />
  24. <el-radio-button label="已通过" value="200" />
  25. <el-radio-button label="审核中" value="100" />
  26. <el-radio-button label="已拒绝" value="300" />
  27. <el-radio-button label="已撤回" value="500" />
  28. </el-radio-group>
  29. </template>
  30. </SmartTable>
  31. <RejectDialog
  32. v-if="rejectDialogVisible"
  33. v-model:modelValue="rejectDialogVisible"
  34. title="批量拒绝"
  35. :apiParams="rejectParams"
  36. :apiFn="AcceptOrderApi.rejectBatchAcceptOrder"
  37. reasonLabel="拒绝原因"
  38. reasonProp="reason"
  39. @success="handleUpdateSuccess"
  40. />
  41. <RejectDialog
  42. v-if="cancelDialogVisible"
  43. v-model:modelValue="cancelDialogVisible"
  44. title="作废原因"
  45. :apiParams="cancelParams"
  46. :apiFn="AcceptOrderApi.cancelAcceptOrder"
  47. reasonLabel="原因"
  48. reasonProp="reason"
  49. @success="handleUpdateSuccess"
  50. />
  51. <RejectDialog
  52. v-if="cancelDialogVisible2"
  53. v-model:modelValue="cancelDialogVisible2"
  54. title="撤回原因"
  55. :apiParams="cancelParams2"
  56. :apiFn="AcceptOrderApi.withdrawAcceptOrder"
  57. reasonLabel="原因"
  58. reasonProp="reason"
  59. @success="handleUpdateSuccess"
  60. />
  61. <AcceptOrderFlowRecord
  62. v-if="acceptOrderFlowRecordVisible"
  63. v-model:visible="acceptOrderFlowRecordVisible"
  64. :id="recordId"
  65. />
  66. <AcceptOrderDetail v-if="detailVisible" v-model:visible="detailVisible" :id="detailId" :pageType="pageType" @success="handleSubmitSuccess"/>
  67. <AcceptOrderBoilerDetail v-if="boilerDetailVisible" v-model:visible="boilerDetailVisible" :id="detailId" :pageType="pageType" @success="handleSubmitSuccess"/>
  68. <AcceptOrderPipeDetail v-if="pipeDetailVisible" v-model:visible="pipeDetailVisible" :id="detailId" :pageType="pageType" @success="handleSubmitSuccess"/>
  69. <unitContainerForm ref="unitContainerFormRef" />
  70. </template>
  71. <script setup lang="tsx">
  72. import RejectDialog from '@/views/pressure/components/RejectDialog.vue'
  73. import AcceptOrderFlowRecord from '@/views/pressure/components/AcceptOrderFlowRecord.vue'
  74. import AcceptOrderDetail from '@/views/pressure/acceptorder/detail.vue'
  75. import AcceptOrderBoilerDetail from '@/views/pressure2/acceptorder/boilerDetail.vue'
  76. import AcceptOrderPipeDetail from '@/views/pressure2/acceptorder/pipeDetail.vue'
  77. import unitContainerForm from '@/components/unitContainerForm/index.vue'
  78. import SmartTable from '@/components/SmartTable/SmartTable'
  79. import dayjs from 'dayjs'
  80. import { AcceptOrderApi } from '@/api/pressure/acceptorder'
  81. import { useDictStore } from '@/store/modules/dict'
  82. import { useRoute } from 'vue-router'
  83. import { useUserStore } from '@/store/modules/user'
  84. import { usePageLoading } from '@/hooks/web/usePageLoading'
  85. import { SmartInstanceExpose, SmartTableColumn, SmartSearchFormOptionItem } from '@/types/table'
  86. import { getDeptList } from '@/api/laboratory/dept'
  87. const dictStore = useDictStore()
  88. const userStore = useUserStore()
  89. const getCurrentUserRoles = computed(() => userStore.getRoles)
  90. const { loadStart, loadDone } = usePageLoading()
  91. const unitContainerFormRef = ref<InstanceType<typeof unitContainerForm>>()
  92. const userInfo = computed(() => userStore.user)
  93. const deptList = ref<SmartSearchFormOptionItem[]>([])
  94. const fetchDeptList = async () => {
  95. return new Promise<SmartSearchFormOptionItem[]>((resolve, reject) => {
  96. getDeptList({})
  97. .then((res) => {
  98. const options = res.map((item) => ({
  99. label: item.name,
  100. value: item.id
  101. }))
  102. deptList.value = options
  103. resolve(options)
  104. })
  105. .catch(() => {
  106. resolve([])
  107. })
  108. })
  109. }
  110. const route = useRoute()
  111. const isAuditPage = computed(() => route.path.includes('/accept-order-audit'))
  112. const getOrderStatus = computed(() => dictStore.getDictMap['bpm_audit_status'] || [])
  113. const getTypeColor = computed(() => {
  114. return (status) => {
  115. const statusMap = {
  116. '100': 'primary',
  117. '200': 'success',
  118. '300': 'danger',
  119. '400': 'warning',
  120. '500': 'danger'
  121. }
  122. return statusMap[status]
  123. }
  124. })
  125. // 收费方式映射
  126. const feeTypeMap = {
  127. 100: '非合同收费',
  128. 200: '合同收费'
  129. }
  130. // 检验性质映射
  131. const checkTypeMap = {
  132. 100: '定期检验',
  133. 200: '年度检查',
  134. 300: '超年限检验'
  135. }
  136. const columns = ref<SmartTableColumn[]>([
  137. {
  138. type: 'selection',
  139. width: 60,
  140. align: 'center'
  141. },
  142. {
  143. label: '受理单号',
  144. prop: 'acceptNo',
  145. width: 150,
  146. search: {
  147. type: 'input'
  148. },
  149. render: (row, value) => <el-button link type="primary" onClick={() => handleOpenDetail(row)}>{ value || '-'}</el-button>
  150. },
  151. {
  152. label: '设备注册代码',
  153. prop: 'equipCode',
  154. width: 140,
  155. hidden: true,
  156. search: {
  157. type: 'input'
  158. },
  159. },
  160. {
  161. label: '使用单位',
  162. prop: 'unitName',
  163. width: 240,
  164. search: {
  165. type: 'input'
  166. },
  167. render: (row, value) => <div style="color: #015293; cursor: pointer" onClick={()=>handleUnitCodeFn(row.unitCode)}>{value || '-'}</div>
  168. },
  169. {
  170. prop: 'deptId',
  171. label: '部门',
  172. width: 120,
  173. fieldProps: {
  174. align: 'center'
  175. },
  176. search: {
  177. type: 'custom-select',
  178. fieldProps: {
  179. placeholder: '请选择部门',
  180. remoteFn: fetchDeptList
  181. }
  182. },
  183. render: (row: any, value) => {
  184. return value ? deptList.value.find((item) => item.value === value)?.label : '-'
  185. }
  186. },
  187. {
  188. label: '检验性质',
  189. prop: 'checkType',
  190. width: 100,
  191. search: {
  192. type: 'select', // 改为select类型
  193. options: Object.entries(checkTypeMap).map(([value, label]) => ({
  194. label,
  195. value: parseInt(value) // 确保值是数字类型
  196. }))
  197. },
  198. render: (row, value) => {
  199. return !value ? '-' : checkTypeMap[value]
  200. }
  201. },
  202. {
  203. label: '检验时间',
  204. prop: 'appointmentDate',
  205. width: 120, // 增加宽度从120改为240
  206. search: {
  207. type: 'daterange', // 改为日期范围选择器
  208. span: 6, // 增加搜索框宽度
  209. fieldProps: {
  210. style: { width: '100%' } // 确保日期选择器占满可用空间
  211. }
  212. },
  213. render: (row, appointmentDate) => {return !appointmentDate ? '-' : dayjs(appointmentDate).format('YYYY-MM-DD')}
  214. },
  215. {
  216. label: '检验员',
  217. prop: 'checkers',
  218. width: 120,
  219. search: {
  220. type: 'input'
  221. },
  222. render: (row, checkers) => {
  223. const checkersName = checkers?.length ? checkers?.map(x => x.nickname) : []
  224. const displayText = checkers.map(x => x.nickname).join(' | ')
  225. return (
  226. <el-popover
  227. placement="top-start"
  228. title="检验员列表"
  229. width="240"
  230. trigger="hover"
  231. content={`已选 ${checkersName?.length || 0} 人:\n${displayText}`}
  232. >
  233. {{
  234. reference: () => (
  235. <div class="m-2">
  236. {checkersName?.length && checkersName?.length > 2 ? `${checkersName.slice(0, 2).join(' | ')}...` : checkersName?.join(' | ')}
  237. </div>
  238. )
  239. }}
  240. </el-popover>
  241. );
  242. }
  243. },
  244. {
  245. label: '收费方式',
  246. prop: 'feeType',
  247. width: 120,
  248. search: {
  249. type: 'select',
  250. options: Object.entries(feeTypeMap).map(([value, label]) => ({
  251. label,
  252. value: parseInt(value) // 确保值是数字类型
  253. }))
  254. },
  255. render: (row, value) => {return !value ? '-' : feeTypeMap[value]}
  256. },
  257. {
  258. label: '合同编号',
  259. prop: 'contractNo',
  260. width: 120,
  261. search: {
  262. type: 'input'
  263. },
  264. render: (row, value) => {return value || '-'}
  265. },
  266. {
  267. label: '受理单状态',
  268. prop: 'status',
  269. width: 100,
  270. // search: {
  271. // type: 'select',
  272. // options: getOrderStatus.value,
  273. // fieldProps:{
  274. // multiple: true
  275. // }
  276. // },
  277. render: (row, value) =>
  278. <el-tag type={getTypeColor.value(row.status)}>
  279. {!row.status ? '-' : getOrderStatus.value.find(x => x.value === row.status.toString())?.label}
  280. </el-tag>
  281. },
  282. {
  283. label: '当前流程',
  284. prop: 'currentNode',
  285. width: 200,
  286. render: (row, currentNode) => {
  287. switch(row.status) {
  288. case 100:
  289. return <>
  290. <div>当前节点:{currentNode}</div>
  291. <div>状态:审核中</div>
  292. </>
  293. case 200:
  294. return <>
  295. <div>当前节点:{currentNode}</div>
  296. <div>{row?.currentAuditor? (`${row.currentAuditor.nickname}(${row.currentAuditor.employeeNo}) 已通过`) : '-'}</div>
  297. </>
  298. case 300:
  299. return <>
  300. <div>当前节点:{currentNode}</div>
  301. <div>状态:{`${row.currentAuditor.nickname}(${row.currentAuditor.employeeNo})`} 已拒绝</div>
  302. </>
  303. case 400:
  304. return '-'
  305. default:
  306. return '-'
  307. }
  308. }
  309. },
  310. {
  311. label: '备注',
  312. prop: 'remark',
  313. width: 200,
  314. render: (row, value) => {return value || '-'}
  315. },
  316. {
  317. label: '受理单提交人',
  318. prop: 'submitUser',
  319. width: 100,
  320. search: {
  321. type: 'input'
  322. },
  323. render: (row, submitUser) => {return !submitUser ? '-' : submitUser?.nickname}
  324. },
  325. {
  326. label: '受理单提交时间',
  327. prop: 'submitTime',
  328. width: 240, // 增加宽度,从120改为240或更大
  329. search: {
  330. type: 'daterange',
  331. span: 6, // 可以增加搜索框的span值,控制其在搜索表单中占据的宽度
  332. fieldProps: {
  333. style: { width: '100%' } // 确保日期选择器占满整个可用空间
  334. }
  335. },
  336. render: (row, submitTime) => {
  337. return !submitTime ? '-' : dayjs(submitTime).format('YYYY-MM-DD HH:mm:ss')
  338. }
  339. },
  340. // {
  341. // label: '审核人',
  342. // prop: 'bpmUserId',
  343. // hidden: true,
  344. // width: 240, // 增加宽度,从120改为240或更大
  345. // search: {
  346. // type: 'selectUserModal',
  347. // span: 6,
  348. // },
  349. // },
  350. {
  351. label: '操作',
  352. prop: '',
  353. width: 140,
  354. fieldProps: {
  355. fixed: 'right',
  356. },
  357. render: (row) => {
  358. switch (row.status) {
  359. case 200:
  360. case 400:
  361. return <el-button link type="primary" onClick={()=>handleGetFlowRecord(row)}>流转记录</el-button>
  362. case 100:
  363. return <>
  364. {
  365. isAuditPage.value ? <>
  366. {
  367. ((row.currentNode === '业务审核' && getCurrentUserRoles.value.includes('business_review')) || (row.currentNode === '容器技术审核' && getCurrentUserRoles.value.includes('technical_review')))
  368. &&
  369. <>
  370. <el-button link type="primary" onClick={()=>handleBatchPassOrder(row)}>通过</el-button>
  371. <el-button link type="primary" onClick={()=>handleBatchRejectOrder(row)}>拒绝</el-button>
  372. </>
  373. }
  374. <el-button link type="primary" onClick={()=>handleGetFlowRecord(row)}>流转记录</el-button>
  375. </> : <div>
  376. <el-button link type="primary" onClick={()=>handleGetFlowRecord(row)}>流转记录</el-button>
  377. <el-button link type="primary" onClick={()=>handleGetFlowCnacel(row)}>撤回</el-button>
  378. </div>
  379. }
  380. </>
  381. case 300:
  382. // <el-button link type="primary" onClick={()=>handleCancelAcceptOrder(row)}>作废受理单</el-button>
  383. // <el-button link type="primary" onClick={()=>handleCancelAcceptOrder(row)}>作废受理单</el-button>
  384. return !isAuditPage.value
  385. ?
  386. <>
  387. <el-button link type="primary" onClick={()=>handleSubmitAgain(row)}>重新提交</el-button>
  388. <el-button link type="primary" onClick={()=>handleGetFlowRecord(row)}>流转记录</el-button>
  389. </>
  390. :
  391. <>
  392. <el-button link type="primary" onClick={()=>handleGetFlowRecord(row)}>流转记录</el-button>
  393. <el-button link type="primary" onClick={()=>handleReviewRejectReason(row)}>查看回退原因</el-button>
  394. </>
  395. case 500:
  396. return <> <el-button link type="primary" onClick={()=>handleSubmitAgain(row)}>重新提交</el-button>
  397. <el-button link type="primary" onClick={()=>handleGetFlowRecord(row)}>流转记录</el-button>
  398. </>
  399. }
  400. }
  401. },
  402. ])
  403. const tableButtons = computed(() => isAuditPage.value ? [
  404. {
  405. label: '',
  406. render: () => <el-button onClick={() => handleBatchPassOrder()} type="primary">批量通过</el-button>
  407. },
  408. {
  409. label: '',
  410. render: () => <el-button onClick={() => handleBatchRejectOrder()} type="danger">批量拒绝</el-button>
  411. }
  412. ] : [])
  413. const pageNo = ref(1)
  414. const pageSize = ref(10)
  415. const total = ref(0)
  416. const searchFormData = ref<Recordable>({
  417. // bpmUserId: userInfo.value.id,
  418. // bpmUserId: '',
  419. status: ['100'],
  420. deptId: userStore.user.deptId
  421. })
  422. const loading = ref(false)
  423. const dataList = ref([])
  424. const SmartTableRef = ref<SmartInstanceExpose>()
  425. const isClaim = ref('100')
  426. // 处理状态筛选查询
  427. const handleQuery = () => {
  428. if (isClaim.value === 'all') {
  429. // 清除状态筛选
  430. delete searchFormData.value.status
  431. } else {
  432. // 设置状态筛选
  433. searchFormData.value.status = [isClaim.value]
  434. }
  435. // 重置页码并触发查询
  436. pageNo.value = 1
  437. getOrderList()
  438. }
  439. // 流转记录
  440. const acceptOrderFlowRecordVisible = ref(false)
  441. const recordId = ref('')
  442. const handleGetFlowRecord = async (row) => {
  443. acceptOrderFlowRecordVisible.value = true
  444. recordId.value = row.id
  445. }
  446. // 批量通过受理单
  447. const handleBatchPassOrder = async (row?: any) => {
  448. let ids:string[] = []
  449. let orderNos = ''
  450. if(row) {
  451. ids = [row.id]
  452. orderNos = row.acceptNo
  453. } else {
  454. const selectedRows = SmartTableRef.value?.getTableRef().getSelectionRows();
  455. if (!selectedRows || selectedRows.length === 0) {
  456. ElMessage.warning('请选择受理单');
  457. return;
  458. }
  459. const selectedStatus = selectedRows.every((item: Record<string, any>)=> item.status == '100')
  460. if (selectedStatus === false) {
  461. return ElMessage.warning('请选择审核中状态的受理单');
  462. }
  463. ids = selectedRows.map(x => x.id)
  464. orderNos = selectedRows.map(x => x.acceptNo).join(', ')
  465. }
  466. ElMessageBox.confirm(`确定${!row ? '批量' : ''}通过受理单【${orderNos}】?`, '提示', {
  467. confirmButtonText: '确定',
  468. cancelButtonText: '取消',
  469. type: 'warning'
  470. }).then(() => {
  471. loading.value = true
  472. AcceptOrderApi.passBatchAcceptOrder({ids}).then(() => {
  473. ElMessage.success(row ? `受理单成功【${orderNos}】通过成功` : '批量通过受理单成功');
  474. getOrderList();
  475. })
  476. }).catch(() => {
  477. console.log('已取消')
  478. })
  479. }
  480. const handleGetFlowCnacel = async (row?: any) => {
  481. // let orderNos = ''
  482. if(row.submitUser?.id != userInfo.value.id) {
  483. return ElMessage.warning('只能撤回自己提交的受理单');
  484. }
  485. cancelDialogVisible2.value = true
  486. cancelParams2.value = {
  487. id: row.id
  488. }
  489. // if(row) {
  490. // orderNos = row.acceptNo
  491. // }
  492. // ElMessageBox.confirm(`确定撤回受理单【${orderNos}】?`, '提示', {
  493. // confirmButtonText: '确定',
  494. // cancelButtonText: '取消',
  495. // type: 'warning'
  496. // }).then(() => {
  497. // loading.value = true
  498. // AcceptOrderApi.withdrawAcceptOrder({id: row.id}).then(() => {
  499. // ElMessage.success(`受理单成功【${orderNos}】撤回成功`);
  500. // getOrderList();
  501. // })
  502. // }).catch(() => {
  503. // console.log('已取消')
  504. // })
  505. }
  506. // 批量拒绝受理单
  507. const rejectDialogVisible = ref(false)
  508. const rejectParams = ref({})
  509. const handleBatchRejectOrder = async (row?: any) => {
  510. let ids:string[] = []
  511. if(row) {
  512. ids = [row.id]
  513. } else {
  514. const selectedRows = SmartTableRef.value?.getTableRef().getSelectionRows();
  515. if (!selectedRows || selectedRows.length === 0) {
  516. ElMessage.warning('请选择受理单');
  517. return;
  518. }
  519. const selectedStatus = selectedRows.every((item: Record<string, any>)=> item.status == '100')
  520. if (selectedStatus === false) {
  521. return ElMessage.warning('请选择审核中状态的受理单');
  522. }
  523. ids = selectedRows.map(x => x.id)
  524. }
  525. rejectDialogVisible.value = true
  526. rejectParams.value = {
  527. ids
  528. }
  529. }
  530. // 作废受理单
  531. const cancelDialogVisible = ref(false)
  532. const cancelDialogVisible2 = ref(false)
  533. const cancelParams = ref({})
  534. const cancelParams2 = ref({})
  535. const handleCancelAcceptOrder = async (row) => {
  536. cancelDialogVisible.value = true
  537. cancelParams.value = {
  538. id: row.id
  539. }
  540. }
  541. // 查看回退原因
  542. const handleReviewRejectReason = (row) => {
  543. ElMessageBox.confirm(`拒绝原因:${row.reason}`, '查看回退原因', {
  544. confirmButtonText: '确定',
  545. cancelButtonText: '关闭',
  546. type: 'warning'
  547. })
  548. }
  549. const handleUpdateSuccess = () => {
  550. getOrderList()
  551. }
  552. // 获取受理单列表
  553. const getOrderList = async () => {
  554. loading.value = true
  555. const params: Record<string, any> = {
  556. pageNo: pageNo.value,
  557. pageSize: pageSize.value,
  558. ...searchFormData.value,
  559. isAudit: true
  560. }
  561. loadStart()
  562. try {
  563. // 处理submitTime日期范围
  564. if (params.submitTime && Array.isArray(params.submitTime) && params.submitTime.length === 2) {
  565. // 设置起始日期为当天的00:00:00
  566. const startDate = dayjs(params.submitTime[0]).startOf('day').format('YYYY-MM-DD HH:mm:ss')
  567. // 设置结束日期为当天的23:59:59
  568. const endDate = dayjs(params.submitTime[1]).endOf('day').format('YYYY-MM-DD HH:mm:ss')
  569. // 替换原始参数中的submitTime
  570. params.submitTimeStart = startDate
  571. params.submitTimeEnd = endDate
  572. // 删除原始的submitTime参数
  573. delete params.submitTime
  574. }
  575. // 处理appointmentDate日期范围 - 保持数组格式,但添加时间部分
  576. if (params.appointmentDate && Array.isArray(params.appointmentDate) && params.appointmentDate.length === 2) {
  577. // 设置起始日期为当天的00:00:00
  578. params.appointmentDate[0] = dayjs(params.appointmentDate[0]).format('YYYY-MM-DD')
  579. // 设置结束日期为当天的23:59:59
  580. params.appointmentDate[1] = dayjs(params.appointmentDate[1]).format('YYYY-MM-DD')
  581. }
  582. const data = await AcceptOrderApi.getAcceptOrderPage(params)
  583. dataList.value = data?.list || []
  584. total.value = data?.total || 0
  585. } catch {
  586. dataList.value = []
  587. total.value = 0
  588. loadDone()
  589. } finally {
  590. loading.value = false
  591. loadDone()
  592. }
  593. }
  594. onMounted(() => {
  595. const { unitName, filterCancel, bpmUserId } = route.query as Recordable
  596. if(unitName){
  597. searchFormData.value.unitName = unitName
  598. }
  599. if(filterCancel){
  600. const otherStatus = getOrderStatus.value.filter(x => x.value != filterCancel).map(i=>`${i.value}`)
  601. searchFormData.value.status = otherStatus
  602. }
  603. // if(bpmUserId){
  604. // searchFormData.value.bpmUserId = bpmUserId
  605. // }
  606. SmartTableRef.value?.setSearchForm(searchFormData.value)
  607. getOrderList()
  608. })
  609. const detailVisible = ref(false)
  610. const detailId = ref('')
  611. const pageType = ref('')
  612. const boilerDetailVisible = ref(false)
  613. const pipeDetailVisible = ref(false)
  614. // 打开受理单详情
  615. const handleOpenDetail = (row) => {
  616. // 根据不同设备类型跳转不同页面
  617. switch (row.equipMainType){
  618. case 200:
  619. boilerDetailVisible.value = true
  620. detailId.value = row.id
  621. pageType.value = row.status === '300' && !isAuditPage.value ? 'edit' : 'detail'
  622. break;
  623. case 300:
  624. pipeDetailVisible.value = true
  625. detailId.value = row.id
  626. pageType.value = row.status === '300' && !isAuditPage.value ? 'edit' : 'detail'
  627. break
  628. case 100:
  629. default:
  630. detailVisible.value = true
  631. detailId.value = row.id
  632. pageType.value = row.status === '300' && !isAuditPage.value ? 'edit' : 'detail'
  633. break;
  634. }
  635. }
  636. // 重新提交-受理单
  637. const handleSubmitAgain = async (row) => {
  638. detailVisible.value = true
  639. detailId.value = row.id
  640. pageType.value = 'edit'
  641. }
  642. const handleUnitCodeFn = (code) => {
  643. if (!code) {
  644. return ElMessage.warning('该单位信息异常!')
  645. }
  646. unitContainerFormRef.value?.open('', code)
  647. }
  648. const handleSubmitSuccess = () => {
  649. getOrderList()
  650. }
  651. </script>