index.vue 9.6 KB

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