index.vue 9.7 KB

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