index.vue 23 KB

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