OutboundManagement.vue 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290
  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. v-if=" scope.row.status !== 2 && scope.row.status !== 3 && scope.row.status !== 4"
  137. link
  138. type="primary"
  139. @click="handleOutbound(scope.row.id)"
  140. >
  141. 出库
  142. </el-button>
  143. <el-button
  144. v-if="scope.row.status !== 2 && scope.row.status !== 4"
  145. link
  146. type="success"
  147. @click=" openForm(scope.row.id)"
  148. >
  149. 回库
  150. </el-button>
  151. </template>
  152. </el-table-column>
  153. </el-table>
  154. <!-- 分页 -->
  155. <Pagination
  156. :total="total"
  157. v-model:page="queryParams.pageNo"
  158. v-model:limit="queryParams.pageSize"
  159. @pagination="getList"
  160. />
  161. </ContentWrap>
  162. <!-- 表单弹窗:回库 -->
  163. <specimenReturnForm ref="formRef" @success="getList" />
  164. </el-skeleton>
  165. </div>
  166. </template>
  167. <script setup lang="ts">
  168. import download from '@/utils/download'
  169. import { dateFormatter } from '@/utils/formatTime'
  170. import {defineComponent, ref,reactive} from "vue";
  171. import { SpecimenOutboundApi, SpecimenOutboundVO } from '@/api/museums/specimenoutbound'
  172. import specimenReturnForm from '@/views/museums/specimenoutbound/OutboundForm/specimenReturnForm.vue'
  173. defineComponent({name:'OutboundManagement'})
  174. const message = useMessage() // 消息弹窗
  175. const { t } = useI18n() // 国际化
  176. const loading = ref(true) // 列表的加载中
  177. const list = ref<SpecimenOutboundVO[]>([]) // 列表的数据
  178. const total = ref(0) // 列表的总页数
  179. const queryParams = reactive({
  180. pageNo: 1,
  181. pageSize: 10,
  182. infoId: undefined,
  183. chineseName: undefined,
  184. specimenNumber: undefined,
  185. applicantName: undefined,
  186. applicationDate: [],
  187. applicationUsage: undefined,
  188. attachments: undefined,
  189. status: undefined,
  190. remarks: undefined,
  191. processInstanceId: undefined,
  192. operator: undefined,
  193. outgoingTime: [],
  194. returner: undefined,
  195. receiver: undefined,
  196. returnDate: [],
  197. specimenCondition: undefined,
  198. createTime: [],
  199. sampleStatus: undefined
  200. })
  201. const queryFormRef = ref() // 搜索的表单
  202. const exportLoading = ref(false) // 导出的加载中
  203. /** 查询列表 */
  204. const getList = async () => {
  205. loading.value = true
  206. try {
  207. const data = await SpecimenOutboundApi.getSpecimenOutboundPage(queryParams)
  208. list.value = data.list
  209. total.value = data.total
  210. } finally {
  211. loading.value = false
  212. }
  213. }
  214. /** 搜索按钮操作 */
  215. const handleQuery = () => {
  216. queryParams.pageNo = 1
  217. getList()
  218. }
  219. /** 重置按钮操作 */
  220. const resetQuery = () => {
  221. queryFormRef.value.resetFields()
  222. handleQuery()
  223. }
  224. /** 导出按钮操作 */
  225. const handleExport = async () => {
  226. try {
  227. // 导出的二次确认
  228. await message.exportConfirm()
  229. // 发起导出
  230. exportLoading.value = true
  231. const data = await SpecimenOutboundApi.exportSpecimenOutbound(queryParams)
  232. download.excel(data, '标本出库回库信息.xls')
  233. } catch {
  234. } finally {
  235. exportLoading.value = false
  236. }
  237. }
  238. /** 查看详情页面 **/
  239. import { useRouter } from 'vue-router';
  240. import {DICT_TYPE, getIntDictOptions} from "@/utils/dict";
  241. const router = useRouter();
  242. const detail=(dataId: number) => {
  243. router.push({
  244. name: 'OutboundDetail',
  245. query: {
  246. dataId: dataId,
  247. }
  248. })
  249. }
  250. /** 出库操作 */
  251. const handleOutbound = async (id) => {
  252. try {
  253. // 出库的二次确认
  254. await message.OutboundConfirm()
  255. // 发起出库
  256. await SpecimenOutboundApi.ConfirmSpecimenOutbound(id)
  257. message.success(t('出库成功'))
  258. // 刷新列表
  259. await getList()
  260. } catch (error) {
  261. message.error(t('出库失败'));
  262. }
  263. };
  264. /** 回库 */
  265. const formRef = ref()
  266. const openForm = (type: string, id?: number) => {
  267. formRef.value.open(type, id)
  268. }
  269. /** 初始化 **/
  270. onMounted(() => {
  271. getList()
  272. })
  273. </script>