index.vue 13 KB

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