detail.vue 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310
  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="goodsInfo.imgNameArr && goodsInfo.imgNameArr.length > 0 ?goodsInfo.imgNameArr[0] : ''" 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 ? (goodsInfo.inventory * 1).toFixed(0) : '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.warehousingTime || '-'}}</view>
  105. <view class="crk-item-line">{{currentCrkId == 'out' ?'出库':'入库'}}数量:{{(item.actualQuantityInStorage * 1).toFixed(0) || 0}}{{item.commodityUnit || ''}}</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" text="暂无内容" marginTop="60" icon="https://xiangli-erp.oss-cn-hangzhou.aliyuncs.com/APP/no-notifcations.png" 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. console.log(res.data,'data---------')
  159. if(res.data.imgName && res.data.imgName.length >0) {
  160. res.data.imgNameArr = res.data.imgName.split(",")
  161. }else {
  162. res.data.imgNameArr = []
  163. }
  164. this.goodsInfo = res.data
  165. }
  166. })
  167. },
  168. getMaterialDepotDetail() {
  169. uni.showLoading()
  170. let urlParams = {
  171. type:this.currentCrkId,
  172. materialId:this.goodsInfo.materialId,
  173. }
  174. let data = {pageNum:1,pageSize:10}
  175. materialDepotDetail(urlParams,data)
  176. .then(res=>{
  177. if(res.code == 200) {
  178. this.cukList = res.data.rows
  179. }
  180. uni.hideLoading()
  181. })
  182. .catch(err=>{
  183. uni.hideLoading()
  184. })
  185. }
  186. }
  187. }
  188. </script>
  189. <style lang="scss" scoped>
  190. .detail-page {
  191. min-height: 100vh;
  192. background-color: #F0F6FB;
  193. padding: 24rpx;
  194. .container_main {
  195. .info-box {
  196. background-color: #fff;
  197. border-radius: 16rpx 16rpx 0 0;
  198. padding: 24rpx;
  199. .info-line {
  200. border-bottom: 1px solid #F4F4F4;
  201. min-height: 92rpx;
  202. color: #333;
  203. font-family: "PingFang SC";
  204. font-size: 28rpx;
  205. font-weight: 400;
  206. display: flex;
  207. align-items: center;
  208. &-label {
  209. width: 162rpx;
  210. }
  211. .must-box {
  212. color: #FF3B1D;
  213. }
  214. }
  215. }
  216. .crk-box {
  217. border-radius: 16rpx;
  218. background: #FFF;
  219. padding: 32rpx 24rpx;
  220. margin-top: 24rpx;
  221. display: flex;
  222. align-items: center;
  223. .crk-msg {
  224. flex: 1;
  225. margin-left: 24rpx;
  226. color: #666;
  227. font-size: 28rpx;
  228. font-weight: 400;
  229. .crk-msg-name {
  230. color: #333;
  231. font-size: 32rpx;
  232. font-weight: bold;
  233. }
  234. }
  235. }
  236. }
  237. .crk-cont {
  238. height: 75vh;
  239. &-title {
  240. height: 80rpx;
  241. line-height: 80rpx;
  242. text-align: center;
  243. color: #1F1F39;
  244. font-size: 36rpx;
  245. font-weight: bold;
  246. }
  247. &-tab {
  248. height: 100rpx;
  249. display: flex;
  250. align-items: center;
  251. justify-content: center;
  252. .tab-item {
  253. width: 160rpx;
  254. height: 56rpx;
  255. border-radius: 40rpx;
  256. border: 1px solid rgba(173, 181, 189, 0.50);
  257. color: #666;
  258. text-align: center;
  259. font-size: 28rpx;
  260. font-weight: 500;
  261. line-height: 56rpx;
  262. margin-right: 24rpx;
  263. }
  264. .tab-item-active {
  265. background: #0256FF;
  266. border: 1px solid #0256FF;
  267. color: #FFF;
  268. }
  269. }
  270. .scroll-y {
  271. height: calc(75vh - 80rpx - 100rpx);
  272. padding: 0 24rpx;
  273. .crk-item {
  274. border-radius: 16rpx;
  275. background: #F6F8FA;
  276. padding: 24rpx;
  277. font-family: "PingFang SC";
  278. margin-bottom: 24rpx;
  279. position: relative;
  280. &-title {
  281. color: #000;
  282. font-size: 28rpx;
  283. font-weight: 500;
  284. margin-bottom: 16rpx;
  285. }
  286. &-line {
  287. color: #666;
  288. font-size: 28rpx;
  289. font-weight: 400;
  290. margin-bottom: 8rpx;
  291. }
  292. .img-box {
  293. position: absolute;
  294. top: 24rpx;
  295. right: 24rpx;
  296. }
  297. }
  298. }
  299. }
  300. }
  301. </style>