index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441
  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.updateDate||'' }}</div>
  25. </div>
  26. <div class="pre">
  27. <div class="title">操作人</div>
  28. <div class="nr">{{ item.updaterName||'' }}</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. onLoad() {
  92. 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. getSeceiptStatus(){
  109. this.$api.get('/sys/dict/data/getListByType/wms_check_status').then(res=>{
  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. },
  119. getDataList(){
  120. this.isLoading = true;
  121. this.$api.get('/wms/checkOrder/page',this.params).then(res=>{
  122. if(res.data.code===0){
  123. if(this.dataList.length<res.data.data.total){
  124. this.params.page++;
  125. this.dataList = [...this.dataList,...res.data.data.list];
  126. this.dataList.forEach((d,i)=>{
  127. d.totalQuantity = parseInt(d.totalQuantity)||0
  128. })
  129. }else this.isOver = true
  130. }else this.$showModal(res.data.msg)
  131. this.isLoading = false;
  132. });
  133. },
  134. addCheck(){
  135. uni.navigateTo({
  136. url:'/pagesStorage/checkStorage/add?warehouseId='+this.warehouseId+'&warehouseName='+this.warehouseName
  137. })
  138. },
  139. close(){
  140. this.warehouseId = '';
  141. this.warehouseName = '';
  142. this.show = false;
  143. },
  144. selectWarehouse(e){
  145. this.warehouseShow = true;
  146. this.$nextTick(()=>{
  147. this.$api.get('/wms/warehouse/page').then(res=>{
  148. if(res.data.code===0){
  149. this.warehouseList = [res.data.data.list];
  150. }else this.$showToast(res.data.msg)
  151. })
  152. })
  153. },
  154. warehouseConfirm(e){
  155. this.warehouseId = e.value[0].id;
  156. this.warehouseName = e.value[0].warehouseName;
  157. this.warehouseShow = false;
  158. }
  159. }
  160. }
  161. </script>
  162. <style scoped lang="less">
  163. .page{
  164. padding: 0 0 186rpx;
  165. background: #F4F8FB;
  166. box-sizing: border-box;
  167. .boxs{
  168. width: 100%;
  169. padding: 20rpx 24rpx 0;
  170. margin-top: 102rpx;
  171. box-sizing: border-box;
  172. .box{
  173. width: 100%;
  174. margin-top: 20rpx;
  175. background: #FFFFFF;
  176. border-radius: 16rpx;
  177. &:first-child{
  178. margin-top: 0;
  179. }
  180. .top{
  181. width: 100%;
  182. height: 90rpx;
  183. padding: 0 24rpx;
  184. box-sizing: border-box;
  185. display: flex;
  186. align-items: center;
  187. justify-content: space-between;
  188. border-bottom: 1rpx dotted #ECECEC;
  189. text{
  190. font-family: PingFang-SC, PingFang-SC;
  191. font-weight: bold;
  192. font-size: 30rpx;
  193. color: #1D2129;
  194. line-height: 30rpx;
  195. text-align: left;
  196. }
  197. .status{
  198. font-family: PingFang-SC, PingFang-SC;
  199. font-weight: bold;
  200. font-size: 26rpx;
  201. line-height: 30rpx;
  202. text-align: right;
  203. &.wrk{
  204. color: #FEB000;
  205. }
  206. &.yrk{
  207. color: #14CC8C;
  208. }
  209. &.zf{
  210. color: #FF4141;
  211. }
  212. }
  213. }
  214. .content{
  215. width: 100%;
  216. padding: 0 24rpx 40rpx;
  217. box-sizing: border-box;
  218. display: flex;
  219. flex-wrap: wrap;
  220. .pre{
  221. width: 50%;
  222. margin-top: 36rpx;
  223. display: flex;
  224. .title{
  225. width: 116rpx;
  226. font-family: PingFangSC, PingFang SC;
  227. font-weight: 400;
  228. font-size: 24rpx;
  229. color: #86909C;
  230. line-height: 24rpx;
  231. text-align: left;
  232. }
  233. .nr{
  234. width: calc(100% - 116rpx);
  235. font-family: PingFangSC, PingFang SC;
  236. font-weight: bold;
  237. font-size: 26rpx;
  238. color: #1D2129;
  239. line-height: 24rpx;
  240. text-align: left;
  241. white-space: nowrap;
  242. text-overflow: ellipsis;
  243. overflow: hidden;
  244. &.money{
  245. color: #F95050;
  246. }
  247. &.ks{
  248. color: #FF4141;
  249. }
  250. }
  251. &.bfb{
  252. width: 100%;
  253. }
  254. }
  255. }
  256. .goods{
  257. width: calc(100% - 20rpx);
  258. margin: 0 auto 40rpx;
  259. .good{
  260. width: 100%;
  261. padding: 36rpx 16rpx;
  262. box-sizing: border-box;
  263. background: #F0F8FE;
  264. box-shadow: inset 0rpx -1rpx 0rpx 0rpx #ECECEC;
  265. &>div{
  266. display: flex;
  267. align-items: center;
  268. justify-content: space-between;
  269. }
  270. .name_price{
  271. text{
  272. font-family: PingFangSC, PingFang SC;
  273. font-weight: 400;
  274. font-size: 28rpx;
  275. color: #1D2129;
  276. line-height: 30rpx;
  277. text-align: left;
  278. }
  279. span{
  280. font-family: PingFang-SC, PingFang-SC;
  281. font-weight: bold;
  282. font-size: 26rpx;
  283. color: #F95050;
  284. line-height: 26rpx;
  285. text-align: right;
  286. }
  287. }
  288. .info_num{
  289. margin-top: 24rpx;
  290. .info{
  291. font-family: PingFangSC, PingFang SC;
  292. font-weight: 400;
  293. font-size: 24rpx;
  294. color: #86909C;
  295. line-height: 24rpx;
  296. text-align: left;
  297. span{
  298. color: #4E5969;
  299. }
  300. }
  301. .num{
  302. font-family: PingFangSC, PingFang SC;
  303. font-weight: 400;
  304. font-size: 24rpx;
  305. color: #86909C;
  306. line-height: 24rpx;
  307. span{
  308. font-weight: bold;
  309. font-size: 26rpx;
  310. color: #4E5969;
  311. }
  312. }
  313. }
  314. }
  315. }
  316. .more{
  317. display: flex;
  318. align-items: center;
  319. justify-content: center;
  320. text{
  321. font-family: PingFangSC, PingFang SC;
  322. font-weight: 400;
  323. font-size: 28rpx;
  324. color: #198CFF;
  325. line-height: 28rpx;
  326. }
  327. image{
  328. width: 24rpx;
  329. height: 24rpx;
  330. margin-left: 10rpx;
  331. &.sq{
  332. transform: rotate(180deg);
  333. }
  334. }
  335. }
  336. }
  337. }
  338. .add{
  339. width: 100%;
  340. height: 148rpx;
  341. padding: 20rpx 48rpx 0;
  342. box-sizing: border-box;
  343. background: #FFFFFF;
  344. position: fixed;
  345. left: 0;
  346. bottom: 0;
  347. .btn{
  348. width: 100%;
  349. height: 88rpx;
  350. background: #198CFF;
  351. border-radius: 16rpx;
  352. font-family: PingFang-SC, PingFang-SC;
  353. font-weight: bold;
  354. font-size: 32rpx;
  355. color: #FFFFFF;
  356. line-height: 88rpx;
  357. text-align: center;
  358. letter-spacing: 2rpx;
  359. }
  360. }
  361. .select{
  362. width: 100%;
  363. padding: 48rpx 24rpx 40rpx;
  364. box-sizing: border-box;
  365. background: #FFFFFF;
  366. .title{
  367. font-family: PingFang-SC, PingFang-SC;
  368. font-weight: bold;
  369. font-size: 36rpx;
  370. color: #1D2129;
  371. line-height: 36rpx;
  372. text-align: center;
  373. position: relative;
  374. span{
  375. font-size: 36rpx;
  376. color: #999999;
  377. position: absolute;
  378. right: 24rpx;
  379. }
  380. }
  381. .storage{
  382. width: 100%;
  383. height: 90rpx;
  384. background: #FFFFFF;
  385. box-shadow: inset 0rpx -1rpx 0rpx 0rpx #ECECEC;
  386. display: flex;
  387. align-items: center;
  388. justify-content: space-between;
  389. margin-top: 127rpx;
  390. .left{
  391. font-family: PingFang-SC, PingFang-SC;
  392. font-weight: bold;
  393. font-size: 30rpx;
  394. color: #1D2129;
  395. line-height: 42rpx;
  396. text-align: left;
  397. }
  398. .right{
  399. input{
  400. font-family: PingFangSC, PingFang SC;
  401. font-weight: 400;
  402. font-size: 30rpx;
  403. color: #4E5969;
  404. line-height: 42rpx;
  405. text-align: right;
  406. }
  407. text{
  408. font-family: PingFangSC, PingFang SC;
  409. font-weight: 400;
  410. font-size: 30rpx;
  411. color: #4E5969;
  412. line-height: 42rpx;
  413. text-align: right;
  414. &.tip{
  415. color: #B9C0C8;
  416. }
  417. }
  418. }
  419. }
  420. .btn{
  421. width: 100%;
  422. height: 88rpx;
  423. background: #198CFF;
  424. border-radius: 16rpx;
  425. font-family: PingFang-SC, PingFang-SC;
  426. font-weight: bold;
  427. font-size: 32rpx;
  428. color: #FFFFFF;
  429. line-height: 88rpx;
  430. text-align: center;
  431. letter-spacing: 2rpx;
  432. margin-top: 356rpx;
  433. }
  434. }
  435. }
  436. </style>