index.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388
  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">{{ 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">
  39. <div class="title">出库日期</div>
  40. <div class="nr">{{ item.shipmentDate||'' }}</div>
  41. </div>
  42. <div class="pre">
  43. <div class="title">项目订单号</div>
  44. <div class="nr">{{ item.orderNo2||'' }}</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. shipmentType:{},
  97. isOver:false,
  98. isLoading:false,
  99. params:{
  100. page:1,
  101. limit:10,
  102. orderStatus:''
  103. },
  104. dataList:[],
  105. orderList:[]
  106. }
  107. },
  108. async onLoad() {
  109. await this.selectProject();
  110. await this.getSeceiptStatus();
  111. await this.getSeceiptType();
  112. this.getDataList();
  113. },
  114. onReachBottom() {
  115. if(this.isOver) return
  116. this.getDataList();
  117. },
  118. methods:{
  119. selectProject(){
  120. this.$nextTick(()=>{
  121. this.$api.get('/wms/project/getOrderPage',{page:1,limit:-1}).then(res=>{
  122. if(res.data.code===0){
  123. this.orderList = res.data.data.list;
  124. }else this.$showToast(res.data.msg)
  125. })
  126. })
  127. },
  128. changeType(status){
  129. this.dataList = [];
  130. this.params.orderStatus = status;
  131. this.params.page = 1;
  132. this.isOver = false;
  133. this.isLoading = false;
  134. this.getDataList();
  135. },
  136. async getSeceiptStatus(){
  137. let res = await this.$api.get('/sys/dict/data/getListByType/wms_shipment_status');
  138. if(res.data.code===0){
  139. this.typeList = res.data.data;
  140. res.data.data.forEach(d=>{
  141. this.receiptStatus[d.dictValue] = d.dictLabel;
  142. })
  143. this.typeList.unshift({dictValue:'',dictLabel:'全部'})
  144. }else this.$showToast(res.data.msg)
  145. },
  146. async getSeceiptType(){
  147. let res = await this.$api.get('/sys/dict/data/getListByType/wms_shipment_type');
  148. if(res.data.code===0){
  149. res.data.data.forEach(d=>{
  150. this.shipmentType[d.dictValue] = d.dictLabel;
  151. })
  152. }else this.$showToast(res.data.msg)
  153. },
  154. getDataList(){
  155. this.isLoading = true;
  156. this.$api.get('/wms/shipmentOrder/page',this.params).then(res=>{
  157. if(res.data.code===0){
  158. if(this.dataList.length<res.data.data.total){
  159. this.params.page++;
  160. this.dataList = [...this.dataList,...res.data.data.list];
  161. this.dataList.forEach((d,i)=>{
  162. d.orderNo2 = this.orderList.find(o=>o.id==d.projectId)?.orderNo||'';
  163. this.$set(this.dataList[i],'goodsList',[]);
  164. this.$set(this.dataList[i],'goodsShow',false);
  165. })
  166. }else this.isOver = true
  167. }else this.$showModal(res.data.msg)
  168. this.isLoading = false;
  169. });
  170. },
  171. getGoodsListById(id,index){
  172. this.$set(this.dataList[index],'goodsShow',!this.dataList[index].goodsShow);
  173. if(!this.dataList[index].goodsShow) return
  174. this.$api.get('/wms/shipmentOrder/getByShipmentOrderId/'+id).then(res=>{
  175. if(res.data.code===0){
  176. this.$set(this.dataList[index],'goodsList',res.data.data);
  177. }else this.$showModal(res.msg)
  178. })
  179. },
  180. addReceipt(){
  181. uni.navigateTo({
  182. url:'/pagesStorage/outStorage/add'
  183. })
  184. }
  185. }
  186. }
  187. </script>
  188. <style scoped lang="less">
  189. .page{
  190. padding: 0 0 186rpx;
  191. background: #F4F8FB;
  192. box-sizing: border-box;
  193. .boxs{
  194. width: 100%;
  195. padding: 20rpx 24rpx 0;
  196. margin-top: 102rpx;
  197. box-sizing: border-box;
  198. .box{
  199. width: 100%;
  200. margin-top: 20rpx;
  201. background: #FFFFFF;
  202. border-radius: 16rpx;
  203. padding-bottom: 40rpx;
  204. &:first-child{
  205. margin-top: 0;
  206. }
  207. .top{
  208. width: 100%;
  209. height: 90rpx;
  210. padding: 0 24rpx;
  211. box-sizing: border-box;
  212. display: flex;
  213. align-items: center;
  214. justify-content: space-between;
  215. border-bottom: 1rpx dotted #ECECEC;
  216. text{
  217. font-family: PingFang-SC, PingFang-SC;
  218. font-weight: bold;
  219. font-size: 30rpx;
  220. color: #1D2129;
  221. line-height: 30rpx;
  222. text-align: left;
  223. }
  224. .status{
  225. font-family: PingFang-SC, PingFang-SC;
  226. font-weight: bold;
  227. font-size: 26rpx;
  228. line-height: 30rpx;
  229. text-align: right;
  230. &.wrk{
  231. color: #FEB000;
  232. }
  233. &.yrk{
  234. color: #14CC8C;
  235. }
  236. &.zf{
  237. color: #FF4141;
  238. }
  239. }
  240. }
  241. .content{
  242. width: 100%;
  243. padding: 0 24rpx 40rpx;
  244. box-sizing: border-box;
  245. display: flex;
  246. flex-wrap: wrap;
  247. .pre{
  248. width: 50%;
  249. margin-top: 36rpx;
  250. display: flex;
  251. .title{
  252. width: 126rpx;
  253. font-family: PingFangSC, PingFang SC;
  254. font-weight: 400;
  255. font-size: 24rpx;
  256. color: #86909C;
  257. text-align: left;
  258. }
  259. .nr{
  260. width: calc(100% - 126rpx);
  261. font-family: PingFangSC, PingFang SC;
  262. font-weight: bold;
  263. font-size: 26rpx;
  264. color: #1D2129;
  265. text-align: left;
  266. white-space: nowrap;
  267. text-overflow: ellipsis;
  268. overflow: hidden;
  269. &.money{
  270. color: #F95050;
  271. }
  272. }
  273. &.bfb{
  274. width: 100%;
  275. }
  276. }
  277. }
  278. .goods{
  279. width: calc(100% - 20rpx);
  280. margin: 0 auto 40rpx;
  281. .good{
  282. width: 100%;
  283. padding: 36rpx 16rpx;
  284. box-sizing: border-box;
  285. background: #F0F8FE;
  286. box-shadow: inset 0rpx -1rpx 0rpx 0rpx #ECECEC;
  287. &>div{
  288. display: flex;
  289. align-items: center;
  290. justify-content: space-between;
  291. }
  292. .name_price{
  293. text{
  294. font-family: PingFangSC, PingFang SC;
  295. font-weight: 400;
  296. font-size: 28rpx;
  297. color: #1D2129;
  298. line-height: 30rpx;
  299. text-align: left;
  300. }
  301. span{
  302. font-family: PingFang-SC, PingFang-SC;
  303. font-weight: bold;
  304. font-size: 26rpx;
  305. color: #F95050;
  306. line-height: 26rpx;
  307. text-align: right;
  308. }
  309. }
  310. .info_num{
  311. margin-top: 24rpx;
  312. .info{
  313. font-family: PingFangSC, PingFang SC;
  314. font-weight: 400;
  315. font-size: 24rpx;
  316. color: #86909C;
  317. line-height: 24rpx;
  318. text-align: left;
  319. span{
  320. color: #4E5969;
  321. }
  322. }
  323. .num{
  324. font-family: PingFangSC, PingFang SC;
  325. font-weight: 400;
  326. font-size: 24rpx;
  327. color: #86909C;
  328. line-height: 24rpx;
  329. span{
  330. font-weight: bold;
  331. font-size: 26rpx;
  332. color: #4E5969;
  333. }
  334. }
  335. }
  336. }
  337. }
  338. .more{
  339. display: flex;
  340. align-items: center;
  341. justify-content: center;
  342. text{
  343. font-family: PingFangSC, PingFang SC;
  344. font-weight: 400;
  345. font-size: 28rpx;
  346. color: #198CFF;
  347. line-height: 28rpx;
  348. }
  349. image{
  350. width: 24rpx;
  351. height: 24rpx;
  352. margin-left: 10rpx;
  353. &.sq{
  354. transform: rotate(180deg);
  355. }
  356. }
  357. }
  358. }
  359. }
  360. .add{
  361. width: 100%;
  362. height: 148rpx;
  363. padding: 20rpx 48rpx 0;
  364. box-sizing: border-box;
  365. background: #FFFFFF;
  366. position: fixed;
  367. left: 0;
  368. bottom: 0;
  369. .btn{
  370. width: 100%;
  371. height: 88rpx;
  372. background: #198CFF;
  373. border-radius: 16rpx;
  374. font-family: PingFang-SC, PingFang-SC;
  375. font-weight: bold;
  376. font-size: 32rpx;
  377. color: #FFFFFF;
  378. line-height: 88rpx;
  379. text-align: center;
  380. letter-spacing: 2rpx;
  381. }
  382. }
  383. }
  384. </style>