index.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275
  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="https://yujin-szyy.oss-cn-chengdu.aliyuncs.com/szyy/images-plt/plant/storage/ckcrkjl_icon.png" mode="widthFix" />
  14. <span>查看出入库记录</span>
  15. </up-button>
  16. </view>
  17. </view>
  18. <!-- 卡片顶部 -->
  19. <view class="b-radius bg-#fff pd-20 p-rtv">
  20. <!-- 顶部类型标签和日期 -->
  21. <view class="d-flex j-sb a-c li-item-head mb-16">
  22. <view :class="['li-left-tag', typeBgClass]">{{ selectDictLabel(pt_product_type, form?.instoreBizInfo?.productType) }}</view>
  23. <view class="f-s-22 c-#666">{{ form?.productDate || '' }}包装</view>
  24. </view>
  25. <!-- 主标题和状态 -->
  26. <view class="d-flex flex1 mb-10">
  27. <view class="flex1">
  28. <span class="f-s-34 c-#333 f-w-500 mr-10">{{ form?.instoreBizInfo?.proName }}</span>
  29. <span v-if="form?.instoreBizInfo?.proLevel" class="f-s-24 c-#666">
  30. {{ form?.instoreBizInfo?.proLevel }}
  31. </span>
  32. </view>
  33. </view>
  34. <view class="" v-if="+form.instoreBizInfo?.productType == 6">
  35. <span v-if="form?.instoreBizInfo?.finalSpecn" class="f-s-24 c-#666"> {{ form?.instoreBizInfo?.finalSpecn }}{{ form?.instoreBizInfo?.finalUnit }} </span>
  36. </view>
  37. <!-- 详细信息 -->
  38. <view class="pd2-4-0 f-s-28 d-flex a-c">
  39. <span class="c-#666">成品批号:</span>
  40. <span class="c-#333 f-w-500 flex1">{{ form?.batchCode || '-' }}</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">{{ form?.instoreBizInfo?.packSn || '-' }}</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">{{ getStorageRoomNames(form?.warehouses) || '-' }}</span>
  49. </view>
  50. <view class="d-flex">
  51. <view class="pd2-4-0 f-s-28 d-flex w-50%">
  52. <view class="c-#666 w-s-no">入库量:</view>
  53. <view class="d-flex flex-cln">
  54. <span class="c-#333 f-w-500 d-flex a-c">{{ form?.specn }}*{{ form?.capacity }}{{ form?.unit }}</span>
  55. <span class="c-#333 f-w-500 d-flex a-c" v-if="+form?.restSpecn">{{ form?.restSpecn }}*{{ form?.capacity }}{{ form?.unit }}</span>
  56. </view>
  57. </view>
  58. <view class="pd2-4-0 f-s-28 w-50% d-flex">
  59. <span class="c-primary w-s-no">剩余量:</span>
  60. <view class="d-flex flex-cln">
  61. <span class="c-primary f-w-500">{{ form?.specn }}*{{ form?.restAmount }}{{ form?.unit }}</span>
  62. <span class="c-primary f-w-500 d-flex a-c" v-if="+form?.restRestAmount">{{ form?.restSpecn }}*{{ form?.restRestAmount }}{{ form?.unit }}</span>
  63. </view>
  64. </view>
  65. </view>
  66. <view v-if="+form?.restAmount" class="pd3-20-40-0">
  67. <up-button @click="navigateToInventoryLoss" type="warning" plain :customStyle="{ background: '#FFF9EF', borderColor: '#F9D9A3' }">库存有消耗?库存损耗登记{{ '>' }}</up-button>
  68. </view>
  69. </view>
  70. <view class="pd-24">
  71. <view class="startline-title">成品信息</view>
  72. </view>
  73. <view class="bg-#fff pd-24">
  74. <!-- 成品信息详情 -->
  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-500 flex1">{{ form?.batchCode || '-' }}</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-500">{{ form?.instoreBizInfo?.packSn || '-' }}</span>
  82. </view>
  83. <view class="f-s-30 pd2-16-0 info-border-bottom d-flex">
  84. <view class="c-#666 w-s-no">入库量:</view>
  85. <view class="d-flex flex-cln">
  86. <span class="c-#333 f-w-500 d-flex a-c">{{ form?.specn }}*{{ form?.capacity }}{{ form?.unit }}</span>
  87. <span class="c-#333 f-w-500 d-flex a-c" v-if="form?.restSpecn">{{ form?.restSpecn }}*{{ form?.capacity }}{{ form?.unit }}</span>
  88. </view>
  89. </view>
  90. <view v-if="form?.examinReport && form?.examinReport.length" class="f-s-30 pd2-16-0 info-border-bottom">
  91. <view class="c-#666 mb-10">检验报告:</view>
  92. <ut-album :urls="form?.examinReport"></ut-album>
  93. </view>
  94. <view v-if="form?.instoreType == '2'" class="f-s-30 pd2-16-0 info-border-bottom">
  95. <span class="c-#666">采收日期:</span>
  96. <span class="c-#333 f-w-600">{{ form?.productDate || '-' }}~{{ form?.productDateEnd || '-' }}</span>
  97. </view>
  98. <template v-if="['2'].includes(form?.sourceType as string)">
  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?.supplier || form?.supplierInfo?.cusName || '-' }}</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(yes_no, form?.supplierProducerFlag) || '-' }}</span>
  106. </view>
  107. <view 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?.producer || '-' }}</span>
  110. </view>
  111. </template>
  112. <view v-if="form?.imgs" class="f-s-30 pd2-16-0 info-border-bottom">
  113. <view class="c-#666 mb-10">成品图片:</view>
  114. <ut-album :urls="form?.imgs"></ut-album>
  115. </view>
  116. <view v-if="form?.vedios" class="f-s-30 pd2-16-0 info-border-bottom">
  117. <view class="c-#666 mb-10">成品视频:</view>
  118. <ut-album :urls="form?.vedios"></ut-album>
  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">成品库</span>
  123. </view>
  124. <view class="pd2-4-0 f-s-28 info-border-bottom">
  125. <span class="c-#666">所在库房:</span>
  126. <span class="c-#333 f-w-500">{{ getStorageRoomNames(form?.warehouses) || '-' }}</span>
  127. </view>
  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">{{ form?.instoreBizInfo?.instoreDate || '-' }}</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?.instoreMg || '-' }}</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?.instoreBizInfo?.remark || '-' }}</span>
  139. </view>
  140. </view>
  141. </template>
  142. <template #bottom>
  143. <view class="pd-24 d-flex a-c">
  144. <up-button type="primary" @click="clickEdit">修改</up-button>
  145. </view>
  146. </template>
  147. </z-paging>
  148. </template>
  149. <script setup lang="ts">
  150. import { formItemBtnStyle } from '@/assets/styles/uview-plus';
  151. import { getStorageRoomNames } from '@/utils/common';
  152. import { useClientRequest } from '@/utils/request';
  153. import { selectDictListClass } from '@/utils/ruoyi';
  154. const { proxy } = getCurrentInstance() as ComponentInternalInstance;
  155. const { pt_seed_instore_type, yes_no, pt_medicine_source_tag, pt_medicine_unit, pt_product_type } = toRefs<any>(proxy?.useDict('pt_seed_instore_type', 'yes_no', 'pt_medicine_source_tag', 'pt_medicine_unit', 'pt_product_type'));
  156. // 类型标签背景色类名
  157. const typeBgClass = computed(() => `bg-instore-${form.value?.instoreBizInfo?.productType}`);
  158. const paging = ref<any>(null);
  159. const form = ref<any>({});
  160. const did = ref('');
  161. // 繁衍世代显示文案
  162. const genCountMap = reactive({
  163. A4: '累计扩繁代数',
  164. A3: '继代培养次数',
  165. });
  166. // 获取详情(仓库信息)
  167. const getDetailById = async (id: string) => {
  168. if (!id) return;
  169. const res = await useClientRequest.get(`/plt-api/app/storage/getInfo/${id}`);
  170. if (res && res.code === 200) {
  171. form.value = res.data || {};
  172. }
  173. };
  174. const navigateToInOutRecords = () => {
  175. uni.$u.route({
  176. type: 'navigateTo',
  177. url: '/plant/storage/stock-list/index',
  178. params: {
  179. id: did.value,
  180. stockType: '4',
  181. },
  182. });
  183. };
  184. const navigateToInventoryLoss = () => {
  185. uni.$on('storage-registered', () => {
  186. getDetailById(did.value);
  187. uni.$emit('refreshStorageRoomList');
  188. uni.$off('storage-registered');
  189. });
  190. uni.navigateTo({
  191. url: '/plant/storage/loss-register/index',
  192. success: (res) => {
  193. res.eventChannel.emit('storage-data', {
  194. stockType: '4',
  195. ...form.value,
  196. });
  197. },
  198. });
  199. };
  200. const onRefresh = () => {
  201. getDetailById(did.value);
  202. paging.value?.complete();
  203. };
  204. const clickEdit = () => {
  205. uni.$on('finished-product-detail-refresh', () => {
  206. getDetailById(did.value);
  207. uni.$off('finished-product-detail-refresh');
  208. });
  209. uni.$u.route({
  210. type: 'navigateTo',
  211. url: '/plant/storage/finished-product/info-update/index',
  212. params: {
  213. id: did.value,
  214. },
  215. });
  216. };
  217. // 页面入参解析并加载
  218. onLoad((options: any) => {
  219. did.value = options?.id || '';
  220. getDetailById(did.value);
  221. });
  222. </script>
  223. <style lang="scss" scoped>
  224. .card-info-block {
  225. border: 1rpx solid #afddbb;
  226. border-radius: 10rpx;
  227. }
  228. .li-item-head {
  229. margin-left: -24rpx;
  230. margin-top: -24rpx;
  231. }
  232. .li-left-tag {
  233. padding: 6rpx 16rpx;
  234. color: #fff;
  235. border-radius: 0rpx 0 16rpx 0;
  236. font-size: 20rpx;
  237. font-weight: 500;
  238. }
  239. /* 类型标签背景色 */
  240. .bg-instore-2 {
  241. background-color: #2289e0;
  242. }
  243. /* 药材 - 绿色 */
  244. .bg-instore-4 {
  245. background-color: #ff9800;
  246. }
  247. /* 鲜货 - 橙色 */
  248. .bg-instore-5 {
  249. background-color: #1ebddc;
  250. }
  251. /* 种源 - 蓝色 */
  252. .bg-instore-6 {
  253. background-color: #ebf6ee;
  254. }
  255. </style>