index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438
  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. >{{ receiptStatus[item.orderStatus]||'' }}</div>
  12. </div>
  13. <div class="content">
  14. <div class="pre">
  15. <div class="title">仓库</div>
  16. <div class="nr">{{ item.warehouseName||'' }}</div>
  17. </div>
  18. <div class="pre">
  19. <div class="title">盈亏数</div>
  20. <div class="nr" :class="{'ks':item.totalQuantity<0}">{{ item.totalQuantity||'' }}</div>
  21. </div>
  22. <div class="pre">
  23. <div class="title">盘库人</div>
  24. <div class="nr">{{ item.updaterName||'' }}</div>
  25. </div>
  26. <div class="pre bfb">
  27. <div class="title">时间</div>
  28. <div class="nr">{{ item.updateDate||'' }}</div>
  29. </div>
  30. </div>
  31. </div>
  32. <page-loading :loading="isLoading"></page-loading>
  33. </div>
  34. <template v-else>
  35. <page-empty :height="'calc(100vh - 200px)'"></page-empty>
  36. </template>
  37. <div class="add">
  38. <div class="btn" @tap="show=true">盘库</div>
  39. </div>
  40. <u-popup :show="show" mode="bottom" @close="close">
  41. <div class="select">
  42. <div class="title">
  43. 选择仓库
  44. <span @tap="close">X</span>
  45. </div>
  46. <div class="storage">
  47. <div class="left">仓库</div>
  48. <div class="right" @tap="selectWarehouse">
  49. <text v-if="warehouseName">{{warehouseName}} ></text>
  50. <text class="tip" v-else>请选择仓库 ></text>
  51. </div>
  52. </div>
  53. <div class="btn" @tap="addCheck">确定</div>
  54. </div>
  55. </u-popup>
  56. <u-picker title="仓库" :show="warehouseShow" :columns="warehouseList" keyName="warehouseName"
  57. @cancel="warehouseShow=false" @confirm="warehouseConfirm">
  58. </u-picker>
  59. </view>
  60. </template>
  61. <script>
  62. import statusTab from '../components/statusTab/index.vue'
  63. import pageLoading from '../components/pageLoading/index.vue'
  64. import pageEmpty from '../components/pageEmpty/index.vue'
  65. export default {
  66. components:{
  67. statusTab,
  68. pageLoading,
  69. pageEmpty
  70. },
  71. data(){
  72. return {
  73. typeList:[],
  74. receiptStatus:{},
  75. receiptType:{},
  76. isOver:false,
  77. isLoading:false,
  78. params:{
  79. page:1,
  80. limit:10,
  81. orderStatus:''
  82. },
  83. dataList:[],
  84. show:false,
  85. warehouseId:'',
  86. warehouseName:'',
  87. warehouseShow:false,
  88. warehouseList:[]
  89. }
  90. },
  91. async onLoad() {
  92. await this.getSeceiptStatus();
  93. this.getDataList();
  94. },
  95. onReachBottom() {
  96. if(this.isOver) return
  97. this.getDataList();
  98. },
  99. methods:{
  100. changeType(status){
  101. this.dataList = [];
  102. this.params.orderStatus = status;
  103. this.params.page = 1;
  104. this.isOver = false;
  105. this.isLoading = false;
  106. this.getDataList();
  107. },
  108. async getSeceiptStatus(){
  109. let res = await this.$api.get('/sys/dict/data/getListByType/wms_check_status');
  110. if(res.data.code===0){
  111. this.typeList = res.data.data;
  112. res.data.data.forEach(d=>{
  113. this.receiptStatus[d.dictValue] = d.dictLabel;
  114. })
  115. this.typeList.unshift({dictValue:'',dictLabel:'全部'})
  116. }else this.$showToast(res.data.msg)
  117. },
  118. getDataList(){
  119. this.isLoading = true;
  120. this.$api.get('/wms/checkOrder/page',this.params).then(res=>{
  121. if(res.data.code===0){
  122. if(this.dataList.length<res.data.data.total){
  123. this.params.page++;
  124. this.dataList = [...this.dataList,...res.data.data.list];
  125. this.dataList.forEach((d,i)=>{
  126. d.totalQuantity = parseInt(d.totalQuantity)||0
  127. })
  128. }else this.isOver = true
  129. }else this.$showModal(res.data.msg)
  130. this.isLoading = false;
  131. });
  132. },
  133. addCheck(){
  134. uni.navigateTo({
  135. url:'/pagesStorage/checkStorage/add?warehouseId='+this.warehouseId+'&warehouseName='+this.warehouseName
  136. })
  137. },
  138. close(){
  139. this.warehouseId = '';
  140. this.warehouseName = '';
  141. this.show = false;
  142. },
  143. selectWarehouse(e){
  144. this.warehouseShow = true;
  145. this.$nextTick(()=>{
  146. this.$api.get('/wms/warehouse/page').then(res=>{
  147. if(res.data.code===0){
  148. this.warehouseList = [res.data.data.list];
  149. }else this.$showToast(res.data.msg)
  150. })
  151. })
  152. },
  153. warehouseConfirm(e){
  154. this.warehouseId = e.value[0].id;
  155. this.warehouseName = e.value[0].warehouseName;
  156. this.warehouseShow = false;
  157. }
  158. }
  159. }
  160. </script>
  161. <style scoped lang="less">
  162. .page{
  163. padding: 0 0 186rpx;
  164. background: #F4F8FB;
  165. box-sizing: border-box;
  166. .boxs{
  167. width: 100%;
  168. padding: 20rpx 24rpx 0;
  169. margin-top: 102rpx;
  170. box-sizing: border-box;
  171. .box{
  172. width: 100%;
  173. margin-top: 20rpx;
  174. background: #FFFFFF;
  175. border-radius: 16rpx;
  176. &:first-child{
  177. margin-top: 0;
  178. }
  179. .top{
  180. width: 100%;
  181. height: 90rpx;
  182. padding: 0 24rpx;
  183. box-sizing: border-box;
  184. display: flex;
  185. align-items: center;
  186. justify-content: space-between;
  187. border-bottom: 1rpx dotted #ECECEC;
  188. text{
  189. font-family: PingFang-SC, PingFang-SC;
  190. font-weight: bold;
  191. font-size: 30rpx;
  192. color: #1D2129;
  193. line-height: 30rpx;
  194. text-align: left;
  195. }
  196. .status{
  197. font-family: PingFang-SC, PingFang-SC;
  198. font-weight: bold;
  199. font-size: 26rpx;
  200. line-height: 30rpx;
  201. text-align: right;
  202. &.wrk{
  203. color: #FEB000;
  204. }
  205. &.yrk{
  206. color: #14CC8C;
  207. }
  208. &.zf{
  209. color: #FF4141;
  210. }
  211. }
  212. }
  213. .content{
  214. width: 100%;
  215. padding: 0 24rpx 40rpx;
  216. box-sizing: border-box;
  217. display: flex;
  218. flex-wrap: wrap;
  219. .pre{
  220. width: 50%;
  221. margin-top: 36rpx;
  222. display: flex;
  223. .title{
  224. width: 116rpx;
  225. font-family: PingFangSC, PingFang SC;
  226. font-weight: 400;
  227. font-size: 24rpx;
  228. color: #86909C;
  229. text-align: left;
  230. }
  231. .nr{
  232. width: calc(100% - 116rpx);
  233. font-family: PingFangSC, PingFang SC;
  234. font-weight: bold;
  235. font-size: 26rpx;
  236. color: #1D2129;
  237. text-align: left;
  238. white-space: nowrap;
  239. text-overflow: ellipsis;
  240. overflow: hidden;
  241. &.money{
  242. color: #F95050;
  243. }
  244. &.ks{
  245. color: #FF4141;
  246. }
  247. }
  248. &.bfb{
  249. width: 100%;
  250. }
  251. }
  252. }
  253. .goods{
  254. width: calc(100% - 20rpx);
  255. margin: 0 auto 40rpx;
  256. .good{
  257. width: 100%;
  258. padding: 36rpx 16rpx;
  259. box-sizing: border-box;
  260. background: #F0F8FE;
  261. box-shadow: inset 0rpx -1rpx 0rpx 0rpx #ECECEC;
  262. &>div{
  263. display: flex;
  264. align-items: center;
  265. justify-content: space-between;
  266. }
  267. .name_price{
  268. text{
  269. font-family: PingFangSC, PingFang SC;
  270. font-weight: 400;
  271. font-size: 28rpx;
  272. color: #1D2129;
  273. line-height: 30rpx;
  274. text-align: left;
  275. }
  276. span{
  277. font-family: PingFang-SC, PingFang-SC;
  278. font-weight: bold;
  279. font-size: 26rpx;
  280. color: #F95050;
  281. line-height: 26rpx;
  282. text-align: right;
  283. }
  284. }
  285. .info_num{
  286. margin-top: 24rpx;
  287. .info{
  288. font-family: PingFangSC, PingFang SC;
  289. font-weight: 400;
  290. font-size: 24rpx;
  291. color: #86909C;
  292. line-height: 24rpx;
  293. text-align: left;
  294. span{
  295. color: #4E5969;
  296. }
  297. }
  298. .num{
  299. font-family: PingFangSC, PingFang SC;
  300. font-weight: 400;
  301. font-size: 24rpx;
  302. color: #86909C;
  303. line-height: 24rpx;
  304. span{
  305. font-weight: bold;
  306. font-size: 26rpx;
  307. color: #4E5969;
  308. }
  309. }
  310. }
  311. }
  312. }
  313. .more{
  314. display: flex;
  315. align-items: center;
  316. justify-content: center;
  317. text{
  318. font-family: PingFangSC, PingFang SC;
  319. font-weight: 400;
  320. font-size: 28rpx;
  321. color: #198CFF;
  322. line-height: 28rpx;
  323. }
  324. image{
  325. width: 24rpx;
  326. height: 24rpx;
  327. margin-left: 10rpx;
  328. &.sq{
  329. transform: rotate(180deg);
  330. }
  331. }
  332. }
  333. }
  334. }
  335. .add{
  336. width: 100%;
  337. height: 148rpx;
  338. padding: 20rpx 48rpx 0;
  339. box-sizing: border-box;
  340. background: #FFFFFF;
  341. position: fixed;
  342. left: 0;
  343. bottom: 0;
  344. .btn{
  345. width: 100%;
  346. height: 88rpx;
  347. background: #198CFF;
  348. border-radius: 16rpx;
  349. font-family: PingFang-SC, PingFang-SC;
  350. font-weight: bold;
  351. font-size: 32rpx;
  352. color: #FFFFFF;
  353. line-height: 88rpx;
  354. text-align: center;
  355. letter-spacing: 2rpx;
  356. }
  357. }
  358. .select{
  359. width: 100%;
  360. padding: 48rpx 24rpx 40rpx;
  361. box-sizing: border-box;
  362. background: #FFFFFF;
  363. .title{
  364. font-family: PingFang-SC, PingFang-SC;
  365. font-weight: bold;
  366. font-size: 36rpx;
  367. color: #1D2129;
  368. line-height: 36rpx;
  369. text-align: center;
  370. position: relative;
  371. span{
  372. font-size: 36rpx;
  373. color: #999999;
  374. position: absolute;
  375. right: 24rpx;
  376. }
  377. }
  378. .storage{
  379. width: 100%;
  380. height: 90rpx;
  381. background: #FFFFFF;
  382. box-shadow: inset 0rpx -1rpx 0rpx 0rpx #ECECEC;
  383. display: flex;
  384. align-items: center;
  385. justify-content: space-between;
  386. margin-top: 127rpx;
  387. .left{
  388. font-family: PingFang-SC, PingFang-SC;
  389. font-weight: bold;
  390. font-size: 30rpx;
  391. color: #1D2129;
  392. line-height: 42rpx;
  393. text-align: left;
  394. }
  395. .right{
  396. input{
  397. font-family: PingFangSC, PingFang SC;
  398. font-weight: 400;
  399. font-size: 30rpx;
  400. color: #4E5969;
  401. line-height: 42rpx;
  402. text-align: right;
  403. }
  404. text{
  405. font-family: PingFangSC, PingFang SC;
  406. font-weight: 400;
  407. font-size: 30rpx;
  408. color: #4E5969;
  409. line-height: 42rpx;
  410. text-align: right;
  411. &.tip{
  412. color: #B9C0C8;
  413. }
  414. }
  415. }
  416. }
  417. .btn{
  418. width: 100%;
  419. height: 88rpx;
  420. background: #198CFF;
  421. border-radius: 16rpx;
  422. font-family: PingFang-SC, PingFang-SC;
  423. font-weight: bold;
  424. font-size: 32rpx;
  425. color: #FFFFFF;
  426. line-height: 88rpx;
  427. text-align: center;
  428. letter-spacing: 2rpx;
  429. margin-top: 356rpx;
  430. }
  431. }
  432. }
  433. </style>