OutboundManagement.vue 8.0 KB

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