detail.vue 8.1 KB

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