warehouse-deliver-goods-getset.html 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  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="option df f14">
  29. <div class="c333">划拨方式</div>
  30. <button class="bgcfff" @click="transfer('逐台划拨')">逐台发货</button>
  31. <button class="bgcfff" @click="transfer('整箱划拨')">批量发货</button>
  32. </div>
  33. <div class="snlist f16">
  34. <div class="undatatips tc c999" v-if="snlist.length === 0">暂无SN数据</div>
  35. <van-cell-group>
  36. <van-cell v-for="(item, index) in snlist" :key="item.Id" clickable :title="`SN码: ${item.PosSn}`"></van-cell>
  37. </van-cell-group>
  38. </div>
  39. </div>
  40. <van-goods-action class="mall-bottom">
  41. <van-goods-action-button class="kxs-btn" type="default" color="#FFD500" text="确认发货" @click="posttransfer"></van-goods-action-button>
  42. </van-goods-action>
  43. <van-overlay :show="nextshow" @click="closenextshow">
  44. <div class="unbindpop cm">
  45. <div class="unbindcard tc" @click.stop>
  46. <div class="f12 tc c666 title">总共划拨{{snlist.length}}台,请仔细核对SN号及姓名是否正确</div>
  47. <input type="text" v-model="createercode" placeholder="请输入创客编号" @focus="inputbtn">
  48. <div class="f10" v-if="isget" style="color:#D43030;">{{errinfo}}</div>
  49. <div class="f12 tc c333 title" v-if="createrinfo.RealName !== ''">姓名:{{createrinfo.RealName}}</div>
  50. <div class="f12 tc c333 title" v-if="createrinfo.RealName !== ''">该创客已有{{sncount}}台预发机</div>
  51. <div class="nextbutton cfff cm mt16 f14" @click="diaolignextbtn" style="color:#333;">{{createrinfo.RealName === ''? '下一步' : '确认无误划拨'}}</div>
  52. </div>
  53. </div>
  54. </van-overlay>
  55. </div>
  56. <script src="./static/js/clipboard.min.js"></script>
  57. <script src="./static/js/klm-vv.min.js"></script>
  58. <script src="./static/js/appfunc.min.js"></script>
  59. <script src="./static/js/klm-axios-config.js"></script>
  60. <script src="./static/js/publicfn.js"></script>
  61. <script>
  62. function OnStart(){
  63. app.onstartfn();
  64. };
  65. // 通过 CDN 引入时不会自动注册 Lazyload 组件
  66. // 可以通过下面的方式手动注册
  67. Vue.use(vant.Lazyload);
  68. // 在 #app 标签下渲染一个按钮组件
  69. let app = new Vue({
  70. el: '#app',
  71. data() {
  72. return {
  73. nextshow:false,
  74. toptitleisshow:false,
  75. title:'',
  76. active: 1,
  77. //- 下拉刷新
  78. loading: false,
  79. finished: false,
  80. refreshing: false,
  81. show:false,
  82. userinfo:{},
  83. createercode:'',
  84. errinfo:'',
  85. isget:false,
  86. sncount:0,
  87. createrinfo:{
  88. RealName:'',
  89. Id:'',
  90. },
  91. snlist: [
  92. ],
  93. };
  94. },
  95. async created() {
  96. this.title = PublicLib.getCookieInfo('warehouseName');
  97. this.toptitleisshow = toptitleisshow;
  98. PublicLib.SetTitle({Title:PublicLib.getCookieInfo('warehouseName')});
  99. this.onstartfn();
  100. },
  101. methods: {
  102. diaolignextbtn:undebounce(async function(){
  103. this.isget = false;
  104. if(this.createercode === '') return tips('请输入创客编号');
  105. if(this.createrinfo.RealName === '') {
  106. const res = await getRequest('api/v1/users/forcode?t='+Math.random(6),JSON.stringify({MakerCode:this.createercode}));
  107. if(res.status !== '1')return tips(res.info);
  108. this.createrinfo = res.data;
  109. const FromUserId = PublicLib.getCookieInfo('userId');
  110. const FromStoreId = PublicLib.getCookieInfo('warehouseId');
  111. const sncount = await getRequest('api/v1/pos/smallstorehouse/detail?t='+Math.random(6),JSON.stringify({MakerCode:this.createercode,FromUserId,FromStoreId}));
  112. this.sncount = sncount.data.TotalNum;
  113. } else{
  114. if(!this.createrinfo.RealName){
  115. return tips('请输入正确的创客编号!');
  116. };
  117. const FromStoreId = PublicLib.getCookieInfo('warehouseId');
  118. const BrandId = PublicLib.getCookieInfo('brandId');
  119. const UserId = PublicLib.getCookieInfo('userId');
  120. const res = await postRequest('/api/v1/pos/presendstockdetail/send?t='+Math.random(6),JSON.stringify({UserId,FromStoreId,SnIds:this.snnolist(),ToUserId:this.createrinfo.Id,BrandId}));
  121. if(res.status !== '1'){this.isget = true;return this.errinfo = res.info;};
  122. tips('预发机发货成功,请提醒创客签收');
  123. this.nextshow = false;
  124. this.createrinfo = {RealName:'',Id:''};
  125. this.createercode = '';
  126. this.errinfo = '';
  127. setTimeout(()=>{
  128. this.goback();
  129. },2000);
  130. }
  131. }),
  132. inputbtn(){
  133. this.createrinfo.RealName = '';
  134. },
  135. closenextshow(){
  136. this.nextshow = false;
  137. this.createercode = '';
  138. this.createrinfo.RealName = '';
  139. this.errinfo = '';
  140. },
  141. async onstartfn(){
  142. if(PublicLib.getCookieInfo('transferType') === '逐台划拨' && PublicLib.getCookieInfo('warehouseisback') === 'true'){
  143. PublicLib.putCookieInfo('warehouseisback', '');
  144. this.snlist = JSON.parse(PublicLib.getCookieInfo('warehouseSnList'));
  145. }else if(PublicLib.getCookieInfo('transferType') === '整箱划拨' && PublicLib.getCookieInfo('warehouseisback') === 'true'){
  146. PublicLib.putCookieInfo('warehouseisback', '');
  147. this.snlist = JSON.parse(PublicLib.getCookieInfo('warehouseSnList'));
  148. };
  149. const num = 0;
  150. this.snlist.splice( 10 , this.snlist.length - 10);
  151. PublicLib.putCookieInfo('warehouseSnList', JSON.stringify([]));
  152. },
  153. giveToast(str){
  154. vant.Toast(str);
  155. },
  156. copyinfo(){
  157. const that = this;
  158. const clipboard = new ClipboardJS(this.$refs.copy);
  159. clipboard.on('success', function(e) {
  160. that.giveToast('复制成功');
  161. });
  162. clipboard.on('error', function(e) {
  163. that.giveToast('复制失败,请手动选择复制!');
  164. });
  165. },
  166. goback(){
  167. PublicLib.GoBack({Level:1});
  168. },
  169. //- 跳转划拨搜索
  170. transfer(type){
  171. PublicLib.putCookieInfo('transferType', type);
  172. PublicLib.Goto({Url:'warehouse-deliver-transfer'});
  173. },
  174. snnolist(){
  175. return this.snlist.map(item=>item.Id).join(',');
  176. },
  177. backOrder(){
  178. this.show = true
  179. },
  180. //- 确认发货
  181. async posttransfer(){
  182. if(this.snlist.length === 0) return tips('请先选择SN');
  183. this.nextshow = true;
  184. },
  185. }
  186. });
  187. </script>
  188. </body>
  189. </html>