warehouse-deliver-transfer.html 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  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="vh100 pt0 pb0 ovh" 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="type === 0 ? '逐台划拨':'整箱划拨'" 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 v-if="type === 0" wrapable color="#eea75b" :scrollable="false" text="提示:可输入SN号后8位或者扫描条形码进行搜索"></van-notice-bar>
  27. <van-notice-bar v-if="type === 1" wrapable color="#eea75b" :scrollable="false" text="请输入或者扫描整箱机具的首台SN号,自动叠加整箱数"></van-notice-bar>
  28. <van-search class="top_search" v-model="searchContent" show-action @search="onSearch">
  29. <template #action>
  30. <div class="df searchbtn">
  31. <div class="searchcolor" @click="onSearch">搜索</div>
  32. <van-icon class="f16 searchicon" name="scan" @click="scanning"></van-icon>
  33. </div>
  34. </template>
  35. </van-search>
  36. <div class="f16 n transfer">
  37. <van-cell clickable v-if="snlist.length !== 0 &amp;&amp; type !== 0" @click="checkall">
  38. <template #title>
  39. <div class="f14 c333">全选</div>
  40. </template>
  41. <template #icon>
  42. <van-checkbox class="mr16" v-model="ischeckall" ref="checkboxes" checked-color="#FF5A32"></van-checkbox>
  43. </template>
  44. </van-cell>
  45. <div class="ovh-x" ref="wrapper1">
  46. <div class="undatatips tc c999" v-if="snlist.length === 0">暂无任何数据</div>
  47. <van-checkbox-group v-else v-model="result">
  48. <van-cell class="warehousecell" v-for="(item, index) in snlist" :key="item.Id" :value="item.ProductType" clickable @click="toggle(index)">
  49. <template #title>
  50. <div class="f14 c333"><span class="vm">SN:</span><span class="vm pr6" :id="'sn'+index">{{item.PosSn}}</span><span class="dib vm copyicon" :data-clipboard-text="item.PosSn" data-clipboard-action="copy" :data-clipboard-target="'#sn'+index" :ref="'copy'+index" @click.stop="copySN(index)" @mouseenter="copySN(index)"><img src="./static/images/icon-copy.png" alt="" width="14" height="14"></span></div>
  51. </template>
  52. <template #icon>
  53. <van-checkbox class="mr16" :name="item" ref="checkboxes" checked-color="#FF5A32"></van-checkbox>
  54. </template>
  55. </van-cell>
  56. </van-checkbox-group>
  57. </div>
  58. </div>
  59. <van-goods-action class="mall-bottom">
  60. <van-goods-action-button class="kxs-btn" type="default" color="#FFD500" :text="'确定 共'+result.length+'个'" @click="surebtn"></van-goods-action-button>
  61. </van-goods-action>
  62. </div>
  63. <script src="./static/js/clipboard.min.js"></script>
  64. <script src="./static/js/klm-vv.min.js"></script>
  65. <script src="./static/js/appfunc.min.js"></script>
  66. <script src="./static/js/klm-axios-config.js"></script>
  67. <script src="./static/js/publicfn.js"></script>
  68. <script>
  69. function OnStart(){
  70. allSearchContent = PublicLib.getCookieInfo("ScanContent");
  71. PublicLib.putCookieInfo('ScanContent', '');
  72. //- 拿到扫描结果进行赋值传输
  73. if(allSearchContent === undefined){
  74. return;
  75. };
  76. if(allSearchContent !== ''){
  77. app.getonlysearchresult(allSearchContent);
  78. };
  79. };
  80. // 通过 CDN 引入时不会自动注册 Lazyload 组件
  81. // 可以通过下面的方式手动注册
  82. Vue.use(vant.Lazyload);
  83. // 在 #app 标签下渲染一个按钮组件
  84. let app = new Vue({
  85. el: '#app',
  86. data() {
  87. return {
  88. toptitleisshow:false,
  89. type:1,
  90. searchContent:'',
  91. //- 下拉刷新
  92. loading: false,
  93. finished: false,
  94. refreshing: false,
  95. result: [],
  96. snlist:[
  97. ],
  98. ischeckall:false,
  99. pageinfo:{
  100. PageSize:100,
  101. PageNum:1
  102. },
  103. flag:false,
  104. };
  105. },
  106. created() {
  107. this.toptitleisshow = toptitleisshow;
  108. this.type = PublicLib.getCookieInfo('transferType') === '逐台划拨' ? 0 : 1;
  109. PublicLib.SetTitle({Title:PublicLib.getCookieInfo('transferType')});
  110. },
  111. beforeUpdate(){
  112. this.$nextTick(() => {
  113. this.$refs.wrapper1.style.height = `${document.documentElement.clientHeight - 180}px`;
  114. });
  115. },
  116. methods: {
  117. giveToast(str){
  118. vant.Toast(str);
  119. },
  120. onSearch(){
  121. if(this.searchContent.length < 8) return tips('请最少输入8位SN号');
  122. if(this.searchContent === '') return tips('请先输入SN号或者扫描','top');
  123. this.flag = true;
  124. this.getonlysearchresult()
  125. //- this.searchContent='';
  126. },
  127. copySN(index){
  128. const that = this;
  129. this.$nextTick(() => {
  130. that.copyBtn = new ClipboardJS(this.$refs['copy'+index][0]);
  131. const clipboard = that.copyBtn;
  132. clipboard.on('success', function(e) {
  133. that.giveToast('复制成功');
  134. });
  135. clipboard.on('error', function(e) {
  136. that.giveToast('复制失败,请手动选择复制!');
  137. });
  138. });
  139. },
  140. checkall(){
  141. const that = this;
  142. that.ischeckall = !that.ischeckall;
  143. if(that.ischeckall){
  144. that.result = that.snlist;
  145. }else{
  146. that.result = [];
  147. };
  148. },
  149. toggle(index) {
  150. const that = this;
  151. this.$refs.checkboxes[index].toggle();
  152. setTimeout(() => {
  153. if(that.result.length == that.snlist.length){
  154. that.ischeckall = true;
  155. }else{
  156. that.ischeckall = false;
  157. };
  158. }, 100);
  159. },
  160. async scanning(){
  161. PublicLib.ScanQRCode();
  162. },
  163. goback(){
  164. PublicLib.GoBack({Level:1});
  165. },
  166. async getonlysearchresult(info){
  167. if(info){
  168. this.searchContent = info;
  169. };
  170. let Url = '';
  171. switch(this.type){
  172. case 0:
  173. Url = 'api/v1/pos/posmachines/onesearch?t='+Math.random(6);
  174. break;
  175. case 1:
  176. Url = 'api/v1/pos/posmachines/wholesearch?t='+Math.random(6);
  177. break;
  178. };
  179. PublicLib.ShowLoading({Message:''});
  180. const StoreId = PublicLib.getCookieInfo('warehouseId');
  181. const BrandId = PublicLib.getCookieInfo('brandId');
  182. const res = await getRequest(Url,JSON.stringify({...this.pageinfo,SearchKey:this.searchContent,StoreId,BrandId}));
  183. if(res.status !== '1') return tips('搜索订单详情失败');
  184. PublicLib.HideLoading();
  185. switch(this.type){
  186. case 0:
  187. if(res.data.length === 0) return tips('仓库暂无该机具!')
  188. this.snlist.forEach(item=>{
  189. if(item.Id === res.data[0].Id){
  190. this.flag = false;
  191. tips('请输入不同SN号进行搜索!')
  192. };
  193. });
  194. if(this.flag){
  195. this.snlist.push(...res.data);
  196. };
  197. break;
  198. case 1:
  199. this.snlist = res.data;
  200. break;
  201. };
  202. },
  203. surebtn(){
  204. if(this.result.length === 0) return tips('请选择SN号');
  205. PublicLib.putCookieInfo('warehouseisback', 'true');
  206. PublicLib.putCookieInfo('warehouseSnList', JSON.stringify(this.result));
  207. PublicLib.ShowLoading({Message:'请稍后...'});
  208. setTimeout(()=>{
  209. PublicLib.HideLoading();
  210. PublicLib.GoBack({Level:1});
  211. },1500);
  212. }
  213. }
  214. });
  215. </script>
  216. </body>
  217. </html>