index.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311
  1. <template>
  2. <z-paging ref="paging" bgColor="#F7F7F7" safe-area-inset-bottom paging-class="paging-btm-shadow"
  3. scroll-with-animation>
  4. <template #top>
  5. <ut-navbar title="成品详情" :fixed="false" border></ut-navbar>
  6. </template>
  7. <template>
  8. <view class="pd-24 d-flex a-c">
  9. <view class="flex1 ov-hd">
  10. <view class="startline-title">库存信息</view>
  11. </view>
  12. <view>
  13. <up-button @click="navigateToInOutRecords" type="primary" :customStyle="formItemBtnStyle">
  14. <image class="w-30 h-30 mr-10"
  15. src="https://ta.zycpzs.cn/oss-file/smart-trace/szyy/images-plt/plant/storage/ckcrkjl_icon.png"
  16. mode="widthFix" />
  17. <span>查看出入库记录</span>
  18. </up-button>
  19. </view>
  20. </view>
  21. <view class="bg-#fff pd-24">
  22. <view class="d-flex j-sb a-c li-item-head mb-16">
  23. <view class="li-left-tag" :class="{ [`bg-instore-${form?.instoreType}`]: true }">{{
  24. selectDictLabel(pt_seed_instore_type, form?.instoreType) }}</view>
  25. <view class="f-s-22 c-#666">{{ form?.instoreBizInfo?.instoreDate }}</view>
  26. </view>
  27. <view class="mb-10">
  28. <span class="f-s-34 c-#333 f-w-500 mr-10">{{ form?.variety }}</span>
  29. <span v-if="form?.partName" class="f-s-24 c-#666">{{ form?.level || '' }}{{ form?.partName }}</span>
  30. </view>
  31. <template v-if="form?.instoreType == '2'">
  32. <view class="pd2-4-0 f-s-28">
  33. <span class="c-#666">入库批号:</span>
  34. <span class="c-#333 f-w-500">{{ form?.batchCode || '-' }}</span>
  35. </view>
  36. <view v-if="form?.supplierId" class="pd2-4-0 f-s-28">
  37. <span class="c-#666">供应商:</span>
  38. <span class="c-#333 f-w-500">{{ form?.supplierInfo?.cusName || '-' }}</span>
  39. </view>
  40. </template>
  41. <template v-if="form?.instoreType == '3'">
  42. <view class="pd2-4-0 f-s-28">
  43. <span class="c-#666">采收批号:</span>
  44. <span class="c-#333 f-w-500">{{ form?.harvestInfo?.harvestCode || '-' }}</span>
  45. </view>
  46. <view class="pd2-4-0 f-s-28">
  47. <span class="c-#666">采收基地:</span>
  48. <span class="c-#333 f-w-500">
  49. {{ form?.harvestInfo?.baseInfo?.baseName || '-' }}
  50. </span>
  51. </view>
  52. </template>
  53. <view v-if="form?.warehouses?.length" class="pd2-4-0 f-s-28">
  54. <span class="c-#666">存放库房:</span>
  55. <span class="c-#333 f-w-500">{{ getStorageRoomNames(form?.warehouses) || '-' }}</span>
  56. </view>
  57. <view class="pd2-4-0 f-s-28">
  58. <span class="c-#666">入库量:</span>
  59. <span class="c-#333 f-w-500">{{ form?.capacity }}{{ form?.unit }}</span>
  60. </view>
  61. <view class="d-flex">
  62. <view v-if="form?.inputAmount" class="pd2-4-0 f-s-28 flex1">
  63. <span class="c-#666">出库量:</span>
  64. <span class="c-#333 f-w-500">{{ form?.inputAmount || '0' }}{{ form?.unit }}</span>
  65. </view>
  66. <view v-if="form?.restAmount" class="pd2-4-0 f-s-28 flex1">
  67. <span class="c-primary">剩余量:</span>
  68. <span class="c-primary f-w-500">{{ form?.restAmount || '0' }}{{ form?.unit }}</span>
  69. </view>
  70. </view>
  71. <view v-if="+form?.restAmount" class="pd3-20-40-0">
  72. <up-button @click="navigateToInventoryLoss" type="warning" plain
  73. :customStyle="{ background: '#FFF9EF', borderColor: '#F9D9A3' }">库存有消耗?库存损耗登记{{ '>'
  74. }}</up-button>
  75. </view>
  76. </view>
  77. <view class="pd-24">
  78. <view class="startline-title">成品信息</view>
  79. </view>
  80. <view class="bg-#fff pd-24">
  81. <!-- 成品信息详情 -->
  82. <view class="f-s-30 pd2-16-0 info-border-bottom">
  83. <view class="c-#666 mb-10">动植物名称:</view>
  84. <view v-if="form?.varietyInfo" 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 class="mb-10">
  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 class="f-s-24 c-#666" v-if="form?.varietyInfo?.medicineName">产出:{{
  94. form?.varietyInfo?.medicineName }}
  95. </view>
  96. </view>
  97. <view v-else class="c-#333 f-w-600">{{ form?.variety || '-' }}</view>
  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?.partName || form?.part || '-' }}</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">{{ selectDictLabel(pt_medicine_source_tag, form?.sourceType) || '-'
  106. }}</span>
  107. </view>
  108. <view class="f-s-30 pd2-16-0 info-border-bottom">
  109. <span class="c-#666">入库量:</span>
  110. <span class="c-#333 f-w-600">{{ form?.capacity || '-' }}{{ selectDictLabel(pt_medicine_unit,
  111. form?.unit) ||
  112. form?.unit || '' }}</span>
  113. </view>
  114. <view class="f-s-30 pd2-16-0 info-border-bottom">
  115. <span class="c-#666">鲜货产地:</span>
  116. <span class="c-#333 f-w-600">{{ form?.producePlaceName || form?.producePlace || '-' }}</span>
  117. </view>
  118. <view v-if="form?.instoreType == '2'" class="f-s-30 pd2-16-0 info-border-bottom">
  119. <span class="c-#666">采收日期:</span>
  120. <span class="c-#333 f-w-600">{{ form?.productDate || '-' }}~{{ form?.productDateEnd || '-' }}</span>
  121. </view>
  122. <template v-if="['2'].includes(form?.sourceType as string)">
  123. <view class="f-s-30 pd2-16-0 info-border-bottom">
  124. <span class="c-#666">供应商:</span>
  125. <span class="c-#333 f-w-600">{{ form?.supplier || form?.supplierInfo?.cusName || '-' }}</span>
  126. </view>
  127. <view class="f-s-30 pd2-16-0 info-border-bottom">
  128. <span class="c-#666">供应商是否是生产商:</span>
  129. <span class="c-#333 f-w-600">{{ selectDictLabel(yes_no, form?.supplierProducerFlag) || '-'
  130. }}</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?.producer || '-' }}</span>
  135. </view>
  136. </template>
  137. <view v-if="form?.imgs" class="f-s-30 pd2-16-0 info-border-bottom">
  138. <view class="c-#666 mb-10">鲜货图片:</view>
  139. <ut-album :urls="form?.imgs"></ut-album>
  140. </view>
  141. <view v-if="form?.vedios" class="f-s-30 pd2-16-0 info-border-bottom">
  142. <view class="c-#666 mb-10">鲜货视频:</view>
  143. <ut-album :urls="form?.vedios"></ut-album>
  144. </view>
  145. <view v-if="form?.examinReport && form?.examinReport.length" class="f-s-30 pd2-16-0 info-border-bottom">
  146. <view class="c-#666 mb-10">检验报告:</view>
  147. <ut-album :urls="form?.examinReport"></ut-album>
  148. </view>
  149. </view>
  150. <view class="pd-24">
  151. <view class="startline-title">入库信息</view>
  152. </view>
  153. <view class="bg-#fff pd-24">
  154. <view class="f-s-30 pd2-16-0 info-border-bottom">
  155. <span class="c-#666">鲜货级别:</span>
  156. <span class="c-#333 f-w-600">{{ form?.level || '-' }}</span>
  157. </view>
  158. <view class="f-s-30 pd2-16-0 info-border-bottom">
  159. <span class="c-#666">入库类型:</span>
  160. <span class="c-#333 f-w-600">{{ selectDictLabel(pt_seed_instore_type, form?.instoreType) || '-'
  161. }}</span>
  162. </view>
  163. <template v-if="form.instoreType == '2'">
  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?.instoreBizInfo?.instoreDate || '-' }}</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?.batchCode || '-' }}</span>
  171. </view>
  172. </template>
  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">鲜货库</span>
  176. </view>
  177. <view v-if="form?.warehouses?.length" class="pd2-4-0 f-s-28">
  178. <span class="c-#666">存放库房:</span>
  179. <span class="c-#333 f-w-500">{{ getStorageRoomNames(form?.warehouses) || '-' }}</span>
  180. </view>
  181. <view 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?.instoreMg || '-' }}</span>
  184. </view>
  185. <view class="f-s-30 pd2-16-0 info-border-bottom">
  186. <span class="c-#666">入库备注:</span>
  187. <span class="c-#333 f-w-600">{{ form?.instoreBizInfo?.remark || '-' }}</span>
  188. </view>
  189. <view class="f-s-30 pd2-16-0 info-border-bottom">
  190. <span class="c-#666">最后修改人:</span>
  191. <span class="c-#333 f-w-600">{{ form?.operatorName || form?.updateByName || form?.createByName ||
  192. '-' }}</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?.operateTime || form?.updateTime || form?.createTime || '-'
  197. }}</span>
  198. </view>
  199. </view>
  200. </template>
  201. <template #bottom>
  202. <view class="pd-24 d-flex a-c">
  203. <up-button type="primary" @click="clickEdit">修改</up-button>
  204. </view>
  205. </template>
  206. </z-paging>
  207. </template>
  208. <script setup lang="ts">
  209. import { formItemBtnStyle } from '@/assets/styles/uview-plus';
  210. import { getStorageRoomNames } from '@/utils/common';
  211. import { useClientRequest } from '@/utils/request';
  212. import { selectDictListClass } from '@/utils/ruoyi';
  213. const { proxy } = getCurrentInstance() as ComponentInternalInstance;
  214. 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'));
  215. const paging = ref<any>(null);
  216. const form = ref<any>({});
  217. const did = ref('');
  218. // 繁衍世代显示文案
  219. const genCountMap = reactive({
  220. A4: '累计扩繁代数',
  221. A3: '继代培养次数',
  222. });
  223. // 获取详情(仓库信息)
  224. const getDetailById = async (id: string) => {
  225. if (!id) return;
  226. const res = await useClientRequest.get(`/plt-api/app/storage/getInfo/${id}`);
  227. if (res && res.code === 200) {
  228. form.value = res.data || {};
  229. }
  230. };
  231. const navigateToInOutRecords = () => {
  232. uni.$u.route({
  233. type: 'navigateTo',
  234. url: '/plant/storage/stock-list/index',
  235. params: {
  236. id: did.value,
  237. stockType: '4',
  238. },
  239. });
  240. };
  241. const navigateToInventoryLoss = () => {
  242. uni.$on('storage-registered', () => {
  243. getDetailById(did.value);
  244. uni.$emit('refreshStorageRoomList');
  245. uni.$off('storage-registered');
  246. });
  247. uni.navigateTo({
  248. url: '/plant/storage/loss-register/index',
  249. success: (res) => {
  250. res.eventChannel.emit('storage-data', {
  251. stockType: '4',
  252. ...form.value,
  253. });
  254. },
  255. });
  256. };
  257. const onRefresh = () => {
  258. getDetailById(did.value);
  259. paging.value?.complete();
  260. };
  261. const clickEdit = () => {
  262. uni.$on('fresh-goods-detail-refresh', () => {
  263. getDetailById(did.value);
  264. uni.$off('fresh-goods-detail-refresh');
  265. });
  266. uni.$u.route({
  267. type: 'navigateTo',
  268. url: '/plant/storage/fresh-goods/info-update/index',
  269. params: {
  270. id: did.value,
  271. },
  272. });
  273. };
  274. // 页面入参解析并加载
  275. onLoad((options: any) => {
  276. did.value = options?.id || '';
  277. getDetailById(did.value);
  278. });
  279. </script>
  280. <style lang="scss" scoped>
  281. .card-info-block {
  282. border: 1rpx solid #afddbb;
  283. border-radius: 10rpx;
  284. }
  285. .li-item-head {
  286. margin-left: -24rpx;
  287. margin-top: -24rpx;
  288. }
  289. .li-left-tag {
  290. padding: 6rpx 16rpx;
  291. color: #fff;
  292. border-radius: 0 0 16rpx 0;
  293. font-size: 20rpx;
  294. font-weight: 500;
  295. }
  296. </style>