regStock.vue 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264
  1. <template>
  2. <view class="mainBox">
  3. <uni-nav-bar fixed="true" statusBar="true" left-icon="back" title="新增物料入库单" @clickLeft="back">
  4. <!--右菜单-->
  5. <template slot="float">
  6. <view class="nav-icon-caozuo rightNav" @click="getsure"><u-button type="success" size="small" class="u-reset-button" text="确定"></u-button></view>
  7. </template>
  8. </uni-nav-bar>
  9. <u-cell-group>
  10. <u-cell title="仓库" value="5001混炼料库" :isLink="true"></u-cell>
  11. <u-cell title="来源单据" value="无" :isLink="true"></u-cell>
  12. <u-cell title="入库登记人" value="张三" :isLink="true"></u-cell>
  13. <u-cell title="送货人" value="李四" :isLink="true"></u-cell>
  14. <u-cell title="送货人联系方式" value="13800138000" :isLink="true"></u-cell>
  15. </u-cell-group>
  16. <u-collapse class="cLine" :value="['detail']">
  17. <u-collapse-item title="附件" name="">
  18. <view class="picList">
  19. <u--image :showLoading="true" :src="src" width="50px" height="50px" @click="viewImage"></u--image>
  20. <u--image :showLoading="true" :src="src" width="50px" height="50px" @click="viewImage"></u--image>
  21. <u--image :showLoading="true" :src="src" width="50px" height="50px" @click="viewImage"></u--image>
  22. </view>
  23. </u-collapse-item>
  24. <u-collapse-item title="描述" name="">
  25. <text class="u-collapse-content">涵盖uniapp各个方面,给开发者方向指导和设计理念</text>
  26. </u-collapse-item>
  27. <u-collapse-item title="明细" name="detail">
  28. <view class="listBox" v-for="(item, index) in listData" :key="index" >
  29. <view class="listTit">
  30. <view style="display:inline-block;"><u-tag :text="item.normName" size="mini" shape="circle" :type="item.type"></u-tag></view>
  31. <view class="name">{{item.title}}</view>
  32. <view class="weight">{{item.weight}}KG</view>
  33. <view class="delete" @click="getDelete(index)"><uni-icons custom-prefix="iconfont" type="icon-shanchu" size="24" color="#fa3534"></uni-icons></view>
  34. </view>
  35. <view class="listCont">
  36. <view class="item"><text>编码:</text>{{item.codeNum}}</view>
  37. <view class="item"><text>批次号:</text>{{item.batchNum}}</view>
  38. <view class="item"><text>有效期:</text>{{item.datetime}}</view>
  39. <view class="item"><text>牌号:</text>{{item.grade}}</view>
  40. <view class="item"><text>型号:</text>{{item.model}}</view>
  41. <view class="item"><text>包装单位:</text>{{item.unit}}</view>
  42. <view class="item"><text>存放货位:</text>{{item.cargoSpace?item.cargoSpace:'未登记'}}</view>
  43. </view>
  44. </view>
  45. </u-collapse-item>
  46. </u-collapse>
  47. <view class="footBox">
  48. <view class="reg" style="width:100%;"><uni-icons custom-prefix="iconfont" type="icon-shixiangxinzeng" size="20" color="#fff"></uni-icons> 添加入库明细</view>
  49. </view>
  50. </view>
  51. </template>
  52. <script>
  53. export default {
  54. data() {
  55. return {
  56. src:'../../../static/logo.png',
  57. listData:[
  58. {
  59. norm:0,
  60. title:'混炼料391',
  61. weight:'60',
  62. codeNum:'W03912838881',
  63. batchNum:'102882381',
  64. datetime:'2010-08-19',
  65. grade:'E388287',
  66. model:'BΦ3.0*100',
  67. unit:'60KG/桶',
  68. cargoSpace:'',
  69. },
  70. {
  71. norm:0,
  72. title:'混炼料391',
  73. weight:'60',
  74. codeNum:'W03912838881',
  75. batchNum:'102882381',
  76. datetime:'2010-08-19',
  77. grade:'E388287',
  78. model:'BΦ3.0*100',
  79. unit:'60KG/桶',
  80. cargoSpace:'',
  81. },
  82. {
  83. norm:1,
  84. title:'混炼料391',
  85. weight:'60',
  86. codeNum:'W03912838881',
  87. batchNum:'102882381',
  88. datetime:'2010-08-19',
  89. grade:'E388287',
  90. model:'BΦ3.0*100',
  91. unit:'60KG/桶',
  92. cargoSpace:'',
  93. },
  94. {
  95. norm:0,
  96. title:'混炼料391',
  97. weight:'60',
  98. codeNum:'W03912838881',
  99. batchNum:'102882381',
  100. datetime:'2010-08-19',
  101. grade:'E388287',
  102. model:'BΦ3.0*100',
  103. unit:'60KG/桶',
  104. cargoSpace:'',
  105. },
  106. {
  107. norm:1,
  108. title:'混炼料391',
  109. weight:'60',
  110. codeNum:'W03912838881',
  111. batchNum:'102882381',
  112. datetime:'2010-08-19',
  113. grade:'E388287',
  114. model:'BΦ3.0*100',
  115. unit:'60KG/桶',
  116. cargoSpace:'',
  117. },
  118. ]
  119. }
  120. },
  121. onShow(){
  122. //添加属性
  123. let newListData = this.listData;
  124. newListData.forEach(function(res, key) {
  125. if(res.norm == 0){
  126. newListData[key].normName = '按件'
  127. newListData[key].type = 'success'
  128. }else if(res.norm == 1){
  129. newListData[key].normName = '按量'
  130. newListData[key].type = 'primary'
  131. }
  132. })
  133. this.listData = newListData;
  134. },
  135. methods: {
  136. //查看附件
  137. viewImage(){
  138. uni.previewImage({
  139. current:0,
  140. urls: [this.src],
  141. });
  142. },
  143. //确定
  144. getsure(){
  145. },
  146. //删除
  147. getDelete(index){
  148. this.listData.splice(index,1);
  149. },
  150. //添加入库明细
  151. getAddDetails(){
  152. console.log("添加入库明细");
  153. }
  154. }
  155. }
  156. </script>
  157. <style lang="scss" scoped>
  158. .mainBox{
  159. padding-bottom: 120rpx;
  160. }
  161. .picList{
  162. display: flex;
  163. align-items: center;
  164. justify-items: flex-start;
  165. flex-wrap: wrap;
  166. }
  167. /deep/.picList .u-image{
  168. margin-right:10rpx;
  169. margin-bottom: 10rpx;
  170. }
  171. /deep/.cLine .u-line:nth-child(1){
  172. border-bottom: none !important;
  173. }
  174. .footBox{
  175. position: fixed;
  176. left:0px;
  177. bottom: 0px;
  178. height: 100rpx;
  179. width: 100%;
  180. display: flex;
  181. align-items: center;
  182. justify-content: space-between;
  183. view{
  184. width:50%;
  185. height: 100%;
  186. text-align: center;
  187. color: #fff;
  188. display: flex;
  189. align-items: center;
  190. justify-content: center;
  191. }
  192. .reg{
  193. background: $u-success-dark;
  194. }
  195. .uni-icons{margin-right: 8rpx !important;}
  196. }
  197. .listBox{
  198. padding: 20rpx 0;
  199. border-bottom:1px #f2f2f2 solid;
  200. .listTit{
  201. display: flex;
  202. align-items: center;
  203. .name{
  204. margin-left: 10px;
  205. }
  206. .weight {
  207. font-size: $uni-font-size-base;
  208. margin-left: auto;
  209. margin-right: 60rpx;
  210. position: relative;
  211. }
  212. .weight::after{
  213. position: absolute;
  214. right:-30rpx;
  215. top:50%;
  216. content: '';
  217. background: #eee;
  218. width: 1px;
  219. height: 28rpx;
  220. margin-top: -14rpx;
  221. }
  222. }
  223. .listCont{
  224. display: flex;
  225. align-items: center;
  226. flex-wrap: wrap;
  227. margin-top: 15px;
  228. .item{
  229. width:50%;
  230. font-size: $uni-font-size-sm;
  231. line-height: 48rpx;
  232. overflow: hidden;
  233. white-space: nowrap;
  234. text-overflow: ellipsis;
  235. -o-text-overflow:ellipsis;
  236. color: #000;
  237. }
  238. .item text{color: #666;}
  239. }
  240. }
  241. .listBox:last-child{
  242. border:none !important;
  243. }
  244. .saveBtn{
  245. width:50%;
  246. margin:40rpx auto;
  247. }
  248. </style>