ApproalProcess.vue 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260
  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. <div v-if="row.attachments">
  88. <el-link
  89. type="primary"
  90. download
  91. :href="row.attachments"
  92. :underline="false"
  93. target="_blank"
  94. >下载</el-link
  95. >
  96. </div>
  97. </template>
  98. </el-table-column>
  99. <el-table-column
  100. label="申请日期"
  101. align="center"
  102. prop="createTime"
  103. :formatter="dateFormatter"
  104. width="180px"
  105. />
  106. <el-table-column
  107. label="项目开始时间"
  108. align="center"
  109. prop="startTime"
  110. :formatter="dateFormatter"
  111. width="180px"
  112. />
  113. <el-table-column label="审批状态" align="center" prop="sampleStatus" >
  114. <template #default="scope">
  115. <dict-tag :type="DICT_TYPE.MUSEUMS_APPROAL_STATUS" :value="scope.row.status"/>
  116. </template>
  117. </el-table-column>
  118. <el-table-column label="操作" align="center" min-width="150px">
  119. <template #default="scope" >
  120. <el-button
  121. link
  122. type="primary"
  123. @click="ApproalDetails(scope.row.id)"
  124. >
  125. 查看
  126. </el-button>
  127. </template>
  128. </el-table-column>
  129. </el-table>
  130. <Pagination
  131. :total="total"
  132. v-model:page="queryParams.pageNo"
  133. v-model:limit="queryParams.pageSize"
  134. @pagination="getList"
  135. />
  136. </ContentWrap>
  137. <!-- <Approval ref="ApprovalRef" @success="getList" />-->
  138. </el-skeleton>
  139. </template>
  140. <script setup lang="ts">
  141. // import Approval from "@/views/museums/specimenoutbound/approval.vue"
  142. import download from '@/utils/download'
  143. import { SpecimenOutboundApi, SpecimenOutboundVO } from '@/api/museums/specimenoutbound'
  144. import {dateFormatter} from "@/utils/formatTime";
  145. import {ref} from "vue";
  146. import {DICT_TYPE, getIntDictOptions} from "@/utils/dict";
  147. defineOptions({ name: 'ApproalProcess' })
  148. const message = useMessage() // 消息弹窗
  149. const { t } = useI18n() // 国际化
  150. const loading = ref(true) // 列表的加载中
  151. const list = ref<SpecimenOutboundVO[]>([]) // 列表的数据
  152. const total = ref(0) // 列表的总页数
  153. const queryParams = reactive({
  154. pageNo: 1,
  155. pageSize: 10,
  156. infoId: undefined,
  157. chineseName: undefined,
  158. specimenNumber: undefined,
  159. applicantName: undefined,
  160. applicationDate: [],
  161. applicationUsage: undefined,
  162. attachments: undefined,
  163. status: [],
  164. remarks: undefined,
  165. processInstanceId: undefined,
  166. operator: undefined,
  167. outgoingTime: [],
  168. returner: undefined,
  169. receiver: undefined,
  170. returnDate: [],
  171. specimenCondition: undefined,
  172. createTime: [],
  173. sampleStatus: undefined,
  174. estimatedReturnTime: [],
  175. startTime:[],
  176. })
  177. const queryFormRef = ref() // 搜索的表单
  178. const exportLoading = ref(false) // 导出的加载中
  179. // /** 添加/修改操作 */
  180. // const formRef = ref()
  181. // const openForm = (type: string, id?: number) => {
  182. // formRef.value.open(type, id)
  183. // }
  184. /** 查询列表 */
  185. const getList = async () => {
  186. loading.value = true
  187. try {
  188. const data = await SpecimenOutboundApi.getSpecimenOutboundPage(queryParams)
  189. list.value = data.list
  190. total.value = data.total
  191. } finally {
  192. loading.value = false
  193. }
  194. }
  195. /** 搜索按钮操作 */
  196. const handleQuery = () => {
  197. queryParams.pageNo = 1
  198. getList()
  199. }
  200. /** 重置按钮操作 */
  201. const resetQuery = () => {
  202. queryFormRef.value.resetFields()
  203. handleQuery()
  204. }
  205. // /** 审批按钮操作 */
  206. //
  207. // // 检查用户权限的方法
  208. // const ApprovalRef = ref()
  209. // const handleApproval = ( id?: number) => {
  210. // ApprovalRef.value.open( id)
  211. //
  212. // }
  213. /** 导出按钮操作 */
  214. const handleExport = async () => {
  215. try {
  216. // 导出的二次确认
  217. await message.exportConfirm()
  218. // 发起导出
  219. exportLoading.value = true
  220. const data = await SpecimenOutboundApi.exportSpecimenOutbound(queryParams)
  221. download.excel(data, '标本出库回库信息.xls')
  222. } catch {
  223. } finally {
  224. exportLoading.value = false
  225. }
  226. }
  227. /** 查看出库入库申请审批详情页面 **/
  228. import { useRouter } from 'vue-router';
  229. const router = useRouter();
  230. const ApproalDetails=(dataId: number) => {
  231. router.push({
  232. name: 'ApproalDetails',
  233. query: {
  234. dataId: dataId,
  235. }
  236. })
  237. }
  238. /** 初始化 **/
  239. onMounted(() => {
  240. getList()
  241. })
  242. </script>