index.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294
  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 }">{{ 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?.level || '' }}{{ 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">
  75. <!-- 鲜货信息详情 -->
  76. <view class="f-s-30 pd2-16-0 info-border-bottom">
  77. <view class="c-#666 mb-10">动植物名称:</view>
  78. <view v-if="form?.varietyInfo" class="bg-#FBFDFB card-info-block pd-24 p-rtv">
  79. <view class="mb-10">
  80. <span class="f-s-34 c-#333 f-w-5 mr-16">{{ form?.varietyInfo?.varietyName || '-' }}</span>
  81. <span class="f-s-24 c-#666">{{ form?.varietyInfo?.latinName || '' }}</span>
  82. </view>
  83. <view class="mb-10">
  84. <span class="f-s-28 c-#333 f-w-5 mr-16">{{ form?.varietyInfo?.genusName || '' }}</span>
  85. <span class="f-s-24 c-#666">{{ form?.varietyInfo?.genusLatinName || '' }}</span>
  86. </view>
  87. <view class="f-s-24 c-#666" v-if="form?.varietyInfo?.medicineName">产出:{{ form?.varietyInfo?.medicineName }}</view>
  88. </view>
  89. <view v-else class="c-#333 f-w-600">{{ form?.variety || '-' }}</view>
  90. </view>
  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?.partName || form?.part || '-' }}</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">{{ selectDictLabel(pt_medicine_source_tag, form?.sourceType) || '-' }}</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">{{ form?.capacity || '-' }}{{ selectDictLabel(pt_medicine_unit, form?.unit) || form?.unit || '' }}</span>
  102. </view>
  103. <view class="f-s-30 pd2-16-0 info-border-bottom">
  104. <span class="c-#666">鲜货产地:</span>
  105. <span class="c-#333 f-w-600">{{ form?.producePlaceName || form?.producePlace || '-' }}</span>
  106. </view>
  107. <view v-if="form?.instoreType == '2'" class="f-s-30 pd2-16-0 info-border-bottom">
  108. <span class="c-#666">采收日期:</span>
  109. <span class="c-#333 f-w-600">{{ form?.productDate || '-' }}~{{ form?.productDateEnd || '-' }}</span>
  110. </view>
  111. <template v-if="['2'].includes(form?.sourceType as string)">
  112. <view class="f-s-30 pd2-16-0 info-border-bottom">
  113. <span class="c-#666">供应商:</span>
  114. <span class="c-#333 f-w-600">{{ form?.supplier || form?.supplierInfo?.cusName || '-' }}</span>
  115. </view>
  116. <view class="f-s-30 pd2-16-0 info-border-bottom">
  117. <span class="c-#666">供应商是否是生产商:</span>
  118. <span class="c-#333 f-w-600">{{ selectDictLabel(yes_no, form?.supplierProducerFlag) || '-' }}</span>
  119. </view>
  120. <view class="f-s-30 pd2-16-0 info-border-bottom">
  121. <span class="c-#666">生产商:</span>
  122. <span class="c-#333 f-w-600">{{ form?.producer || '-' }}</span>
  123. </view>
  124. </template>
  125. <view v-if="form?.imgs" class="f-s-30 pd2-16-0 info-border-bottom">
  126. <view class="c-#666 mb-10">鲜货图片:</view>
  127. <ut-album :urls="form?.imgs"></ut-album>
  128. </view>
  129. <view v-if="form?.vedios" class="f-s-30 pd2-16-0 info-border-bottom">
  130. <view class="c-#666 mb-10">鲜货视频:</view>
  131. <ut-album :urls="form?.vedios"></ut-album>
  132. </view>
  133. <view v-if="form?.examinReport && form?.examinReport.length" class="f-s-30 pd2-16-0 info-border-bottom">
  134. <view class="c-#666 mb-10">检验报告:</view>
  135. <ut-album :urls="form?.examinReport"></ut-album>
  136. </view>
  137. </view>
  138. <view class="pd-24">
  139. <view class="startline-title">入库信息</view>
  140. </view>
  141. <view class="bg-#fff pd-24">
  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?.level || '-' }}</span>
  145. </view>
  146. <view class="f-s-30 pd2-16-0 info-border-bottom">
  147. <span class="c-#666">入库类型:</span>
  148. <span class="c-#333 f-w-600">{{ selectDictLabel(pt_seed_instore_type, form?.instoreType) || '-' }}</span>
  149. </view>
  150. <template v-if="form.instoreType == '2'">
  151. <view class="f-s-30 pd2-16-0 info-border-bottom">
  152. <span class="c-#666">入库日期:</span>
  153. <span class="c-#333 f-w-600">{{ form?.instoreBizInfo?.instoreDate || '-' }}</span>
  154. </view>
  155. <view class="f-s-30 pd2-16-0 info-border-bottom">
  156. <span class="c-#666">入库批号:</span>
  157. <span class="c-#333 f-w-600">{{ form?.batchCode || '-' }}</span>
  158. </view>
  159. </template>
  160. <view class="f-s-30 pd2-16-0 info-border-bottom">
  161. <span class="c-#666">库房类型:</span>
  162. <span class="c-#333 f-w-600">鲜货库</span>
  163. </view>
  164. <view v-if="form?.warehouses?.length" class="pd2-4-0 f-s-28">
  165. <span class="c-#666">存放库房:</span>
  166. <span class="c-#333 f-w-500">{{ getStorageRoomNames(form?.warehouses) || '-' }}</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">{{ form?.instoreBizInfo?.instoreMg || '-' }}</span>
  171. </view>
  172. <view class="f-s-30 pd2-16-0 info-border-bottom">
  173. <span class="c-#666">入库备注:</span>
  174. <span class="c-#333 f-w-600">{{ form?.instoreBizInfo?.remark || '-' }}</span>
  175. </view>
  176. <view class="f-s-30 pd2-16-0 info-border-bottom">
  177. <span class="c-#666">最后修改人:</span>
  178. <span class="c-#333 f-w-600">{{ form?.operatorName || form?.updateByName || form?.createByName || '-' }}</span>
  179. </view>
  180. <view class="f-s-30 pd2-16-0 info-border-bottom">
  181. <span class="c-#666">最后修改时间:</span>
  182. <span class="c-#333 f-w-600">{{ form?.operateTime || form?.updateTime || form?.createTime || '-' }}</span>
  183. </view>
  184. </view>
  185. </template>
  186. <template #bottom>
  187. <view class="pd-24 d-flex a-c">
  188. <up-button type="primary" @click="clickEdit">修改</up-button>
  189. </view>
  190. </template>
  191. </z-paging>
  192. </template>
  193. <script setup lang="ts">
  194. import { formItemBtnStyle } from '@/assets/styles/uview-plus';
  195. import { getStorageRoomNames } from '@/utils/common';
  196. import { useClientRequest } from '@/utils/request';
  197. import { selectDictListClass } from '@/utils/ruoyi';
  198. const { proxy } = getCurrentInstance() as ComponentInternalInstance;
  199. 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'));
  200. const paging = ref<any>(null);
  201. const form = ref<any>({});
  202. const did = ref('');
  203. // 繁衍世代显示文案
  204. const genCountMap = reactive({
  205. A4: '累计扩繁代数',
  206. A3: '继代培养次数',
  207. });
  208. // 获取详情(仓库信息)
  209. const getDetailById = async (id: string) => {
  210. if (!id) return;
  211. const res = await useClientRequest.get(`/plt-api/app/storage/getInfo/${id}`);
  212. if (res && res.code === 200) {
  213. form.value = res.data || {};
  214. }
  215. };
  216. const navigateToInOutRecords = () => {
  217. uni.$u.route({
  218. type: 'navigateTo',
  219. url: '/plant/storage/stock-list/index',
  220. params: {
  221. id: did.value,
  222. stockType: '4',
  223. },
  224. });
  225. };
  226. const navigateToInventoryLoss = () => {
  227. uni.$on('storage-registered', () => {
  228. getDetailById(did.value);
  229. uni.$emit('refreshStorageRoomList');
  230. uni.$off('storage-registered');
  231. });
  232. uni.navigateTo({
  233. url: '/plant/storage/loss-register/index',
  234. success: (res) => {
  235. res.eventChannel.emit('storage-data', {
  236. stockType: '4',
  237. ...form.value,
  238. });
  239. },
  240. });
  241. };
  242. const onRefresh = () => {
  243. getDetailById(did.value);
  244. paging.value?.complete();
  245. };
  246. const clickEdit = () => {
  247. uni.$on('fresh-goods-detail-refresh', () => {
  248. getDetailById(did.value);
  249. uni.$off('fresh-goods-detail-refresh');
  250. });
  251. uni.$u.route({
  252. type: 'navigateTo',
  253. url: '/plant/storage/fresh-goods/info-update/index',
  254. params: {
  255. id: did.value,
  256. },
  257. });
  258. };
  259. // 页面入参解析并加载
  260. onLoad((options: any) => {
  261. did.value = options?.id || '';
  262. getDetailById(did.value);
  263. });
  264. </script>
  265. <style lang="scss" scoped>
  266. .card-info-block {
  267. border: 1rpx solid #afddbb;
  268. border-radius: 10rpx;
  269. }
  270. .li-item-head {
  271. margin-left: -24rpx;
  272. margin-top: -24rpx;
  273. }
  274. .li-left-tag {
  275. padding: 6rpx 16rpx;
  276. color: #fff;
  277. border-radius: 0 0 16rpx 0;
  278. font-size: 20rpx;
  279. font-weight: 500;
  280. }
  281. </style>