index.vue 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361
  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-${selectDictListClass(pt_seed_instore_type, form?.instoreType)}`]: true }">{{ 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. <view class="pd2-4-0 f-s-28">
  28. <span class="c-#666">入库批号:</span>
  29. <span class="c-#333 f-w-500">{{ form?.batchCode }}</span>
  30. </view>
  31. <view v-if="['A3', 'A4'].includes(form?.fungusCodeType)" class="pd2-4-0 f-s-28">
  32. <span class="c-#666">菌种/菌株编号:</span>
  33. <span class="c-#333 f-w-500">{{ selectDictLabel(pt_fungus_code_type, form?.fungusCodeType) }}/{{ form?.fungusCode }}</span>
  34. </view>
  35. <view class="pd2-4-0 f-s-28">
  36. <span class="c-#666">供应商:</span>
  37. <span class="c-#333 f-w-500">{{ form?.supplier }}</span>
  38. </view>
  39. <view v-if="form?.warehouses?.length" class="pd2-4-0 f-s-28">
  40. <span class="c-#666">存放库房:</span>
  41. <span class="c-#333 f-w-500">{{ getStorageRoomNames(form?.warehouses) || '-' }}</span>
  42. </view>
  43. <view class="pd2-4-0 f-s-28">
  44. <span class="c-#666">入库量:</span>
  45. <span class="c-#333 f-w-500">{{ form?.capacity }}{{ form?.unit }}</span>
  46. </view>
  47. <view class="d-flex">
  48. <view v-if="form?.restAmount" class="pd2-4-0 f-s-28 flex1">
  49. <span class="c-#666">出库量:</span>
  50. <span class="c-#333 f-w-500">{{ form?.inputAmount || '0' }}{{ form?.unit }}</span>
  51. </view>
  52. <view v-if="form?.restAmount" class="pd2-4-0 f-s-28 flex1">
  53. <span class="c-primary">剩余量:</span>
  54. <span class="c-primary f-w-500">{{ form?.restAmount || '0' }}{{ form?.unit }}</span>
  55. </view>
  56. </view>
  57. <view v-if="+form?.restAmount" class="pd3-20-40-0">
  58. <up-button @click="navigateToInventoryLoss" type="warning" plain :customStyle="{ background: '#FFF9EF', borderColor: '#F9D9A3' }">库存有消耗?库存损耗登记{{ '>' }}</up-button>
  59. </view>
  60. </view>
  61. <view class="pd-24">
  62. <view class="startline-title">鲜货信息</view>
  63. </view>
  64. <view class="bg-#fff pd-24">
  65. <!-- 鲜货信息详情 -->
  66. <view class="f-s-30 pd2-16-0 info-border-bottom">
  67. <span class="c-#666">鲜货类型:</span>
  68. <span class="c-#333 f-w-600">{{ selectDictLabel(pt_seed_type, form?.seedType) || '-' }}</span>
  69. </view>
  70. <view class="f-s-30 pd2-16-0 info-border-bottom">
  71. <view class="c-#666 mb-10">物种基原:</view>
  72. <view class="bg-#FBFDFB card-info-block pd-24 p-rtv">
  73. <view class="mb-10">
  74. <span class="f-s-34 c-#333 f-w-5 mr-16">{{ form?.varietyInfo?.varietyName }}</span>
  75. <span class="f-s-24 c-#666">{{ form?.varietyInfo?.latinName }}</span>
  76. </view>
  77. <view>
  78. <span class="f-s-28 c-#333 f-w-5 mr-16">{{ form?.varietyInfo?.genusName }}</span>
  79. <span class="f-s-24 c-#666">{{ form?.varietyInfo?.genusLatinName }}</span>
  80. </view>
  81. </view>
  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">{{ form?.seedName || '-' }}</span>
  86. </view>
  87. <view class="f-s-30 pd2-16-0 info-border-bottom">
  88. <span class="c-#666">鲜货来源:</span>
  89. <span class="c-#333 f-w-600">{{ selectDictLabel(pt_seed_source, form?.seedSource) || '-' }}</span>
  90. </view>
  91. <view class="f-s-30 pd2-16-0 info-border-bottom" v-if="form?.instoreBizInfo?.motherFatherFlag">
  92. <span class="c-#666">父母本情况:</span>
  93. <span class="c-#333 f-w-600">{{ selectDictLabel(pt_mother_father_flag, form?.instoreBizInfo?.motherFatherFlag) || '-' }}</span>
  94. </view>
  95. <view v-if="form?.instoreBizInfo?.motherFatherFlag == '2' && form?.instoreBizInfo?.fatherVarietyInfo" class="f-s-30 pd2-16-0 info-border-bottom">
  96. <view class="c-#666 mb-10">父本品种:</view>
  97. <view class="bg-#FBFDFB card-info-block pd-24 p-rtv">
  98. <view class="mb-10">
  99. <span class="f-s-34 c-#333 f-w-5 mr-16">{{ form?.instoreBizInfo?.fatherVarietyInfo?.varietyName }}</span>
  100. <span class="f-s-24 c-#666">{{ form?.instoreBizInfo?.fatherVarietyInfo?.latinName }}</span>
  101. </view>
  102. <view>
  103. <span class="f-s-28 c-#333 f-w-5 mr-16">{{ form?.instoreBizInfo?.fatherVarietyInfo?.genusName }}</span>
  104. <span class="f-s-24 c-#666">{{ form?.instoreBizInfo?.fatherVarietyInfo?.genusLatinName }}</span>
  105. </view>
  106. </view>
  107. </view>
  108. <view v-if="form?.instoreBizInfo?.motherVarietyInfo" class="f-s-30 pd2-16-0 info-border-bottom">
  109. <view class="c-#666 mb-10">母本品种:</view>
  110. <view class="bg-#FBFDFB card-info-block pd-24 p-rtv">
  111. <view class="mb-10">
  112. <span class="f-s-34 c-#333 f-w-5 mr-16">{{ form?.instoreBizInfo?.motherVarietyInfo?.varietyName }}</span>
  113. <span class="f-s-24 c-#666">{{ form?.instoreBizInfo?.motherVarietyInfo?.latinName }}</span>
  114. </view>
  115. <view>
  116. <span class="f-s-28 c-#333 f-w-5 mr-16">{{ form?.instoreBizInfo?.motherVarietyInfo?.genusName }}</span>
  117. <span class="f-s-24 c-#666">{{ form?.instoreBizInfo?.motherVarietyInfo?.genusLatinName }}</span>
  118. </view>
  119. </view>
  120. </view>
  121. <template v-if="['A3', 'A4'].includes(form?.seedType as string)">
  122. <view class="f-s-30 pd2-16-0 info-border-bottom">
  123. <span class="c-#666">{{ genCountMap[form?.seedType as 'A3' | 'A4'] }}:</span>
  124. <span class="c-#333 f-w-600">
  125. {{ form?.instoreBizInfo?.genCount || '-' }}
  126. <text v-if="form?.instoreBizInfo?.genUnit">{{ selectDictLabel(pt_gen_unit, form?.instoreBizInfo?.genUnit) }}</text>
  127. </span>
  128. </view>
  129. </template>
  130. <template v-else>
  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">
  134. {{ form?.instoreBizInfo?.genCount || '-' }}
  135. <text v-if="form?.instoreBizInfo?.genUnit">{{ selectDictLabel(pt_gen_unit, form?.instoreBizInfo?.genUnit) }}</text>
  136. </span>
  137. </view>
  138. </template>
  139. <view v-if="form?.entrustId" class="f-s-30 pd2-16-0 info-border-bottom">
  140. <view class="c-#666 mb-10">受托单位:</view>
  141. <view class="bg-#FBFDFB card-info-block pd-24 p-rtv">
  142. <view class="f-s-34 c-#333 f-w-500">{{ form?.entrustInfo?.cusName }}</view>
  143. <view class="f-s-24 c-#666">{{ form?.entrustInfo?.cusCode }}</view>
  144. </view>
  145. </view>
  146. <view v-if="form?.examinReport && form?.examinReport.length" class="f-s-30 pd2-16-0 info-border-bottom">
  147. <view class="c-#666 mb-10">检验报告:</view>
  148. <ut-album :urls="form?.examinReport"></ut-album>
  149. </view>
  150. <view v-if="['2', '3'].includes(form?.seedSource as string)" class="f-s-30 pd2-16-0 info-border-bottom">
  151. <view class="c-#666 mb-10">供应商:</view>
  152. <view class="bg-#FBFDFB card-info-block pd-24 p-rtv">
  153. <view class="f-s-34 c-#333 f-w-500">{{ form?.supplierInfo?.cusName }}</view>
  154. <view class="f-s-24 c-#666">{{ form?.supplierInfo?.cusCode }}</view>
  155. </view>
  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">{{ selectDictLabel(yes_no, form?.supplierProducerFlag) || '-' }}</span>
  160. </view>
  161. <view v-if="['2', '3'].includes(form?.seedSource as string)" class="f-s-30 pd2-16-0 info-border-bottom">
  162. <span class="c-#666">生产商:</span>
  163. <span class="c-#333 f-w-600">{{ form?.producer || '-' }}</span>
  164. </view>
  165. <view v-if="['A4', 'A8'].includes(form?.seedType as string)" class="f-s-30 pd2-16-0 info-border-bottom">
  166. <span class="c-#666">{{ selectDictLabel(pt_seed_type, form?.seedType as string) }}编号:</span>
  167. <span class="c-#333 f-w-600">{{ selectDictLabel(pt_fungus_code_type, form?.fungusCodeType) }}/{{ form?.fungusCode }}</span>
  168. </view>
  169. <view class="f-s-30 pd2-16-0 info-border-bottom" v-if="form?.instoreBizInfo?.idFlag">
  170. <span class="c-#666">是否有个体标识:</span>
  171. <span class="c-#333 f-w-600">{{ selectDictLabel(yes_no, form?.instoreBizInfo?.idFlag) || '-' }}</span>
  172. </view>
  173. <view v-if="form?.instoreBizInfo?.animals && form?.instoreBizInfo?.animals.length" class="f-s-30 pd2-16-0 info-border-bottom">
  174. <view class="c-#666 mb-10">个体标识号:</view>
  175. <template v-for="(animal, index) in form?.instoreBizInfo?.animals" :key="index">
  176. <view class="bg-#FBFDFB card-info-block pd-24 p-rtv mb-10 f-s-28 c-#333 f-w-500">
  177. {{ animal.animalId }}
  178. </view>
  179. </template>
  180. </view>
  181. <view v-if="form?.instoreBizInfo?.storageMethod" class="f-s-30 pd2-16-0 info-border-bottom">
  182. <span class="c-#666">保藏方法:</span>
  183. <span class="c-#333 f-w-600">{{ form?.instoreBizInfo?.storageMethod || '-' }}</span>
  184. </view>
  185. <view v-if="form?.imgs" class="f-s-30 pd2-16-0 info-border-bottom">
  186. <view class="c-#666 mb-10">鲜货图片:</view>
  187. <ut-album :urls="form?.imgs"></ut-album>
  188. </view>
  189. <view v-if="form?.vedios" class="f-s-30 pd2-16-0 info-border-bottom">
  190. <view class="c-#666 mb-10">鲜货视频:</view>
  191. <ut-album :urls="form?.vedios"></ut-album>
  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?.adcodeName || '-' }}</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?.generationMaterial ? selectDictLabels(pt_breeding_materials, form?.generationMaterial, ',') : '-' }}</span>
  200. </view>
  201. <view class="f-s-30 pd2-16-0 info-border-bottom">
  202. <span class="c-#666">繁殖地点/采集地点:</span>
  203. <span class="c-#333 f-w-600">{{ form?.generationAdcodeName || '-' }}</span>
  204. </view>
  205. <view v-if="form?.spCert && form?.spCert.length" class="f-s-30 pd2-16-0 info-border-bottom">
  206. <view class="c-#666 mb-10">物种鉴定证书:</view>
  207. <ut-album :urls="form?.spCert"></ut-album>
  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?.seedCheckSn || '-' }}</span>
  212. </view>
  213. <view v-if="form?.seedCheckCert && form?.seedCheckCert.length" class="f-s-30 pd2-16-0 info-border-bottom">
  214. <view class="c-#666 mb-10">鲜货检疫证书:</view>
  215. <ut-album :urls="form?.seedCheckCert"></ut-album>
  216. </view>
  217. </view>
  218. <view class="pd-24">
  219. <view class="startline-title">入库信息</view>
  220. </view>
  221. <view class="bg-#fff pd-24">
  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 v-if="form?.warehouses?.length" class="pd2-4-0 f-s-28">
  239. <span class="c-#666">存放库房:</span>
  240. <span class="c-#333 f-w-500">{{ getStorageRoomNames(form?.warehouses) || '-' }}</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 { getStorageRoomNames } from '@/utils/common';
  270. import { useClientRequest } from '@/utils/request';
  271. import { selectDictListClass } from '@/utils/ruoyi';
  272. const { proxy } = getCurrentInstance() as ComponentInternalInstance;
  273. 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'));
  274. const paging = ref<any>(null);
  275. const form = ref<any>({});
  276. const did = ref('');
  277. // 繁衍世代显示文案
  278. const genCountMap = reactive({
  279. A4: '累计扩繁代数',
  280. A3: '继代培养次数',
  281. });
  282. // 获取详情(仓库信息)
  283. const getDetailById = async (id: string) => {
  284. if (!id) return;
  285. const res = await useClientRequest.get(`/plt-api/app/storageSeed/getById/${id}`);
  286. if (res && res.code === 200) {
  287. form.value = res.data || {};
  288. }
  289. };
  290. const navigateToInOutRecords = () => {
  291. uni.$u.route({
  292. type: 'navigateTo',
  293. url: '/plant/storage/stock-list/index',
  294. params: {
  295. id: did.value,
  296. stockType: '2',
  297. },
  298. });
  299. };
  300. const navigateToInventoryLoss = () => {
  301. uni.$on('storage-registered', () => {
  302. getDetailById(did.value);
  303. uni.$emit('refreshStorageRoomList');
  304. uni.$off('storage-registered');
  305. });
  306. uni.navigateTo({
  307. url: '/plant/storage/loss-register/index',
  308. success: (res) => {
  309. res.eventChannel.emit('storage-data', {
  310. stockType: '2',
  311. ...form.value,
  312. });
  313. },
  314. });
  315. };
  316. const onRefresh = () => {
  317. getDetailById(did.value);
  318. paging.value?.complete();
  319. };
  320. const clickEdit = () => {
  321. uni.$on('seed-source-detail-refresh', () => {
  322. getDetailById(did.value);
  323. uni.$off('seed-source-detail-refresh');
  324. });
  325. uni.$u.route({
  326. type: 'navigateTo',
  327. url: '/plant/storage/seed-source/info-update/index',
  328. params: {
  329. id: did.value,
  330. },
  331. });
  332. };
  333. // 页面入参解析并加载
  334. onLoad((options: any) => {
  335. did.value = options?.id || '';
  336. getDetailById(did.value);
  337. });
  338. </script>
  339. <style lang="scss" scoped>
  340. .card-info-block {
  341. border: 1rpx solid #afddbb;
  342. border-radius: 10rpx;
  343. }
  344. .li-item-head {
  345. margin-left: -24rpx;
  346. margin-top: -24rpx;
  347. }
  348. .li-left-tag {
  349. padding: 6rpx 16rpx;
  350. color: #fff;
  351. border-radius: 0 0 16rpx 0;
  352. font-size: 20rpx;
  353. font-weight: 500;
  354. }
  355. </style>