index.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335
  1. <template>
  2. <z-paging ref="paging" bgColor="#F7F7F7" safe-area-inset-bottom paging-class="paging-btm-shadow" scroll-with-animation>
  3. <template #top>
  4. <ut-navbar title="种源详情" :fixed="false" border></ut-navbar>
  5. </template>
  6. <template>
  7. <view class="pd-24 d-flex a-c">
  8. <view class="flex1 ov-hd">
  9. <view class="startline-title">库存信息</view>
  10. </view>
  11. <view>
  12. <up-button type="primary" :customStyle="formItemBtnStyle">
  13. <span>查看出入库记录</span>
  14. </up-button>
  15. </view>
  16. </view>
  17. <view class="bg-#fff pd-24">
  18. <view class="d-flex j-sb a-c li-item-head mb-16">
  19. <view class="li-left-tag" :class="{ [`bg-${selectDictListClass(pt_seed_instore_type, form?.instoreType)}`]: true }">{{ selectDictLabel(pt_seed_instore_type, form?.instoreType) }}</view>
  20. <view class="f-s-22 c-#666">{{ form?.updateTime || form?.createTime }}</view>
  21. </view>
  22. <view class="mb-10">
  23. <span class="f-s-34 c-#333 f-w-500 mr-10">{{ form?.variety }}</span>
  24. <span class="f-s-24 c-#666">{{ selectDictLabel(pt_seed_type, form?.seedType) }}</span>
  25. </view>
  26. <view class="pd2-4-0 f-s-28">
  27. <span class="c-#666">入库批号:</span>
  28. <span class="c-#333 f-w-500">{{ form?.batchCode }}</span>
  29. </view>
  30. <!-- <view class="pd2-4-0 f-s-28">
  31. <span class="c-#666">溯源批号:</span>
  32. <span class="c-#333 f-w-500">暂无</span>
  33. </view> -->
  34. <view v-if="['A3', 'A4'].includes(form?.fungusCodeType)" class="pd2-4-0 f-s-28">
  35. <span class="c-#666">菌种/菌株编号:</span>
  36. <span class="c-#333 f-w-500">{{ selectDictLabel(pt_fungus_code_type, form?.fungusCodeType) }}/{{ form?.fungusCode }}</span>
  37. </view>
  38. <view class="pd2-4-0 f-s-28">
  39. <span class="c-#666">供应商:</span>
  40. <span class="c-#333 f-w-500">{{ form?.supplier }}</span>
  41. </view>
  42. <view class="pd2-4-0 f-s-28">
  43. <span class="c-#666">入库量:</span>
  44. <span class="c-#333 f-w-500">{{ form?.capacity }}{{ form?.unit }}</span>
  45. </view>
  46. <view class="d-flex">
  47. <view v-if="form?.restAmount" class="pd2-4-0 f-s-28 flex1">
  48. <span class="c-#666">出库量:</span>
  49. <span class="c-#333 f-w-500">{{ form?.inputAmount || '0' }}{{ form?.unit }}</span>
  50. </view>
  51. <view v-if="form?.restAmount" class="pd2-4-0 f-s-28 flex1">
  52. <span class="c-primary">剩余量:</span>
  53. <span class="c-primary f-w-500">{{ form?.restAmount || '0' }}{{ form?.unit }}</span>
  54. </view>
  55. </view>
  56. </view>
  57. <view class="pd-24">
  58. <view class="startline-title">种源信息</view>
  59. </view>
  60. <view class="bg-#fff pd-24">
  61. <!-- 种源信息详情 -->
  62. <view class="f-s-30 pd2-16-0 info-border-bottom">
  63. <span class="c-#666">种源类型:</span>
  64. <span class="c-#333 f-w-600">{{ selectDictLabel(pt_seed_type, form?.seedType) || '-' }}</span>
  65. </view>
  66. <view class="f-s-30 pd2-16-0 info-border-bottom">
  67. <view class="c-#666 mb-10">物种基原:</view>
  68. <view class="bg-#FBFDFB card-info-block pd-24 p-rtv">
  69. <view class="mb-10">
  70. <span class="f-s-34 c-#333 f-w-5 mr-16">{{ form?.varietyInfo?.varietyName }}</span>
  71. <span class="f-s-24 c-#666">{{ form?.varietyInfo?.latinName }}</span>
  72. </view>
  73. <view>
  74. <span class="f-s-28 c-#333 f-w-5 mr-16">{{ form?.varietyInfo?.genusName }}</span>
  75. <span class="f-s-24 c-#666">{{ form?.varietyInfo?.genusLatinName }}</span>
  76. </view>
  77. </view>
  78. </view>
  79. <view class="f-s-30 pd2-16-0 info-border-bottom">
  80. <span class="c-#666">具体品种/品系名称:</span>
  81. <span class="c-#333 f-w-600">{{ form?.seedName || '-' }}</span>
  82. </view>
  83. <view class="f-s-30 pd2-16-0 info-border-bottom">
  84. <span class="c-#666">种源来源:</span>
  85. <span class="c-#333 f-w-600">{{ selectDictLabel(pt_seed_source, form?.seedSource) || '-' }}</span>
  86. </view>
  87. <view class="f-s-30 pd2-16-0 info-border-bottom" v-if="form?.instoreBizInfo?.motherFatherFlag">
  88. <span class="c-#666">父母本情况:</span>
  89. <span class="c-#333 f-w-600">{{ selectDictLabel(pt_mother_father_flag, form?.instoreBizInfo?.motherFatherFlag) || '-' }}</span>
  90. </view>
  91. <view v-if="form?.instoreBizInfo?.motherFatherFlag == '2' && form?.instoreBizInfo?.fatherVarietyInfo" class="f-s-30 pd2-16-0 info-border-bottom">
  92. <view class="c-#666 mb-10">父本品种:</view>
  93. <view class="bg-#FBFDFB card-info-block pd-24 p-rtv">
  94. <view class="mb-10">
  95. <span class="f-s-34 c-#333 f-w-5 mr-16">{{ form?.instoreBizInfo?.fatherVarietyInfo?.varietyName }}</span>
  96. <span class="f-s-24 c-#666">{{ form?.instoreBizInfo?.fatherVarietyInfo?.latinName }}</span>
  97. </view>
  98. <view>
  99. <span class="f-s-28 c-#333 f-w-5 mr-16">{{ form?.instoreBizInfo?.fatherVarietyInfo?.genusName }}</span>
  100. <span class="f-s-24 c-#666">{{ form?.instoreBizInfo?.fatherVarietyInfo?.genusLatinName }}</span>
  101. </view>
  102. </view>
  103. </view>
  104. <view v-if="form?.instoreBizInfo?.motherVarietyInfo" class="f-s-30 pd2-16-0 info-border-bottom">
  105. <view class="c-#666 mb-10">母本品种:</view>
  106. <view class="bg-#FBFDFB card-info-block pd-24 p-rtv">
  107. <view class="mb-10">
  108. <span class="f-s-34 c-#333 f-w-5 mr-16">{{ form?.instoreBizInfo?.motherVarietyInfo?.varietyName }}</span>
  109. <span class="f-s-24 c-#666">{{ form?.instoreBizInfo?.motherVarietyInfo?.latinName }}</span>
  110. </view>
  111. <view>
  112. <span class="f-s-28 c-#333 f-w-5 mr-16">{{ form?.instoreBizInfo?.motherVarietyInfo?.genusName }}</span>
  113. <span class="f-s-24 c-#666">{{ form?.instoreBizInfo?.motherVarietyInfo?.genusLatinName }}</span>
  114. </view>
  115. </view>
  116. </view>
  117. <template v-if="['A3', 'A4'].includes(form?.seedType as string)">
  118. <view class="f-s-30 pd2-16-0 info-border-bottom">
  119. <span class="c-#666">{{ genCountMap[form?.seedType as 'A3' | 'A4'] }}:</span>
  120. <span class="c-#333 f-w-600">
  121. {{ form?.instoreBizInfo?.genCount || '-' }}
  122. <text v-if="form?.instoreBizInfo?.genUnit">{{ selectDictLabel(pt_gen_unit, form?.instoreBizInfo?.genUnit) }}</text>
  123. </span>
  124. </view>
  125. </template>
  126. <template v-else>
  127. <view class="f-s-30 pd2-16-0 info-border-bottom">
  128. <span class="c-#666">繁衍世代:</span>
  129. <span class="c-#333 f-w-600">
  130. {{ form?.instoreBizInfo?.genCount || '-' }}
  131. <text v-if="form?.instoreBizInfo?.genUnit">{{ selectDictLabel(pt_gen_unit, form?.instoreBizInfo?.genUnit) }}</text>
  132. </span>
  133. </view>
  134. </template>
  135. <view v-if="form?.entrustId" class="f-s-30 pd2-16-0 info-border-bottom">
  136. <view class="c-#666 mb-10">受托单位:</view>
  137. <view class="bg-#FBFDFB card-info-block pd-24 p-rtv">
  138. <view class="f-s-34 c-#333 f-w-500">{{ form?.entrustInfo?.cusName }}</view>
  139. <view class="f-s-24 c-#666">{{ form?.entrustInfo?.cusCode }}</view>
  140. </view>
  141. </view>
  142. <view v-if="form?.examinReport && form?.examinReport.length" class="f-s-30 pd2-16-0 info-border-bottom">
  143. <view class="c-#666 mb-10">检验报告:</view>
  144. <ut-album :urls="form?.examinReport"></ut-album>
  145. </view>
  146. <view v-if="['2', '3'].includes(form?.seedSource as string)" class="f-s-30 pd2-16-0 info-border-bottom">
  147. <view class="c-#666 mb-10">供应商:</view>
  148. <view class="bg-#FBFDFB card-info-block pd-24 p-rtv">
  149. <view class="f-s-34 c-#333 f-w-500">{{ form?.supplierInfo?.cusName }}</view>
  150. <view class="f-s-24 c-#666">{{ form?.supplierInfo?.cusCode }}</view>
  151. </view>
  152. </view>
  153. <view v-if="['2', '3'].includes(form?.seedSource as string)" class="f-s-30 pd2-16-0 info-border-bottom">
  154. <span class="c-#666">供应商是否是生产商:</span>
  155. <span class="c-#333 f-w-600">{{ selectDictLabel(yes_no, form?.supplierProducerFlag) || '-' }}</span>
  156. </view>
  157. <view v-if="['2', '3'].includes(form?.seedSource as string)" class="f-s-30 pd2-16-0 info-border-bottom">
  158. <span class="c-#666">生产商:</span>
  159. <span class="c-#333 f-w-600">{{ form?.producer || '-' }}</span>
  160. </view>
  161. <view v-if="['A4', 'A8'].includes(form?.seedType as string)" class="f-s-30 pd2-16-0 info-border-bottom">
  162. <span class="c-#666">{{ selectDictLabel(pt_seed_type, form?.seedType as string) }}编号:</span>
  163. <span class="c-#333 f-w-600">{{ selectDictLabel(pt_fungus_code_type, form?.fungusCodeType) }}/{{ form?.fungusCode }}</span>
  164. </view>
  165. <view class="f-s-30 pd2-16-0 info-border-bottom" v-if="form?.instoreBizInfo?.idFlag">
  166. <span class="c-#666">是否有个体标识:</span>
  167. <span class="c-#333 f-w-600">{{ selectDictLabel(yes_no, form?.instoreBizInfo?.idFlag) || '-' }}</span>
  168. </view>
  169. <view v-if="form?.instoreBizInfo?.animals && form?.instoreBizInfo?.animals.length" class="f-s-30 pd2-16-0 info-border-bottom">
  170. <view class="c-#666 mb-10">个体标识号:</view>
  171. <template v-for="(animal, index) in form?.instoreBizInfo?.animals" :key="index">
  172. <view class="bg-#FBFDFB card-info-block pd-24 p-rtv mb-10 f-s-28 c-#333 f-w-500">
  173. {{ animal.animalId }}
  174. </view>
  175. </template>
  176. </view>
  177. <view v-if="form?.instoreBizInfo?.storageMethod" class="f-s-30 pd2-16-0 info-border-bottom">
  178. <span class="c-#666">保藏方法:</span>
  179. <span class="c-#333 f-w-600">{{ form?.instoreBizInfo?.storageMethod || '-' }}</span>
  180. </view>
  181. <view v-if="form?.imgs" class="f-s-30 pd2-16-0 info-border-bottom">
  182. <view class="c-#666 mb-10">种源图片:</view>
  183. <ut-album :urls="form?.imgs"></ut-album>
  184. </view>
  185. <view v-if="form?.vedios" class="f-s-30 pd2-16-0 info-border-bottom">
  186. <view class="c-#666 mb-10">种源视频:</view>
  187. <ut-album :urls="form?.vedios"></ut-album>
  188. </view>
  189. <view class="f-s-30 pd2-16-0 info-border-bottom">
  190. <span class="c-#666">种源产地:</span>
  191. <span class="c-#333 f-w-600">{{ form?.adcodeName || '-' }}</span>
  192. </view>
  193. <view class="f-s-30 pd2-16-0 info-border-bottom">
  194. <span class="c-#666">繁殖材料:</span>
  195. <span class="c-#333 f-w-600">{{ form?.generationMaterial ? selectDictLabels(pt_breeding_materials, form?.generationMaterial, ',') : '-' }}</span>
  196. </view>
  197. <view class="f-s-30 pd2-16-0 info-border-bottom">
  198. <span class="c-#666">繁殖地点/采集地点:</span>
  199. <span class="c-#333 f-w-600">{{ form?.generationAdcodeName || '-' }}</span>
  200. </view>
  201. <view v-if="form?.spCert && form?.spCert.length" class="f-s-30 pd2-16-0 info-border-bottom">
  202. <view class="c-#666 mb-10">物种鉴定证书:</view>
  203. <ut-album :urls="form?.spCert"></ut-album>
  204. </view>
  205. <view class="f-s-30 pd2-16-0 info-border-bottom">
  206. <span class="c-#666">种源检疫证号:</span>
  207. <span class="c-#333 f-w-600">{{ form?.seedCheckSn || '-' }}</span>
  208. </view>
  209. <view v-if="form?.seedCheckCert && form?.seedCheckCert.length" class="f-s-30 pd2-16-0 info-border-bottom">
  210. <view class="c-#666 mb-10">种源检疫证书:</view>
  211. <ut-album :urls="form?.seedCheckCert"></ut-album>
  212. </view>
  213. </view>
  214. <view class="pd-24">
  215. <view class="startline-title">入库信息</view>
  216. </view>
  217. <view class="bg-#fff pd-24">
  218. <view class="f-s-30 pd2-16-0 info-border-bottom">
  219. <span class="c-#666">种源级别:</span>
  220. <span class="c-#333 f-w-600">{{ form?.seedLevel || '-' }}</span>
  221. </view>
  222. <view class="f-s-30 pd2-16-0 info-border-bottom">
  223. <span class="c-#666">入库类型:</span>
  224. <span class="c-#333 f-w-600">{{ selectDictLabel(pt_seed_instore_type, form?.instoreType) || '-' }}</span>
  225. </view>
  226. <view class="f-s-30 pd2-16-0 info-border-bottom">
  227. <span class="c-#666">入库日期:</span>
  228. <span class="c-#333 f-w-600">{{ form?.instoreBizInfo?.instoreDate || '-' }}</span>
  229. </view>
  230. <view class="f-s-30 pd2-16-0 info-border-bottom">
  231. <span class="c-#666">入库批号:</span>
  232. <span class="c-#333 f-w-600">{{ form?.batchCode || '-' }}</span>
  233. </view>
  234. <view class="f-s-30 pd2-16-0 info-border-bottom">
  235. <span class="c-#666">库房类型:</span>
  236. <span class="c-#333 f-w-600">种源库</span>
  237. </view>
  238. <view class="f-s-30 pd2-16-0 info-border-bottom">
  239. <span class="c-#666">存放库房:</span>
  240. <span class="c-#333 f-w-600">{{ selectDictLabel(pt_warehouse_type, form?.warehouseType) || '-' }}</span>
  241. </view>
  242. <view class="f-s-30 pd2-16-0 info-border-bottom">
  243. <span class="c-#666">入库人:</span>
  244. <span class="c-#333 f-w-600">{{ form?.instoreBizInfo?.instoreMg || '-' }}</span>
  245. </view>
  246. <view class="f-s-30 pd2-16-0 info-border-bottom">
  247. <span class="c-#666">入库备注:</span>
  248. <span class="c-#333 f-w-600">{{ form?.instoreBizInfo?.remark || '-' }}</span>
  249. </view>
  250. <view class="f-s-30 pd2-16-0 info-border-bottom">
  251. <span class="c-#666">最后修改人:</span>
  252. <span class="c-#333 f-w-600">{{ form?.operatorName || form?.updateByName || form?.createByName || '-' }}</span>
  253. </view>
  254. <view class="f-s-30 pd2-16-0 info-border-bottom">
  255. <span class="c-#666">最后修改时间:</span>
  256. <span class="c-#333 f-w-600">{{ form?.operateTime || form?.updateTime || form?.createTime || '-' }}</span>
  257. </view>
  258. </view>
  259. </template>
  260. <template #bottom>
  261. <view class="pd-24 d-flex a-c">
  262. <up-button type="primary" @click="clickEdit">修改</up-button>
  263. </view>
  264. </template>
  265. </z-paging>
  266. </template>
  267. <script setup lang="ts">
  268. import { formItemBtnStyle } from '@/assets/styles/uview-plus';
  269. import { useClientRequest } from '@/utils/request';
  270. import { selectDictListClass } from '@/utils/ruoyi';
  271. const { proxy } = getCurrentInstance() as ComponentInternalInstance;
  272. const { pt_seed_instore_type, pt_warehouse_type, pt_seed_type, pt_seed_source, pt_materail_unit, pt_mother_father_flag, pt_op_method, pt_seed_unit, pt_fungus_code_type, pt_breeding_materials, yes_no, pt_cus_type, pt_cpy_type, pt_gen_unit } = toRefs<any>(proxy?.useDict('pt_seed_instore_type', 'pt_warehouse_type', 'pt_seed_type', 'pt_seed_source', 'pt_materail_unit', 'pt_mother_father_flag', 'pt_op_method', 'pt_seed_unit', 'pt_fungus_code_type', 'pt_breeding_materials', 'yes_no', 'pt_cus_type', 'pt_cpy_type', 'pt_gen_unit'));
  273. const paging = ref<any>(null);
  274. const form = ref<any>({});
  275. const did = ref('');
  276. // 繁衍世代显示文案
  277. const genCountMap = reactive({
  278. A4: '累计扩繁代数',
  279. A3: '继代培养次数',
  280. });
  281. // 获取详情(仓库信息)
  282. const getDetailById = async (id: string) => {
  283. if (!id) return;
  284. const res = await useClientRequest.get(`/plt-api/app/storageSeed/getById/${id}`);
  285. if (res && res.code === 200) {
  286. form.value = res.data || {};
  287. }
  288. };
  289. const onRefresh = () => {
  290. getDetailById(did.value);
  291. paging.value?.complete();
  292. };
  293. const clickEdit = () => {
  294. uni.$on('seed-source-detail-refresh', () => {
  295. getDetailById(did.value);
  296. uni.$off('seed-source-detail-refresh');
  297. });
  298. uni.$u.route({
  299. type: 'navigateTo',
  300. url: '/plant/storage/seed-source/info-update/index',
  301. params: {
  302. id: did.value,
  303. },
  304. });
  305. };
  306. // 页面入参解析并加载
  307. onLoad((options: any) => {
  308. did.value = options?.id || '';
  309. getDetailById(did.value);
  310. });
  311. </script>
  312. <style lang="scss" scoped>
  313. .card-info-block {
  314. border: 1rpx solid #afddbb;
  315. border-radius: 10rpx;
  316. }
  317. .li-item-head {
  318. margin-left: -24rpx;
  319. margin-top: -24rpx;
  320. }
  321. .li-left-tag {
  322. padding: 6rpx 16rpx;
  323. color: #fff;
  324. border-radius: 0 0 16rpx 0;
  325. font-size: 20rpx;
  326. font-weight: 500;
  327. }
  328. </style>