details.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. <template>
  2. <view class="mainBox">
  3. <uni-nav-bar fixed="true" statusBar="true" left-icon="back" title="物料入库单" @clickLeft="back"></uni-nav-bar>
  4. <u-cell-group>
  5. <u-cell title="单号" :value="contData.code"></u-cell>
  6. <u-cell title="状态">
  7. <view slot="value" class="u-slot-value"><u--text type="primary" :text="contData.status.name" v-if="contData.status"></u--text></view>
  8. </u-cell>
  9. <u-cell title="创建时间" :value="contData.createTime"></u-cell>
  10. </u-cell-group>
  11. <uni-section title="基本信息" type="line">
  12. <u-cell title="仓库" :value="contData.warehouse.name" v-if="contData.warehouse"></u-cell>
  13. <u-cell title="负责人" :value="contData.creator.name" v-if="contData.creator"></u-cell>
  14. <u-cell title="来源单据" :value="contData.sourceBill?contData.sourceBill:'无'"></u-cell>
  15. <u-cell title="入库登记人" :value="contData.executor.name" v-if="contData.executor"></u-cell>
  16. <u-cell title="送货人" :value="contData.sendName"></u-cell>
  17. <u-cell title="送货人联系方式" :value="contData.sendPhone"></u-cell>
  18. </uni-section>
  19. <u-collapse class="cLine" >
  20. <u-collapse-item title="附件" name="">
  21. <view class="picList">
  22. <u--image :showLoading="true" :src="item.src" width="50px" height="50px" @click="viewImage(item.src)" v-for="(item,index) in contData.attaments" :key="index"></u--image>
  23. </view>
  24. </u-collapse-item>
  25. <u-collapse-item title="描述" name="">
  26. <text class="u-collapse-content">{{contData.remark}}</text>
  27. </u-collapse-item>
  28. <u-collapse-item title="明细" name="detail">
  29. <view class="listBox" v-for="(item, index) in contData.pieceDetails" :key="index" >
  30. <view class="listTit">
  31. <view style="display:inline-block;"><u-tag text="按量" size="mini" shape="circle" type="primary"></u-tag></view>
  32. <view class="name">{{item.material.name}}</view>
  33. <view class="weight">{{item.num}}{{item.unit}}</view>
  34. <view class="delete">{{item.trueNum}}{{item.unit}}</view>
  35. </view>
  36. <view class="listCont">
  37. <view class="item"><text>编码:</text>{{item.material.id}}</view>
  38. <view class="item"><text>批次号:</text>{{item.batchNo}}</view>
  39. <view class="item" v-if="item.type"><text>物料类型:</text>{{item.type.name}}</view>
  40. <view class="item"><text>包装单位:</text>{{item.pkgUnit}}</view>
  41. <view class="item" v-if="item.storeArea"><text>库区:</text>{{item.storeArea.name}}</view>
  42. <view class="item" v-if="item.storeSpace"><text>库位:</text>{{item.storeSpace.name}}</view>
  43. <view class="item"><text>层级:</text>{{item.level}}</view>
  44. </view>
  45. </view>
  46. </u-collapse-item>
  47. </u-collapse>
  48. <view class="footBox">
  49. <view class="reg" style="width:100%;" @click="getAddDetails"><uni-icons custom-prefix="iconfont" type="icon-shixiangxinzeng" size="20" color="#fff"></uni-icons> 入库登记</view>
  50. </view>
  51. </view>
  52. </template>
  53. <script>
  54. import { post,get } from "@/utils/api.js";
  55. export default {
  56. data() {
  57. return {
  58. id:'',
  59. code:'',
  60. contData:{},
  61. }
  62. },
  63. onLoad(params){
  64. this.id = params.id;
  65. this.code = params.code;
  66. this.getDetails(params.id,params.code);
  67. },
  68. methods: {
  69. //获取信息
  70. getDetails(id,code){
  71. let data = {
  72. id:id,
  73. code:code
  74. }
  75. get(this.apiWebUrl + "/wms/enter/material/info", data).then(res=>{
  76. this.contData = res.data;
  77. }).catch((res)=>{
  78. })
  79. },
  80. //查看附件
  81. viewImage(src){
  82. uni.previewImage({
  83. current:0,
  84. urls: [src],
  85. });
  86. },
  87. //入库登记
  88. getAddDetails(){
  89. uni.navigateTo({
  90. url: '/pages/warehouse/material/addMaterial'
  91. });
  92. },
  93. }
  94. }
  95. </script>
  96. <style lang="scss" scoped>
  97. .mainBox{
  98. padding-bottom: 120rpx;
  99. }
  100. .picList{
  101. display: flex;
  102. align-items: center;
  103. justify-items: flex-start;
  104. flex-wrap: wrap;
  105. }
  106. /deep/.picList .u-image{
  107. margin-right:10rpx;
  108. margin-bottom: 10rpx;
  109. }
  110. /deep/.cLine .u-line:nth-child(1){
  111. border-bottom: none !important;
  112. }
  113. .footBox{
  114. position: fixed;
  115. left:0px;
  116. bottom: 0px;
  117. height: 100rpx;
  118. width: 100%;
  119. display: flex;
  120. align-items: center;
  121. justify-content: space-between;
  122. view{
  123. width:50%;
  124. height: 100%;
  125. text-align: center;
  126. color: #fff;
  127. display: flex;
  128. align-items: center;
  129. justify-content: center;
  130. }
  131. .reg{
  132. background: $u-success-dark;
  133. }
  134. .uni-icons{margin-right: 8rpx !important;}
  135. }
  136. .listBox{
  137. padding: 20rpx 0;
  138. border-bottom:1px #f2f2f2 solid;
  139. .listTit{
  140. display: flex;
  141. align-items: center;
  142. .name{
  143. margin-left: 10px;
  144. }
  145. .weight {
  146. font-size: $uni-font-size-base;
  147. margin-left: auto;
  148. margin-right: 60rpx;
  149. position: relative;
  150. }
  151. .weight::after{
  152. position: absolute;
  153. right:-30rpx;
  154. top:50%;
  155. content: '';
  156. background: #eee;
  157. width: 1px;
  158. height: 28rpx;
  159. margin-top: -14rpx;
  160. }
  161. .delete{
  162. color: #999;
  163. }
  164. }
  165. .listCont{
  166. display: flex;
  167. align-items: center;
  168. flex-wrap: wrap;
  169. margin-top: 15px;
  170. .item{
  171. width:50%;
  172. font-size: $uni-font-size-sm;
  173. line-height: 48rpx;
  174. overflow: hidden;
  175. white-space: nowrap;
  176. text-overflow: ellipsis;
  177. -o-text-overflow:ellipsis;
  178. color: #000;
  179. }
  180. .item text{color: #666;}
  181. }
  182. }
  183. .listBox:last-child{
  184. border:none !important;
  185. }
  186. </style>