index.vue 9.5 KB

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