index.vue 21 KB

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