index.vue 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354
  1. <template>
  2. <view class="page" :style="{'min-height':h+'px', 'padding-top':mt+'px'}">
  3. <cus-header title='移库'></cus-header>
  4. <status-tab :style="{'position':'fixed','top':mt+'px','left':'0','width':'100%'}" :list="typeList" @changeType="changeType"></status-tab>
  5. <div class="boxs" v-if="dataList.length">
  6. <div class="box" v-for="(item,index) in dataList" :key="item.id">
  7. <div class="top">
  8. <text>{{ item.orderNo||'' }}</text>
  9. <div class="status"
  10. :class="{'wrk':item.orderStatus==0,'yrk':item.orderStatus==1,'zf':item.orderStatus==-1}"
  11. >{{ movementStatus[item.orderStatus]||'' }}</div>
  12. </div>
  13. <div class="content">
  14. <div class="pre">
  15. <div class="title">总数量</div>
  16. <div class="nr">{{ item.totalQuantity||0 }}</div>
  17. </div>
  18. <div class="pre">
  19. <div class="title">总金额</div>
  20. <div class="nr money">¥{{ item.totalAmount||'' }}</div>
  21. </div>
  22. <div class="pre">
  23. <div class="title">源仓库</div>
  24. <div class="nr">{{ item.sourceWarehouseName||'' }}</div>
  25. </div>
  26. <div class="pre">
  27. <div class="title">目标仓库</div>
  28. <div class="nr">{{ item.targetWarehouseName||'' }}</div>
  29. </div>
  30. <div class="pre">
  31. <div class="title">所属项目</div>
  32. <div class="nr">{{ item.projectName||'' }}</div>
  33. </div>
  34. <div class="pre">
  35. <div class="title">移库人</div>
  36. <div class="nr">{{ item.updaterName||'' }}</div>
  37. </div>
  38. <div class="pre bfb">
  39. <div class="title">时间</div>
  40. <div class="nr">{{ item.updateDate||'' }}</div>
  41. </div>
  42. </div>
  43. <div class="goods" v-if="item.goodsList.length&&item.goodsShow">
  44. <div class="good" v-for="(good,idx) in item.goodsList" :key="good.id">
  45. <div class="name_price">
  46. <text>{{ good.item.itemName }}</text>
  47. <span>¥{{ good.amount||'' }}</span>
  48. </div>
  49. <div class="info_num">
  50. <div class="info">规格信息:<span>{{ good.itemSku.skuName }}</span></div>
  51. <div class="num">数量:<span>{{ good.quantity||0 }}</span></div>
  52. </div>
  53. </div>
  54. </div>
  55. <div class="more" @tap="getGoodsListById(item.id,index)">
  56. <text>{{ item.goodsShow?'收起':'商品明细' }}</text>
  57. <image :src="imgBase+'storage/icon_jtdown_blue.png'" :class="{'sq':item.goodsShow}"></image>
  58. </div>
  59. </div>
  60. <page-loading :loading="isLoading"></page-loading>
  61. </div>
  62. <template v-else>
  63. <page-empty :height="'calc(100vh - 200px)'"></page-empty>
  64. </template>
  65. <div class="add">
  66. <div class="btn" @tap="addReceipt">新增移库单</div>
  67. </div>
  68. </view>
  69. </template>
  70. <script>
  71. import statusTab from '../components/statusTab/index.vue'
  72. import pageLoading from '../components/pageLoading/index.vue'
  73. import pageEmpty from '../components/pageEmpty/index.vue'
  74. export default {
  75. components:{
  76. statusTab,
  77. pageLoading,
  78. pageEmpty
  79. },
  80. data(){
  81. return {
  82. typeList:[],
  83. movementStatus:{},
  84. isOver:false,
  85. isLoading:false,
  86. params:{
  87. page:1,
  88. limit:10,
  89. orderStatus:''
  90. },
  91. dataList:[],
  92. }
  93. },
  94. async onLoad() {
  95. await this.getMovementStatus();
  96. this.getDataList();
  97. },
  98. onReachBottom() {
  99. if(this.isOver) return
  100. this.getDataList();
  101. },
  102. methods:{
  103. changeType(status){
  104. this.dataList = [];
  105. this.params.orderStatus = status;
  106. this.params.page = 1;
  107. this.isOver = false;
  108. this.isLoading = false;
  109. this.getDataList();
  110. },
  111. async getMovementStatus(){
  112. let res = await this.$api.get('/sys/dict/data/getListByType/wms_movement_status');
  113. if(res.data.code===0){
  114. this.typeList = res.data.data;
  115. res.data.data.forEach(d=>{
  116. this.movementStatus[d.dictValue] = d.dictLabel;
  117. })
  118. this.typeList.unshift({dictValue:'',dictLabel:'全部'})
  119. }else this.$showToast(res.data.msg)
  120. },
  121. getDataList(){
  122. this.isLoading = true;
  123. this.$api.get('/wms/movementOrder/page',this.params).then(res=>{
  124. if(res.data.code===0){
  125. if(this.dataList.length<res.data.data.total){
  126. this.params.page++;
  127. this.dataList = [...this.dataList,...res.data.data.list];
  128. this.dataList.forEach((d,i)=>{
  129. this.$set(this.dataList[i],'goodsList',[]);
  130. this.$set(this.dataList[i],'goodsShow',false);
  131. })
  132. }else this.isOver = true
  133. }else this.$showModal(res.data.msg)
  134. this.isLoading = false;
  135. });
  136. },
  137. getGoodsListById(id,index){
  138. this.$set(this.dataList[index],'goodsShow',!this.dataList[index].goodsShow);
  139. if(!this.dataList[index].goodsShow) return
  140. this.$api.get('/wms/movementOrder/getByMovementOrderId/'+id).then(res=>{
  141. if(res.data.code===0){
  142. this.$set(this.dataList[index],'goodsList',res.data.data);
  143. }else this.$showModal(res.msg)
  144. })
  145. },
  146. addReceipt(){
  147. uni.navigateTo({
  148. url:'/pagesStorage/moveStorage/add'
  149. })
  150. }
  151. }
  152. }
  153. </script>
  154. <style scoped lang="less">
  155. .page{
  156. padding: 0 0 186rpx;
  157. background: #F4F8FB;
  158. box-sizing: border-box;
  159. .boxs{
  160. width: 100%;
  161. padding: 20rpx 24rpx 0;
  162. margin-top: 102rpx;
  163. box-sizing: border-box;
  164. .box{
  165. width: 100%;
  166. margin-top: 20rpx;
  167. background: #FFFFFF;
  168. border-radius: 16rpx;
  169. padding-bottom: 40rpx;
  170. &:first-child{
  171. margin-top: 0;
  172. }
  173. .top{
  174. width: 100%;
  175. height: 90rpx;
  176. padding: 0 24rpx;
  177. box-sizing: border-box;
  178. display: flex;
  179. align-items: center;
  180. justify-content: space-between;
  181. border-bottom: 1rpx dotted #ECECEC;
  182. text{
  183. font-family: PingFang-SC, PingFang-SC;
  184. font-weight: bold;
  185. font-size: 30rpx;
  186. color: #1D2129;
  187. line-height: 30rpx;
  188. text-align: left;
  189. }
  190. .status{
  191. font-family: PingFang-SC, PingFang-SC;
  192. font-weight: bold;
  193. font-size: 26rpx;
  194. line-height: 30rpx;
  195. text-align: right;
  196. &.wrk{
  197. color: #FEB000;
  198. }
  199. &.yrk{
  200. color: #14CC8C;
  201. }
  202. &.zf{
  203. color: #FF4141;
  204. }
  205. }
  206. }
  207. .content{
  208. width: 100%;
  209. padding: 0 24rpx 40rpx;
  210. box-sizing: border-box;
  211. display: flex;
  212. flex-wrap: wrap;
  213. .pre{
  214. width: 50%;
  215. margin-top: 36rpx;
  216. display: flex;
  217. .title{
  218. width: 116rpx;
  219. font-family: PingFangSC, PingFang SC;
  220. font-weight: 400;
  221. font-size: 24rpx;
  222. color: #86909C;
  223. text-align: left;
  224. }
  225. .nr{
  226. width: calc(100% - 116rpx);
  227. font-family: PingFangSC, PingFang SC;
  228. font-weight: bold;
  229. font-size: 26rpx;
  230. color: #1D2129;
  231. text-align: left;
  232. white-space: nowrap;
  233. text-overflow: ellipsis;
  234. overflow: hidden;
  235. &.money{
  236. color: #F95050;
  237. }
  238. }
  239. &.bfb{
  240. width: 100%;
  241. }
  242. }
  243. }
  244. .goods{
  245. width: calc(100% - 20rpx);
  246. margin: 0 auto 40rpx;
  247. .good{
  248. width: 100%;
  249. padding: 36rpx 16rpx;
  250. box-sizing: border-box;
  251. background: #F0F8FE;
  252. box-shadow: inset 0rpx -1rpx 0rpx 0rpx #ECECEC;
  253. &>div{
  254. display: flex;
  255. align-items: center;
  256. justify-content: space-between;
  257. }
  258. .name_price{
  259. text{
  260. font-family: PingFangSC, PingFang SC;
  261. font-weight: 400;
  262. font-size: 28rpx;
  263. color: #1D2129;
  264. line-height: 30rpx;
  265. text-align: left;
  266. }
  267. span{
  268. font-family: PingFang-SC, PingFang-SC;
  269. font-weight: bold;
  270. font-size: 26rpx;
  271. color: #F95050;
  272. line-height: 26rpx;
  273. text-align: right;
  274. }
  275. }
  276. .info_num{
  277. margin-top: 24rpx;
  278. .info{
  279. font-family: PingFangSC, PingFang SC;
  280. font-weight: 400;
  281. font-size: 24rpx;
  282. color: #86909C;
  283. line-height: 24rpx;
  284. text-align: left;
  285. span{
  286. color: #4E5969;
  287. }
  288. }
  289. .num{
  290. font-family: PingFangSC, PingFang SC;
  291. font-weight: 400;
  292. font-size: 24rpx;
  293. color: #86909C;
  294. line-height: 24rpx;
  295. span{
  296. font-weight: bold;
  297. font-size: 26rpx;
  298. color: #4E5969;
  299. }
  300. }
  301. }
  302. }
  303. }
  304. .more{
  305. display: flex;
  306. align-items: center;
  307. justify-content: center;
  308. text{
  309. font-family: PingFangSC, PingFang SC;
  310. font-weight: 400;
  311. font-size: 28rpx;
  312. color: #198CFF;
  313. line-height: 28rpx;
  314. }
  315. image{
  316. width: 24rpx;
  317. height: 24rpx;
  318. margin-left: 10rpx;
  319. &.sq{
  320. transform: rotate(180deg);
  321. }
  322. }
  323. }
  324. }
  325. }
  326. .add{
  327. width: 100%;
  328. height: 148rpx;
  329. padding: 20rpx 48rpx 0;
  330. box-sizing: border-box;
  331. background: #FFFFFF;
  332. position: fixed;
  333. left: 0;
  334. bottom: 0;
  335. .btn{
  336. width: 100%;
  337. height: 88rpx;
  338. background: #198CFF;
  339. border-radius: 16rpx;
  340. font-family: PingFang-SC, PingFang-SC;
  341. font-weight: bold;
  342. font-size: 32rpx;
  343. color: #FFFFFF;
  344. line-height: 88rpx;
  345. text-align: center;
  346. letter-spacing: 2rpx;
  347. }
  348. }
  349. }
  350. </style>