index.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316
  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 v-if="form?.partName" class="f-s-24 c-#666">{{ form?.partName }}</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 v-if="form?.supplierId" class="pd2-4-0 f-s-28">
  33. <span class="c-#666">供应商:</span>
  34. <span class="c-#333 f-w-500">{{ form?.supplierInfo?.cusName || '-' }}</span>
  35. </view>
  36. </template>
  37. <template v-if="form?.instoreType == '3'">
  38. <view class="pd2-4-0 f-s-28">
  39. <span class="c-#666">采收批号:</span>
  40. <span class="c-#333 f-w-500">{{ form?.harvestInfo?.harvestCode || '-' }}</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">
  45. {{ form?.harvestInfo?.baseInfo?.baseName || '-' }}
  46. </span>
  47. </view>
  48. </template>
  49. <view v-if="form?.warehouses?.length" class="pd2-4-0 f-s-28">
  50. <span class="c-#666">存放库房:</span>
  51. <span class="c-#333 f-w-500">{{ getStorageRoomNames(form?.warehouses) || '-' }}</span>
  52. </view>
  53. <view class="pd2-4-0 f-s-28">
  54. <span class="c-#666">入库量:</span>
  55. <span class="c-#333 f-w-500">{{ form?.capacity }}{{ form?.unit }}</span>
  56. </view>
  57. <view class="d-flex">
  58. <view v-if="form?.inputAmount" class="pd2-4-0 f-s-28 flex1">
  59. <span class="c-#666">出库量:</span>
  60. <span class="c-#333 f-w-500">{{ form?.inputAmount || '0' }}{{ form?.unit }}</span>
  61. </view>
  62. <view v-if="form?.restAmount" class="pd2-4-0 f-s-28 flex1">
  63. <span class="c-primary">剩余量:</span>
  64. <span class="c-primary f-w-500">{{ form?.restAmount || '0' }}{{ form?.unit }}</span>
  65. </view>
  66. </view>
  67. <view v-if="+form?.restAmount" class="pd3-20-40-0">
  68. <up-button @click="navigateToInventoryLoss" type="warning" plain :customStyle="{ background: '#FFF9EF', borderColor: '#F9D9A3' }">库存有消耗?库存损耗登记{{ '>' }}</up-button>
  69. </view>
  70. </view>
  71. <view class="pd-24">
  72. <view class="startline-title">采收信息</view>
  73. </view>
  74. <view class="bg-#fff pd-24" v-if="form?.harvestInfo">
  75. <view class="f-s-30 pd2-16-0 info-border-bottom">
  76. <span class="c-#666">采收日期:</span>
  77. <span class="c-#333 f-w-600">{{ form?.harvestInfo?.harvestDate || '-' }}至{{ form?.harvestInfo?.harvestDateEnd || '-' }}</span>
  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">
  82. {{ form?.harvestInfo?.harvestCode || '-' }}
  83. </span>
  84. </view>
  85. <!-- 基地挖坑 -->
  86. <view class="f-s-30 pd2-16-0 info-border-bottom">
  87. <span class="c-#666">种源加工处理工艺:</span>
  88. <span class="c-#333 f-w-600">
  89. {{ form?.harvestInfo?.ptech ? form?.harvestInfo?.ptech.replace(/,/g, '→') : '-' }}
  90. </span>
  91. </view>
  92. </view>
  93. <view class="pd-24">
  94. <view class="startline-title">鲜货信息</view>
  95. </view>
  96. <view class="bg-#fff pd-24">
  97. <!-- 鲜货信息详情 -->
  98. <view class="f-s-30 pd2-16-0 info-border-bottom">
  99. <view class="c-#666 mb-10">动植物名称:</view>
  100. <view v-if="form?.varietyInfo" class="bg-#FBFDFB card-info-block pd-24 p-rtv">
  101. <view class="mb-10">
  102. <span class="f-s-34 c-#333 f-w-5 mr-16">{{ form?.varietyInfo?.varietyName || '-' }}</span>
  103. <span class="f-s-24 c-#666">{{ form?.varietyInfo?.latinName || '' }}</span>
  104. </view>
  105. <view class="mb-10">
  106. <span class="f-s-28 c-#333 f-w-5 mr-16">{{ form?.varietyInfo?.genusName || '' }}</span>
  107. <span class="f-s-24 c-#666">{{ form?.varietyInfo?.genusLatinName || '' }}</span>
  108. </view>
  109. <view class="f-s-24 c-#666" v-if="form?.varietyInfo?.medicineName">产出:{{ form?.varietyInfo?.medicineName }}</view>
  110. </view>
  111. <view v-else class="c-#333 f-w-600">{{ form?.variety || '-' }}</view>
  112. </view>
  113. <view class="f-s-30 pd2-16-0 info-border-bottom">
  114. <span class="c-#666">药用部位/对象:</span>
  115. <span class="c-#333 f-w-600">{{ form?.partName || form?.part || '-' }}</span>
  116. </view>
  117. <view class="f-s-30 pd2-16-0 info-border-bottom">
  118. <span class="c-#666">鲜货来源:</span>
  119. <span class="c-#333 f-w-600">{{ selectDictLabel(pt_medicine_source_tag, form?.sourceType) || '-' }}</span>
  120. </view>
  121. <view class="f-s-30 pd2-16-0 info-border-bottom">
  122. <span class="c-#666">入库量:</span>
  123. <span class="c-#333 f-w-600">{{ form?.capacity || '-' }}{{ selectDictLabel(pt_medicine_unit, form?.unit) || form?.unit || '' }}</span>
  124. </view>
  125. <view class="f-s-30 pd2-16-0 info-border-bottom">
  126. <span class="c-#666">鲜货产地:</span>
  127. <span class="c-#333 f-w-600">{{ form?.producePlaceName || form?.producePlace || '-' }}</span>
  128. </view>
  129. <view class="f-s-30 pd2-16-0 info-border-bottom">
  130. <span class="c-#666">采收日期:</span>
  131. <span class="c-#333 f-w-600">{{ form?.productDate || '-' }}</span>
  132. </view>
  133. <template v-if="['2'].includes(form?.sourceType as string)">
  134. <view class="f-s-30 pd2-16-0 info-border-bottom">
  135. <span class="c-#666">供应商:</span>
  136. <span class="c-#333 f-w-600">{{ form?.supplier || form?.supplierInfo?.cusName || '-' }}</span>
  137. </view>
  138. <view class="f-s-30 pd2-16-0 info-border-bottom">
  139. <span class="c-#666">供应商是否是生产商:</span>
  140. <span class="c-#333 f-w-600">{{ selectDictLabel(yes_no, form?.supplierProducerFlag) || '-' }}</span>
  141. </view>
  142. <view class="f-s-30 pd2-16-0 info-border-bottom">
  143. <span class="c-#666">生产商:</span>
  144. <span class="c-#333 f-w-600">{{ form?.producer || '-' }}</span>
  145. </view>
  146. </template>
  147. <view v-if="form?.imgs" class="f-s-30 pd2-16-0 info-border-bottom">
  148. <view class="c-#666 mb-10">鲜货图片:</view>
  149. <ut-album :urls="form?.imgs"></ut-album>
  150. </view>
  151. <view v-if="form?.vedios" class="f-s-30 pd2-16-0 info-border-bottom">
  152. <view class="c-#666 mb-10">鲜货视频:</view>
  153. <ut-album :urls="form?.vedios"></ut-album>
  154. </view>
  155. <view v-if="form?.examinReport && form?.examinReport.length" class="f-s-30 pd2-16-0 info-border-bottom">
  156. <view class="c-#666 mb-10">检验报告:</view>
  157. <ut-album :urls="form?.examinReport"></ut-album>
  158. </view>
  159. </view>
  160. <view class="pd-24">
  161. <view class="startline-title">入库信息</view>
  162. </view>
  163. <view class="bg-#fff pd-24">
  164. <view class="f-s-30 pd2-16-0 info-border-bottom">
  165. <span class="c-#666">鲜货级别:</span>
  166. <span class="c-#333 f-w-600">{{ form?.level || '-' }}</span>
  167. </view>
  168. <view class="f-s-30 pd2-16-0 info-border-bottom">
  169. <span class="c-#666">入库类型:</span>
  170. <span class="c-#333 f-w-600">{{ selectDictLabel(pt_seed_instore_type, form?.instoreType) || '-' }}</span>
  171. </view>
  172. <template v-if="form.instoreType == '2'">
  173. <view 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?.instoreBizInfo?.instoreDate || '-' }}</span>
  176. </view>
  177. <view 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?.batchCode || '-' }}</span>
  180. </view>
  181. </template>
  182. <view class="f-s-30 pd2-16-0 info-border-bottom">
  183. <span class="c-#666">库房类型:</span>
  184. <span class="c-#333 f-w-600">鲜货库</span>
  185. </view>
  186. <view v-if="form?.warehouses?.length" class="pd2-4-0 f-s-28">
  187. <span class="c-#666">存放库房:</span>
  188. <span class="c-#333 f-w-500">{{ getStorageRoomNames(form?.warehouses) || '-' }}</span>
  189. </view>
  190. <view class="f-s-30 pd2-16-0 info-border-bottom">
  191. <span class="c-#666">入库人:</span>
  192. <span class="c-#333 f-w-600">{{ form?.instoreBizInfo?.instoreMg || '-' }}</span>
  193. </view>
  194. <view class="f-s-30 pd2-16-0 info-border-bottom">
  195. <span class="c-#666">入库备注:</span>
  196. <span class="c-#333 f-w-600">{{ form?.instoreBizInfo?.remark || '-' }}</span>
  197. </view>
  198. <view class="f-s-30 pd2-16-0 info-border-bottom">
  199. <span class="c-#666">最后修改人:</span>
  200. <span class="c-#333 f-w-600">{{ form?.operatorName || form?.updateByName || form?.createByName || '-' }}</span>
  201. </view>
  202. <view class="f-s-30 pd2-16-0 info-border-bottom">
  203. <span class="c-#666">最后修改时间:</span>
  204. <span class="c-#333 f-w-600">{{ form?.operateTime || form?.updateTime || form?.createTime || '-' }}</span>
  205. </view>
  206. </view>
  207. </template>
  208. <template #bottom>
  209. <view class="pd-24 d-flex a-c">
  210. <up-button type="primary" @click="clickEdit">修改</up-button>
  211. </view>
  212. </template>
  213. </z-paging>
  214. </template>
  215. <script setup lang="ts">
  216. import { formItemBtnStyle } from '@/assets/styles/uview-plus';
  217. import { getStorageRoomNames } from '@/utils/common';
  218. import { useClientRequest } from '@/utils/request';
  219. import { selectDictListClass } from '@/utils/ruoyi';
  220. const { proxy } = getCurrentInstance() as ComponentInternalInstance;
  221. const { pt_seed_instore_type, yes_no, pt_medicine_source_tag, pt_medicine_unit } = toRefs<any>(proxy?.useDict('pt_seed_instore_type', 'yes_no', 'pt_medicine_source_tag', 'pt_medicine_unit'));
  222. const paging = ref<any>(null);
  223. const form = ref<any>({});
  224. const did = ref('');
  225. // 繁衍世代显示文案
  226. const genCountMap = reactive({
  227. A4: '累计扩繁代数',
  228. A3: '继代培养次数',
  229. });
  230. // 获取详情(仓库信息)
  231. const getDetailById = async (id: string) => {
  232. if (!id) return;
  233. const res = await useClientRequest.get(`/plt-api/app/storage/getInfo/${id}`);
  234. if (res && res.code === 200) {
  235. form.value = res.data || {};
  236. }
  237. };
  238. const navigateToInOutRecords = () => {
  239. uni.$u.route({
  240. type: 'navigateTo',
  241. url: '/plant/storage/stock-list/index',
  242. params: {
  243. id: did.value,
  244. stockType: '4',
  245. },
  246. });
  247. };
  248. const navigateToInventoryLoss = () => {
  249. uni.$on('storage-registered', () => {
  250. getDetailById(did.value);
  251. uni.$emit('refreshStorageRoomList');
  252. uni.$off('storage-registered');
  253. });
  254. uni.navigateTo({
  255. url: '/plant/storage/loss-register/index',
  256. success: (res) => {
  257. res.eventChannel.emit('storage-data', {
  258. stockType: '4',
  259. ...form.value,
  260. });
  261. },
  262. });
  263. };
  264. const onRefresh = () => {
  265. getDetailById(did.value);
  266. paging.value?.complete();
  267. };
  268. const clickEdit = () => {
  269. uni.$on('fresh-goods-detail-refresh', () => {
  270. getDetailById(did.value);
  271. uni.$off('fresh-goods-detail-refresh');
  272. });
  273. uni.$u.route({
  274. type: 'navigateTo',
  275. url: '/plant/storage/fresh-goods/info-update/index',
  276. params: {
  277. id: did.value,
  278. },
  279. });
  280. };
  281. // 页面入参解析并加载
  282. onLoad((options: any) => {
  283. did.value = options?.id || '';
  284. getDetailById(did.value);
  285. });
  286. </script>
  287. <style lang="scss" scoped>
  288. .card-info-block {
  289. border: 1rpx solid #afddbb;
  290. border-radius: 10rpx;
  291. }
  292. .li-item-head {
  293. margin-left: -24rpx;
  294. margin-top: -24rpx;
  295. }
  296. .li-left-tag {
  297. padding: 6rpx 16rpx;
  298. color: #fff;
  299. border-radius: 0 0 16rpx 0;
  300. font-size: 20rpx;
  301. font-weight: 500;
  302. }
  303. </style>