detail.vue 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304
  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,i) in cukList" :key="item">
  101. <view class="crk-item-title">{{item.materialName}}</view>
  102. <!-- <view class="crk-item-line">出库仓库:我的仓库-暂无</view> -->
  103. <view class="crk-item-line">货物规格:{{item.materialStandard}}</view>
  104. <view class="crk-item-line">{{currentCrkId == 'out' ?'出库':'入库'}}时间:{{item.operTime || '-'}}</view>
  105. <view class="crk-item-line">{{currentCrkId == 'out' ?'出库':'入库'}}数量:{{item.actualQuantityInStorage || 0}}{{item.materialUnit || '-'}}</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-empty mode="data" v-if="cukList.length == 0"></u-empty>
  112. <u-divider text="仅展示最近10条记录" v-if="cukList.length > 0" :dashed="true"></u-divider>
  113. <view style="height: 40rpx;"></view>
  114. </scroll-view>
  115. </view>
  116. </u-popup>
  117. </view>
  118. </template>
  119. <script>
  120. import {materialDetail, materialDepotDetail} from '@/common/request/apis/purchase'
  121. export default{
  122. data() {
  123. return {
  124. navTitle:'哇哈哈AD盖',
  125. goodsId:0,//单据id
  126. materialId:0,//商品id
  127. crkShow: false,
  128. currentCrkId:'out',
  129. crkList:[
  130. {
  131. name:'出库',
  132. id:'out'
  133. },
  134. {
  135. name:'入库',
  136. id:'in'
  137. }
  138. ],
  139. goodsInfo:{},
  140. cukList:[],
  141. }
  142. },
  143. onLoad(e) {
  144. this.navTitle = e.name ? decodeURIComponent(e.name) : ''
  145. this.goodsId = e.id
  146. this.materialId = e.materialId
  147. this.getMaterialDetail()
  148. },
  149. methods:{
  150. tabClick(item) {
  151. this.currentCrkId = item.id
  152. this.getMaterialDepotDetail()
  153. },
  154. getMaterialDetail() {
  155. materialDetail(this.goodsId)
  156. .then(res=>{
  157. if(res.code == 200) {
  158. this.goodsInfo = res.data
  159. }
  160. })
  161. },
  162. getMaterialDepotDetail() {
  163. uni.showLoading()
  164. let urlParams = {
  165. type:this.currentCrkId,
  166. materialId:this.materialId,
  167. }
  168. let data = {pageNum:1,pageSize:10}
  169. materialDepotDetail(urlParams,data)
  170. .then(res=>{
  171. if(res.code == 200) {
  172. this.cukList = res.data.rows
  173. }
  174. uni.hideLoading()
  175. })
  176. .catch(err=>{
  177. uni.hideLoading()
  178. })
  179. }
  180. }
  181. }
  182. </script>
  183. <style lang="scss" scoped>
  184. .detail-page {
  185. min-height: 100vh;
  186. background-color: #F0F6FB;
  187. padding: 24rpx;
  188. .container_main {
  189. .info-box {
  190. background-color: #fff;
  191. border-radius: 16rpx 16rpx 0 0;
  192. padding: 24rpx;
  193. .info-line {
  194. border-bottom: 1px solid #F4F4F4;
  195. min-height: 92rpx;
  196. color: #333;
  197. font-family: "PingFang SC";
  198. font-size: 28rpx;
  199. font-weight: 400;
  200. display: flex;
  201. align-items: center;
  202. &-label {
  203. width: 162rpx;
  204. }
  205. .must-box {
  206. color: #FF3B1D;
  207. }
  208. }
  209. }
  210. .crk-box {
  211. border-radius: 16rpx;
  212. background: #FFF;
  213. padding: 32rpx 24rpx;
  214. margin-top: 24rpx;
  215. display: flex;
  216. align-items: center;
  217. .crk-msg {
  218. flex: 1;
  219. margin-left: 24rpx;
  220. color: #666;
  221. font-size: 28rpx;
  222. font-weight: 400;
  223. .crk-msg-name {
  224. color: #333;
  225. font-size: 32rpx;
  226. font-weight: bold;
  227. }
  228. }
  229. }
  230. }
  231. .crk-cont {
  232. height: 75vh;
  233. &-title {
  234. height: 80rpx;
  235. line-height: 80rpx;
  236. text-align: center;
  237. color: #1F1F39;
  238. font-size: 36rpx;
  239. font-weight: bold;
  240. }
  241. &-tab {
  242. height: 100rpx;
  243. display: flex;
  244. align-items: center;
  245. justify-content: center;
  246. .tab-item {
  247. width: 160rpx;
  248. height: 56rpx;
  249. border-radius: 40rpx;
  250. border: 1px solid rgba(173, 181, 189, 0.50);
  251. color: #666;
  252. text-align: center;
  253. font-size: 28rpx;
  254. font-weight: 500;
  255. line-height: 56rpx;
  256. margin-right: 24rpx;
  257. }
  258. .tab-item-active {
  259. background: #0256FF;
  260. border: 1px solid #0256FF;
  261. color: #FFF;
  262. }
  263. }
  264. .scroll-y {
  265. height: calc(75vh - 80rpx - 100rpx);
  266. padding: 0 24rpx;
  267. .crk-item {
  268. border-radius: 16rpx;
  269. background: #F6F8FA;
  270. padding: 24rpx;
  271. font-family: "PingFang SC";
  272. margin-bottom: 24rpx;
  273. position: relative;
  274. &-title {
  275. color: #000;
  276. font-size: 28rpx;
  277. font-weight: 500;
  278. margin-bottom: 16rpx;
  279. }
  280. &-line {
  281. color: #666;
  282. font-size: 28rpx;
  283. font-weight: 400;
  284. margin-bottom: 8rpx;
  285. }
  286. .img-box {
  287. position: absolute;
  288. top: 24rpx;
  289. right: 24rpx;
  290. }
  291. }
  292. }
  293. }
  294. }
  295. </style>