warehouse-deliver-goods.html 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>仓库管理-发货-创业帮</title>
  6. <meta name="keywords" content="仓库管理-发货-创业帮">
  7. <meta name="description" content="仓库管理-发货-创业帮">
  8. <meta content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,shrink-to-fit=no,user-scalable=no" name="viewport" viewport="cover">
  9. <meta name="apple-mobile-web-app-capable" content="yes">
  10. <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
  11. <meta content="telephone=no" name="format-detection">
  12. <meta content="email=no" name="format-detection">
  13. <meta name="apple-mobile-web-app-title" content="仓库管理-发货-创业帮">
  14. <meta http-equiv="Cache-Control" content="no-siteapp">
  15. <link rel="stylesheet" href="./static/css/main.css">
  16. <style>
  17. .mall-bottom{padding:0 .3733rem;height:54px;}
  18. .mall-bottom button{border-radius:999px !important; height:80% !important;}
  19. </style>
  20. </head>
  21. <body class="pt0 pb0" style="padding-top:0;">
  22. <div class="warehouse rel h100p" id="app" v-cloak>
  23. <van-nav-bar class="user_rank_explan_title user_title_normal titlef16 rightc333" left-arrow :title="title" v-if="toptitleisshow" @click-left="goback">
  24. <template #left> <img src="./static/images/left.png" alt=""></template>
  25. </van-nav-bar>
  26. <van-notice-bar wrapable color="#eea75b" :scrollable="false" text="请仔细与包装盒或者整箱机具的SN号进行对比,确认无误再划拨"></van-notice-bar>
  27. <div class="van-tabs__content pl16 pr16 mt16">
  28. <div class="userinfopanel df panel">
  29. <div class="info f14 c333" id="copyob">
  30. <div class="item">{{userinfo.ProductName}}:<span class="ml4">{{userinfo.BuyCount}}台 </span></div>
  31. <div class="item">{{userinfo.CreateDate}}</div>
  32. <div class="item">{{userinfo.RealName}}<span class="ml4">{{userinfo.Mobile}}</span></div>
  33. <div class="item">{{userinfo.Areas}}{{userinfo.Address}}</div>
  34. <div class="item">提货方式:<span class="ml4 spcolor">{{userinfo.DeliveryType}}</span></div>
  35. </div>
  36. <div class="copy tc f14" :data-clipboard-text="userinfo.RealName +' '+ userinfo.Mobile + ' ' + userinfo.Areas+userinfo.Address" data-clipboard-action="copy" ref="copy" @click="copyinfo" @mouseenter="copyinfo">
  37. <div>复制收件信息 </div>
  38. <div>(姓名、电话、信息)</div>
  39. </div>
  40. </div>
  41. <div class="option df f14 top_line">
  42. <div class="c333">划拨方式</div>
  43. <button class="bgcfff" @click="transfer('逐台划拨')">逐台划拨</button>
  44. <button class="bgcfff" @click="transfer('整箱划拨')">整箱划拨</button>
  45. </div>
  46. <div class="snlist f16">
  47. <div class="undatatips tc c999" v-if="snlist.length === 0">暂无SN数据</div>
  48. <van-cell-group>
  49. <van-cell v-for="(item, index) in snlist" :key="item.Id" clickable :title="`SN码: ${item.PosSn}`"></van-cell>
  50. </van-cell-group>
  51. </div>
  52. </div>
  53. <van-goods-action class="mall-bottom">
  54. <van-goods-action-button class="kxs-btn" type="default" color="#FFD500" text="划拨" @click="posttransfer"></van-goods-action-button>
  55. </van-goods-action>
  56. </div>
  57. <script src="./static/js/clipboard.min.js"></script>
  58. <script src="./static/js/klm-vv.min.js"></script>
  59. <script src="./static/js/appfunc.min.js"></script>
  60. <script src="./static/js/klm-axios-config.js"></script>
  61. <script src="./static/js/publicfn.js"></script>
  62. <script>
  63. function OnStart(){
  64. app.onstartfn();
  65. };
  66. // 通过 CDN 引入时不会自动注册 Lazyload 组件
  67. // 可以通过下面的方式手动注册
  68. Vue.use(vant.Lazyload);
  69. // 在 #app 标签下渲染一个按钮组件
  70. let app = new Vue({
  71. el: '#app',
  72. data() {
  73. return {
  74. toptitleisshow:false,
  75. title:'',
  76. active: 1,
  77. //- 下拉刷新
  78. loading: false,
  79. finished: false,
  80. refreshing: false,
  81. show:false,
  82. preView:false,
  83. preViewUrl:'',
  84. userinfo:{},
  85. snlist: [
  86. ],
  87. };
  88. },
  89. async created() {
  90. this.title = PublicLib.getCookieInfo('warehouseName');
  91. this.toptitleisshow = toptitleisshow;
  92. this.getorderdetail();
  93. PublicLib.SetTitle({Title:PublicLib.getCookieInfo('warehouseName')});
  94. this.onstartfn();
  95. },
  96. methods: {
  97. async onstartfn(){
  98. if(PublicLib.getCookieInfo('transferType') === '逐台划拨' && PublicLib.getCookieInfo('warehouseisback') === 'true'){
  99. PublicLib.putCookieInfo('warehouseisback', '');
  100. this.snlist = JSON.parse(PublicLib.getCookieInfo('warehouseSnList'));
  101. }else if(PublicLib.getCookieInfo('transferType') === '整箱划拨' && PublicLib.getCookieInfo('warehouseisback') === 'true'){
  102. PublicLib.putCookieInfo('warehouseisback', '');
  103. this.snlist = JSON.parse(PublicLib.getCookieInfo('warehouseSnList'));
  104. };
  105. const num = this.userinfo.BuyCount;
  106. this.snlist.splice( num , this.snlist.length - num);
  107. PublicLib.putCookieInfo('warehouseSnList', JSON.stringify([]));
  108. },
  109. giveToast(str){
  110. vant.Toast(str);
  111. },
  112. copyinfo(){
  113. const that = this;
  114. const clipboard = new ClipboardJS(this.$refs.copy);
  115. clipboard.on('success', function(e) {
  116. that.giveToast('复制成功');
  117. });
  118. clipboard.on('error', function(e) {
  119. that.giveToast('复制失败,请手动选择复制!');
  120. });
  121. },
  122. async getorderdetail(){
  123. //- PublicLib.ShowLoading({Message:''});
  124. const Id = PublicLib.getCookieInfo('orderId');
  125. const res = await getRequest('api/v1/orders/storeorderdetail?t='+Math.random(6),JSON.stringify({Id}));
  126. if(res.status !== '1') return tips('获取订单详情失败');
  127. //- PublicLib.HideLoading();
  128. this.userinfo = res.data;
  129. },
  130. preview(url){
  131. this.preViewUrl = url
  132. this.preView = true
  133. },
  134. goback(){
  135. PublicLib.GoBack({Level:1});
  136. },
  137. //- 跳转划拨搜索
  138. transfer(type){
  139. PublicLib.putCookieInfo('transferType', type);
  140. PublicLib.Goto({Url:'warehouse-deliver-transfer'});
  141. },
  142. snnolist(){
  143. return this.snlist.map(item=>item.Id).join(',');
  144. },
  145. backOrder(){
  146. this.show = true
  147. },
  148. //- 划拨
  149. async posttransfer(){
  150. if(this.snlist.length === 0) return tips('请先选择划拨SN号!');
  151. if(this.snlist.length !== Number(this.userinfo.BuyCount)) return tips('请选择订单数量SN号进行划拨!');
  152. const StoreId = PublicLib.getCookieInfo('warehouseId');
  153. const OrderId = PublicLib.getCookieInfo('orderId');
  154. let res = null;
  155. switch(PublicLib.getCookieInfo('transferType')) {
  156. case '逐台划拨':
  157. res = await postRequest('api/v1/storestockchange/transferone?t='+Math.random(6),JSON.stringify({ToUserId:this.userinfo.UserId,StoreId,SnIds:this.snnolist(),OrderId}));
  158. break;
  159. case '整箱划拨':
  160. res = await postRequest('api/v1/storestockchange/transferwhole?t='+Math.random(6),JSON.stringify({ToUserId:this.userinfo.UserId,StoreId,SnNo:this.snnolist(),OrderId}));
  161. break;
  162. };
  163. if(res.status !== '1') return tips('机具划拨失败,请重试!');
  164. tips('机具划拨成功');
  165. this.snlist = [];
  166. setTimeout(()=>{
  167. PublicLib.GoBack({Level:1});
  168. },2000)
  169. },
  170. }
  171. });
  172. </script>
  173. </body>
  174. </html>