ApproalProcess.vue 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270
  1. <template>
  2. <el-skeleton :loading="loading" animated>
  3. <ContentWrap>
  4. <!-- 搜索工作栏 -->
  5. <el-form
  6. class="-mb-15px"
  7. :model="queryParams"
  8. ref="queryFormRef"
  9. :inline="true"
  10. label-width="68px">
  11. <el-form-item label="标本ID" prop="infoId">
  12. <el-input
  13. v-model="queryParams.infoId"
  14. placeholder="标本ID"
  15. clearable
  16. @keyup.enter="handleQuery"
  17. class="!w-240px"
  18. />
  19. </el-form-item>
  20. <el-form-item label="中文名称" prop="chineseName">
  21. <el-input
  22. v-model="queryParams.chineseName"
  23. placeholder="请输入中文名称"
  24. clearable
  25. @keyup.enter="handleQuery"
  26. class="!w-240px"
  27. />
  28. </el-form-item>
  29. <el-form-item label="标本编号" prop="specimenNumber">
  30. <el-input
  31. v-model="queryParams.specimenNumber"
  32. placeholder="请输入申请出库的标本编号"
  33. clearable
  34. @keyup.enter="handleQuery"
  35. class="!w-240px"
  36. />
  37. </el-form-item>
  38. <el-form-item label="申请日期" prop="applicationDate">
  39. <el-date-picker
  40. v-model="queryParams.applicationDate"
  41. value-format="YYYY-MM-DD HH:mm:ss"
  42. type="daterange"
  43. start-placeholder="开始日期"
  44. end-placeholder="结束日期"
  45. :default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
  46. class="!w-220px"
  47. />
  48. </el-form-item>
  49. <!-- <el-form-item label="审批状态" prop="status">-->
  50. <!-- <el-select-->
  51. <!-- v-model="queryParams.status"-->
  52. <!-- placeholder="请选择审批状态"-->
  53. <!-- clearable-->
  54. <!-- class="!w-240px"-->
  55. <!-- >-->
  56. <!-- <el-option-->
  57. <!-- v-for="dict in getIntDictOptions(DICT_TYPE. MUSEUMS_APPROAL_STATUS)"-->
  58. <!-- :key="dict.value"-->
  59. <!-- :label="dict.label"-->
  60. <!-- :value="dict.value" />-->
  61. <!-- </el-select>-->
  62. <!-- </el-form-item>-->
  63. <el-form-item >
  64. <el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
  65. <el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
  66. <el-button
  67. type="success"
  68. plain
  69. @click="handleExport"
  70. :loading="exportLoading"
  71. v-hasPermi="['museums:specimen-outbound:export']"
  72. >
  73. <Icon icon="ep:download" class="mr-5px" /> 导出
  74. </el-button>
  75. </el-form-item>
  76. </el-form>
  77. </ContentWrap>
  78. <!-- 列表 -->
  79. <ContentWrap>
  80. <el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
  81. <el-table-column label="序号" align="center" prop="id" />
  82. <el-table-column label="申请人姓名" align="center" width="120px" prop="applicantName" />
  83. <el-table-column label="申请单位" align="center" width="120px" prop="applicationUsage" />
  84. <el-table-column label="研究项目名称" align="center" prop="projectName" />
  85. <el-table-column label="附件" align="center" prop="attachments" >
  86. <template #default="{ row }">
  87. <el-image
  88. v-if="row.type && row.type.includes('image')"
  89. class="h-80px w-80px"
  90. lazy
  91. :src="row.attachments"
  92. :preview-src-list="[row.attachments]"
  93. preview-teleported
  94. fit="cover"
  95. />
  96. <el-link
  97. v-else-if="row.type && row.type.includes('pdf')"
  98. type="primary"
  99. :href="row.attachments"
  100. :underline="false"
  101. target="_blank"
  102. >预览</el-link
  103. >
  104. <el-link v-else type="primary" download :href="row.attachments" :underline="false" target="_blank"
  105. >下载</el-link
  106. >
  107. </template>
  108. </el-table-column>
  109. <el-table-column
  110. label="申请日期"
  111. align="center"
  112. prop="applicationDate"
  113. :formatter="dateFormatter"
  114. width="180px"
  115. />
  116. <el-table-column
  117. label="项目开始时间"
  118. align="center"
  119. prop="startTime"
  120. :formatter="dateFormatter"
  121. width="180px"
  122. />
  123. <el-table-column label="审批状态" align="center" prop="sampleStatus" >
  124. <template #default="scope">
  125. <dict-tag :type="DICT_TYPE.MUSEUMS_APPROAL_STATUS" :value="scope.row.status"/>
  126. </template>
  127. </el-table-column>
  128. <el-table-column label="操作" align="center" min-width="150px">
  129. <template #default="scope" >
  130. <el-button
  131. link
  132. type="primary"
  133. @click="ApproalDetails(scope.row.id)"
  134. >
  135. 查看
  136. </el-button>
  137. </template>
  138. </el-table-column>
  139. </el-table>
  140. <Pagination
  141. :total="total"
  142. v-model:page="queryParams.pageNo"
  143. v-model:limit="queryParams.pageSize"
  144. @pagination="getList"
  145. />
  146. </ContentWrap>
  147. <!-- <Approval ref="ApprovalRef" @success="getList" />-->
  148. </el-skeleton>
  149. </template>
  150. <script setup lang="ts">
  151. // import Approval from "@/views/museums/specimenoutbound/approval.vue"
  152. import download from '@/utils/download'
  153. import { SpecimenOutboundApi, SpecimenOutboundVO } from '@/api/museums/specimenoutbound'
  154. import {dateFormatter} from "@/utils/formatTime";
  155. import {ref} from "vue";
  156. import {DICT_TYPE, getIntDictOptions} from "@/utils/dict";
  157. defineOptions({ name: 'ApproalProcess' })
  158. const message = useMessage() // 消息弹窗
  159. const { t } = useI18n() // 国际化
  160. const loading = ref(true) // 列表的加载中
  161. const list = ref<SpecimenOutboundVO[]>([]) // 列表的数据
  162. const total = ref(0) // 列表的总页数
  163. const queryParams = reactive({
  164. pageNo: 1,
  165. pageSize: 10,
  166. infoId: undefined,
  167. chineseName: undefined,
  168. specimenNumber: undefined,
  169. applicantName: undefined,
  170. applicationDate: [],
  171. applicationUsage: undefined,
  172. attachments: undefined,
  173. status: [],
  174. remarks: undefined,
  175. processInstanceId: undefined,
  176. operator: undefined,
  177. outgoingTime: [],
  178. returner: undefined,
  179. receiver: undefined,
  180. returnDate: [],
  181. specimenCondition: undefined,
  182. createTime: [],
  183. sampleStatus: undefined,
  184. estimatedReturnTime: [],
  185. startTime:[],
  186. })
  187. const queryFormRef = ref() // 搜索的表单
  188. const exportLoading = ref(false) // 导出的加载中
  189. // /** 添加/修改操作 */
  190. // const formRef = ref()
  191. // const openForm = (type: string, id?: number) => {
  192. // formRef.value.open(type, id)
  193. // }
  194. /** 查询列表 */
  195. const getList = async () => {
  196. loading.value = true
  197. try {
  198. const data = await SpecimenOutboundApi.getSpecimenOutboundPage(queryParams)
  199. list.value = data.list
  200. total.value = data.total
  201. } finally {
  202. loading.value = false
  203. }
  204. }
  205. /** 搜索按钮操作 */
  206. const handleQuery = () => {
  207. queryParams.pageNo = 1
  208. getList()
  209. }
  210. /** 重置按钮操作 */
  211. const resetQuery = () => {
  212. queryFormRef.value.resetFields()
  213. handleQuery()
  214. }
  215. // /** 审批按钮操作 */
  216. //
  217. // // 检查用户权限的方法
  218. // const ApprovalRef = ref()
  219. // const handleApproval = ( id?: number) => {
  220. // ApprovalRef.value.open( id)
  221. //
  222. // }
  223. /** 导出按钮操作 */
  224. const handleExport = async () => {
  225. try {
  226. // 导出的二次确认
  227. await message.exportConfirm()
  228. // 发起导出
  229. exportLoading.value = true
  230. const data = await SpecimenOutboundApi.exportSpecimenOutbound(queryParams)
  231. download.excel(data, '标本出库回库信息.xls')
  232. } catch {
  233. } finally {
  234. exportLoading.value = false
  235. }
  236. }
  237. /** 查看出库入库申请审批详情页面 **/
  238. import { useRouter } from 'vue-router';
  239. const router = useRouter();
  240. const ApproalDetails=(dataId: number) => {
  241. router.push({
  242. name: 'ApproalDetails',
  243. query: {
  244. dataId: dataId,
  245. }
  246. })
  247. }
  248. /** 初始化 **/
  249. onMounted(() => {
  250. getList()
  251. })
  252. </script>