outboundDetail.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387
  1. <template>
  2. <el-skeleton :loading="loading" animated>
  3. <el-row :gutter="8" justify="space-between">
  4. <el-col :xl="24" :lg="24" :md="24" :sm="24" :xs="24">
  5. <el-card style="margin-bottom: 10px">
  6. <template #header>
  7. <div class="card-header" style="text-align: center">
  8. <h1 class="text1">标本出库入库详情</h1>
  9. </div>
  10. </template>
  11. <el-row>
  12. <el-col :xl="11" :lg="11" :md="24" :sm="24" :xs="24">
  13. <el-descriptions
  14. :column="1"
  15. v-if="outboundData"
  16. :size="size"
  17. border>
  18. <el-descriptions-item label="申请人姓名:" label-align="right"
  19. label-class-name="my-label">{{
  20. outboundData.applicantName
  21. }}
  22. </el-descriptions-item>
  23. <el-descriptions-item label="申请单位:" label-align="right"
  24. label-class-name="my-label">{{
  25. outboundData.applicationUsage
  26. }}
  27. </el-descriptions-item>
  28. <el-descriptions-item label="电话号码:" label-align="right"
  29. label-class-name="my-label">{{
  30. outboundData.phoneNumber
  31. }}
  32. </el-descriptions-item>
  33. <el-descriptions-item label="研究项目名称:" label-align="right"
  34. label-class-name="my-label">{{
  35. outboundData.projectName
  36. }}
  37. </el-descriptions-item>
  38. <el-descriptions-item label="项目开始时间:" label-align="right"
  39. label-class-name="my-label">{{
  40. outboundData.startTime
  41. }}
  42. </el-descriptions-item>
  43. <el-descriptions-item label="项目结束时间:" label-align="right"
  44. label-class-name="my-label">{{
  45. outboundData.endTime
  46. }}
  47. </el-descriptions-item>
  48. <el-descriptions-item label="一级审批时间:" label-align="right"
  49. label-class-name="my-label">{{
  50. outboundData.approvalTime
  51. }}
  52. </el-descriptions-item>
  53. <el-descriptions-item label="一级审批员:" label-align="right"
  54. label-class-name="my-label">{{
  55. outboundData.approveUsers
  56. }}
  57. </el-descriptions-item>
  58. <el-descriptions-item label="一级审批建议:" label-align="right"
  59. label-class-name="my-label">{{
  60. outboundData.processInstanceId
  61. }}
  62. </el-descriptions-item>
  63. </el-descriptions>
  64. </el-col>
  65. <el-col :xl="10" :lg="10" :md="24" :sm="24" :xs="24">
  66. <el-descriptions
  67. :column="1"
  68. v-if="outboundData"
  69. :size="size"
  70. border>
  71. <el-descriptions-item label="二级审批时间:" label-align="right"
  72. label-class-name="my-label">{{
  73. outboundData.twoApprovalTime
  74. }}
  75. </el-descriptions-item>
  76. <el-descriptions-item label="二级审批员:" label-align="right"
  77. label-class-name="my-label">{{
  78. outboundData.twoApproveUsers
  79. }}
  80. </el-descriptions-item>
  81. <el-descriptions-item label="二级审批建议" label-align="right"
  82. label-class-name="my-label">{{
  83. outboundData.rejectionReasons
  84. }}
  85. </el-descriptions-item>
  86. <el-descriptions-item label="出库时间:" label-align="right"
  87. label-class-name="my-label">{{ outboundData.outgoingTime }}
  88. </el-descriptions-item>
  89. <el-descriptions-item label="出库员:" label-align="right">
  90. {{ outboundData.operator }}
  91. </el-descriptions-item>
  92. <el-descriptions-item label="退还日期:" label-align="right"
  93. label-class-name="my-label">{{
  94. outboundData.returnDate
  95. }}
  96. </el-descriptions-item>
  97. <el-descriptions-item label="退还人:" label-align="right"
  98. label-class-name="my-label">{{
  99. outboundData.returner
  100. }}
  101. </el-descriptions-item>
  102. <el-descriptions-item label="点收人:" label-align="right"
  103. label-class-name="my-label">{{
  104. outboundData.receiver
  105. }}
  106. </el-descriptions-item>
  107. <el-descriptions-item label="回库备注信息:" label-align="right"
  108. label-class-name="my-label">{{ outboundData.remarks }}
  109. </el-descriptions-item>
  110. </el-descriptions>
  111. </el-col>
  112. <el-col :xl="3" :lg="3" :md="24" :sm="24" :xs="24">
  113. <el-descriptions
  114. v-if="outboundData"
  115. direction="vertical"
  116. :column="1"
  117. :size="size"
  118. border
  119. >
  120. <el-descriptions-item
  121. :rowspan="4"
  122. :width="140"
  123. label="申请附件"
  124. align="center"
  125. label-class-name="my-label"
  126. class-name="my-content"
  127. >
  128. <!-- <div v-if="outboundData.attachments && outboundData.attachments.type && outboundData.attachments.type.includes('image')" class="image-container">-->
  129. <!-- <el-image-->
  130. <!-- class="h-80px w-80px"-->
  131. <!-- lazy-->
  132. <!-- :src="outboundData.attachments"-->
  133. <!-- :preview-src-list="outboundData.attachments ? [outboundData.attachments] : []"-->
  134. <!-- preview-teleported-->
  135. <!-- fit="cover"-->
  136. <!-- />-->
  137. <!-- </div>-->
  138. <!-- <el-link-->
  139. <!-- v-else-if="outboundData.attachments"-->
  140. <!-- type="primary"-->
  141. <!-- :href="outboundData.attachments"-->
  142. <!-- :underline="false"-->
  143. <!-- target="_blank"-->
  144. <!-- >下载</el-link>-->
  145. <div class="demo-image__preview" v-if="outboundData && outboundData.attachments">
  146. <!-- <a :href="outboundData.attachments" style="color: #dcb56d-->
  147. <!-- ; text-decoration: none;" download>下载附件</a>-->
  148. <!-- <el-link type="primary" download :href="outboundData.attachments" :underline="false" target="_blank"-->
  149. <!-- >下载</el-link-->
  150. <!-- >-->
  151. <el-image
  152. v-if="outboundData.attachments.includes('image')"
  153. class="h-80px w-80px"
  154. lazy
  155. :src="outboundData.attachments"
  156. :preview-src-list="[outboundData.attachments]"
  157. preview-teleported
  158. fit="cover"
  159. />
  160. <el-link
  161. v-else-if="outboundData.attachments.includes('pdf')"
  162. type="primary"
  163. :href="outboundData.attachments"
  164. :underline="false"
  165. target="_blank"
  166. >预览</el-link
  167. >
  168. <el-link v-else type="primary" download :href="outboundData.attachments" :underline="false" target="_blank"
  169. >下载</el-link
  170. >
  171. </div>
  172. </el-descriptions-item>
  173. <el-descriptions-item
  174. :rowspan="4"
  175. :width="140"
  176. label="回库附件"
  177. align="center"
  178. label-class-name="my-label"
  179. class-name="my-content"
  180. >
  181. <div class="demo-image__preview" v-if="outboundData && outboundData.sampleStatus">
  182. <!-- <a :href="outboundData.sampleStatus" style="color: #dcb56d-->
  183. <!-- ; text-decoration: none;" download>下载附件</a>-->
  184. <el-image
  185. v-if="outboundData.sampleStatus.includes('image')"
  186. class="h-80px w-80px"
  187. lazy
  188. :src="outboundData.sampleStatus"
  189. :preview-src-list="[outboundData.sampleStatus]"
  190. preview-teleported
  191. fit="cover"
  192. />
  193. <el-link
  194. v-else-if="outboundData.sampleStatus.includes('pdf')"
  195. type="primary"
  196. :href="outboundData.sampleStatus"
  197. :underline="false"
  198. target="_blank"
  199. >预览</el-link
  200. >
  201. <el-link v-else type="primary" download :href="outboundData.sampleStatus" :underline="false" target="_blank"
  202. >下载</el-link
  203. >
  204. </div>
  205. </el-descriptions-item>
  206. </el-descriptions>
  207. </el-col>
  208. </el-row>
  209. </el-card>
  210. </el-col>
  211. <el-col :xl="24" :lg="24" :md="24" :sm="24" :xs="24">
  212. <!-- 列表 -->
  213. <el-card>
  214. <template #header>
  215. <div class="card-header" style="text-align: center">
  216. <h1 class="text1">标本信息</h1>
  217. </div>
  218. </template>
  219. <el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
  220. <el-table-column label="标本编号" align="center" prop="specimenNumber"/>
  221. <el-table-column label="中文名称" align="center" prop="chineseName"/>
  222. <el-table-column label="标本类型" align="center" prop="specimenType">
  223. <template #default="scope">
  224. <dict-tag :type="DICT_TYPE.MUSEUMS_SPECIMEN_TYPE" :value="scope.row.specimenType"/>
  225. </template>
  226. </el-table-column>
  227. <el-table-column label="标本重量(g)" align="center" prop="weight"/>
  228. <el-table-column label="保存位置" align="center" prop="storageLocation"/>
  229. <el-table-column label="保存类型" align="center" prop="preservationType">
  230. <template #default="scope">
  231. <dict-tag :type="DICT_TYPE.MUSEUMS_SPECIMEN_INFO"
  232. :value="scope.row.preservationType"/>
  233. </template>
  234. </el-table-column>
  235. <el-table-column label="标本图片" align="center" prop="url">
  236. <template #default="{ row }">
  237. <div class="demo-image__preview" v-if="pageParams">
  238. <block v-for="(image, index) in row.imagePath" :key="index">
  239. <el-image
  240. style="width: 40px; height:40px;margin-right: 5px"
  241. class="image-class"
  242. lazy
  243. :src="image"
  244. :preview-src-list="row.imagePath"
  245. preview-teleported
  246. fit="cover"/>
  247. </block>
  248. </div>
  249. </template>
  250. </el-table-column>
  251. </el-table>
  252. <!-- 分页 -->
  253. <Pagination
  254. :total="total"
  255. v-model:page="pageParams.pageNo"
  256. v-model:limit="pageParams.pageSize"
  257. @pagination="getList"
  258. />
  259. </el-card>
  260. </el-col>
  261. </el-row>
  262. </el-skeleton>
  263. </template>
  264. <script setup lang="ts">
  265. import {type ComponentSize, ElCol} from "element-plus";
  266. import {ref, reactive, onMounted, computed} from "vue";
  267. import {SpecimenOutboundApi, SpecimenOutboundVO} from "@/api/museums/specimenoutbound";
  268. import {formatDate} from "@/utils/formatTime";
  269. import {DICT_TYPE} from "@/utils/dict";
  270. defineOptions({name: 'outboundDetail'})
  271. const size = ref<ComponentSize>('large')
  272. const {query} = useRoute() // 查询参数
  273. const loading = ref(true) // 列表的加载中
  274. const list = ref<SpecimenOutboundVO[]>([]) // 列表的数据
  275. const total = ref(0) // 列表的总页数
  276. let outboundData = ref(null); // 初始化响应式数据
  277. const pageParams = reactive({
  278. pageNo: 1,
  279. pageSize: 10,
  280. id: query.dataId,
  281. infoId: undefined,
  282. chineseName: undefined,
  283. specimenNumber: undefined,
  284. attachments: undefined,
  285. processInstanceId: undefined,
  286. specimenCondition: undefined,
  287. imagePath: undefined
  288. })
  289. /** 查询列表 */
  290. const getList = async () => {
  291. loading.value = true
  292. try {
  293. const id = query.dataId as unknown as number
  294. const data = await SpecimenOutboundApi.getSpecimenOutboundDetailsPage(id, pageParams)
  295. console.log('t27348932', data)
  296. list.value = data.specimenInfoList.list
  297. total.value = data.specimenInfoList.total
  298. } finally {
  299. loading.value = false
  300. }
  301. }
  302. const fetchData = async () => {
  303. try {
  304. console.log(query.dataId)
  305. let res: any = await SpecimenOutboundApi.getSpecimenOutboundDetails(query.dataId)
  306. console.log(res)
  307. outboundData.value = res
  308. console.log(outboundData.value)
  309. res.startTime = formatDate(res.startTime)
  310. res.endTime = formatDate(res.endTime)
  311. res.approvalTime = formatDate(res.approvalTime)
  312. res.twoApprovalTime = formatDate(res.twoApprovalTime)
  313. res.outgoingTime = formatDate(res.outgoingTime)
  314. res.returnDate = formatDate(res.returnDate)
  315. } finally {
  316. }
  317. }
  318. // // 在组件加载时获取数据
  319. onMounted(async () => {
  320. await fetchData()
  321. await getList()
  322. })
  323. /**审批状态**/
  324. const statusText = computed(() => {
  325. if (outboundData.value === null) {
  326. return '';
  327. }
  328. switch (outboundData.value.status) {
  329. case 0:
  330. return '审批中';
  331. case 1:
  332. return '一级审批通过';
  333. case 2:
  334. return '一级审批驳回';
  335. case 3:
  336. return '已出库';
  337. case 4:
  338. return '已回库';
  339. case 5:
  340. return '二级审批通过';
  341. case 6:
  342. return '二级审批驳回';
  343. default:
  344. return '';
  345. }
  346. });
  347. </script>
  348. <style scoped>
  349. :deep(.my-label) {
  350. background: #FAF8F7 !important;
  351. width: 180px;
  352. }
  353. :deep(.my-content) {
  354. height: 167px;
  355. }
  356. </style>