detail.vue 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300
  1. <template>
  2. <view class="detail-page">
  3. <u-navbar height="40px" :title="navTitle" bgColor="#0256FF" :titleStyle="{color:'#fff'}" leftIconColor="#fff" autoBack
  4. placeholder>
  5. </u-navbar>
  6. <view class="container_main">
  7. <view class="info-box">
  8. <view class="info-line">
  9. <view class="info-line-label">
  10. <text>货物名称</text>
  11. </view>
  12. <view class="info-line-value">
  13. {{goodsInfo.materialName}}
  14. </view>
  15. </view>
  16. <view class="info-line">
  17. <view class="info-line-label">
  18. <text>货物条码</text>
  19. </view>
  20. <view class="info-line-value">
  21. {{goodsInfo.barCode}}
  22. </view>
  23. </view>
  24. <view class="info-line">
  25. <view class="info-line-label">
  26. <text>货物图片</text>
  27. </view>
  28. <view class="info-line-value ss-p-y-24">
  29. <u-image src="" width="120rpx" height="120rpx"></u-image>
  30. </view>
  31. </view>
  32. <view class="info-line">
  33. <view class="info-line-label">
  34. <text>规格</text>
  35. </view>
  36. <view class="info-line-value">
  37. {{goodsInfo.materialStandard || '-'}}
  38. </view>
  39. </view>
  40. <view class="info-line">
  41. <view class="info-line-label">
  42. <text>批次号</text>
  43. </view>
  44. <view class="info-line-value">
  45. {{goodsInfo.batchNumber || '-'}}
  46. </view>
  47. </view>
  48. <view class="info-line">
  49. <view class="info-line-label">
  50. <text>生产日期</text>
  51. </view>
  52. <view class="info-line-value">
  53. {{goodsInfo.productionDate || '-'}}
  54. </view>
  55. </view>
  56. <view class="info-line">
  57. <view class="info-line-label">
  58. <text>库存</text>
  59. </view>
  60. <view class="info-line-value">
  61. {{goodsInfo.inventory || '0'}}{{goodsInfo.commodityUnit || ''}}
  62. </view>
  63. </view>
  64. <view class="info-line">
  65. <view class="info-line-label">
  66. <text>库位</text>
  67. </view>
  68. <view class="info-line-value">
  69. {{goodsInfo.position || '-'}}
  70. </view>
  71. </view>
  72. <view class="info-line">
  73. <view class="info-line-label">
  74. <text>创建时间</text>
  75. </view>
  76. <view class="info-line-value">
  77. {{goodsInfo.createTime}}
  78. </view>
  79. </view>
  80. </view>
  81. <view class="crk-box" @click="getMaterialDepotDetail(),crkShow = true">
  82. <u-image src="@/static/image/cgrk-icon.png" width="48rpx" height="48rpx"></u-image>
  83. <view class="crk-msg">
  84. <view class="crk-msg-name">出入库明细</view>
  85. <view>查看最近的出入库记录</view>
  86. </view>
  87. <u-icon name="arrow-right" color="rgba(173, 181, 189, 0.50)" size="14"></u-icon>
  88. </view>
  89. </view>
  90. <!-- 出入库明细 -->
  91. <u-popup :show="crkShow" @close="crkShow = false" round="18" closeable :closeOnClickOverlay="false">
  92. <view class="crk-cont">
  93. <view class="crk-cont-title">出入库明细</view>
  94. <view class="crk-cont-tab">
  95. <view class="tab-item" :class="currentCrkId == item.id ? 'tab-item-active' : ''" v-for="(item,i) in crkList" :key="i" @click="tabClick(item)">
  96. {{item.name}}
  97. </view>
  98. </view>
  99. <scroll-view scroll-y class="scroll-y">
  100. <view class="crk-item" v-for="item in 6" :key="item">
  101. <view class="crk-item-title">娃哈哈AD钙</view>
  102. <view class="crk-item-line">出库仓库:我的仓库</view>
  103. <view class="crk-item-line">货物规格:500ml</view>
  104. <view class="crk-item-line">出库时间:2025-04-03 16:44</view>
  105. <view class="crk-item-line">出库数量:25件</view>
  106. <view class="img-box">
  107. <u-image v-if="currentCrkId == 0" src="@/static/image/yck-img.png" width="132rpx" height="132rpx"></u-image>
  108. <u-image v-if="currentCrkId == 1" src="@/static/image/yrk-img.png" width="132rpx" height="132rpx"></u-image>
  109. </view>
  110. </view>
  111. <u-divider text="仅展示最近10条记录" :dashed="true"></u-divider>
  112. <view style="height: 40rpx;"></view>
  113. </scroll-view>
  114. </view>
  115. </u-popup>
  116. </view>
  117. </template>
  118. <script>
  119. import {materialDetail, materialDepotDetail} from '@/common/request/apis/purchase'
  120. export default{
  121. data() {
  122. return {
  123. navTitle:'哇哈哈AD盖',
  124. goodsId:0,
  125. crkShow: false,
  126. currentCrkId:'in',
  127. crkList:[
  128. {
  129. name:'出库',
  130. id:'in'
  131. },
  132. {
  133. name:'入库',
  134. id:'out'
  135. }
  136. ],
  137. goodsInfo:{}
  138. }
  139. },
  140. onLoad(e) {
  141. this.navTitle = e.name ? decodeURIComponent(e.name) : ''
  142. this.goodsId = e.id
  143. this.getMaterialDetail()
  144. },
  145. methods:{
  146. tabClick(item) {
  147. this.currentCrkId = item.id
  148. this.getMaterialDepotDetail()
  149. },
  150. getMaterialDetail() {
  151. materialDetail(this.goodsId)
  152. .then(res=>{
  153. if(res.code == 200) {
  154. this.goodsInfo = res.data
  155. }
  156. })
  157. },
  158. getMaterialDepotDetail() {
  159. uni.showLoading()
  160. let urlParams = {
  161. type:this.currentCrkId,
  162. materialId:this.goodsId,
  163. }
  164. let data = {pageNum:1,pageSize:10}
  165. materialDepotDetail(urlParams,data)
  166. .then(res=>{
  167. if(res.code == 200) {
  168. }
  169. uni.hideLoading()
  170. })
  171. .catch(err=>{
  172. uni.hideLoading()
  173. })
  174. }
  175. }
  176. }
  177. </script>
  178. <style lang="scss" scoped>
  179. .detail-page {
  180. min-height: 100vh;
  181. background-color: #F0F6FB;
  182. padding: 24rpx;
  183. .container_main {
  184. .info-box {
  185. background-color: #fff;
  186. border-radius: 16rpx 16rpx 0 0;
  187. padding: 24rpx;
  188. .info-line {
  189. border-bottom: 1px solid #F4F4F4;
  190. min-height: 92rpx;
  191. color: #333;
  192. font-family: "PingFang SC";
  193. font-size: 28rpx;
  194. font-weight: 400;
  195. display: flex;
  196. align-items: center;
  197. &-label {
  198. width: 162rpx;
  199. }
  200. .must-box {
  201. color: #FF3B1D;
  202. }
  203. }
  204. }
  205. .crk-box {
  206. border-radius: 16rpx;
  207. background: #FFF;
  208. padding: 32rpx 24rpx;
  209. margin-top: 24rpx;
  210. display: flex;
  211. align-items: center;
  212. .crk-msg {
  213. flex: 1;
  214. margin-left: 24rpx;
  215. color: #666;
  216. font-size: 28rpx;
  217. font-weight: 400;
  218. .crk-msg-name {
  219. color: #333;
  220. font-size: 32rpx;
  221. font-weight: bold;
  222. }
  223. }
  224. }
  225. }
  226. .crk-cont {
  227. height: 75vh;
  228. &-title {
  229. height: 80rpx;
  230. line-height: 80rpx;
  231. text-align: center;
  232. color: #1F1F39;
  233. font-size: 36rpx;
  234. font-weight: bold;
  235. }
  236. &-tab {
  237. height: 100rpx;
  238. display: flex;
  239. align-items: center;
  240. justify-content: center;
  241. .tab-item {
  242. width: 160rpx;
  243. height: 56rpx;
  244. border-radius: 40rpx;
  245. border: 1px solid rgba(173, 181, 189, 0.50);
  246. color: #666;
  247. text-align: center;
  248. font-size: 28rpx;
  249. font-weight: 500;
  250. line-height: 56rpx;
  251. margin-right: 24rpx;
  252. }
  253. .tab-item-active {
  254. background: #0256FF;
  255. border: 1px solid #0256FF;
  256. color: #FFF;
  257. }
  258. }
  259. .scroll-y {
  260. height: calc(75vh - 80rpx - 100rpx);
  261. padding: 0 24rpx;
  262. .crk-item {
  263. border-radius: 16rpx;
  264. background: #F6F8FA;
  265. padding: 24rpx;
  266. font-family: "PingFang SC";
  267. margin-bottom: 24rpx;
  268. position: relative;
  269. &-title {
  270. color: #000;
  271. font-size: 28rpx;
  272. font-weight: 500;
  273. margin-bottom: 16rpx;
  274. }
  275. &-line {
  276. color: #666;
  277. font-size: 28rpx;
  278. font-weight: 400;
  279. margin-bottom: 8rpx;
  280. }
  281. .img-box {
  282. position: absolute;
  283. top: 24rpx;
  284. right: 24rpx;
  285. }
  286. }
  287. }
  288. }
  289. }
  290. </style>