OutboundManagement.vue 8.2 KB

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