index.vue 9.9 KB

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