outboundDetail.vue 15 KB

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