index.vue 12 KB

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